Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import PyQt4
except ImportError:
pass
else:
clipboard = init_qt_clipboard()
else:
clipboard = init_qt_clipboard()
class TestXClip(_TestClipboard):
if _executable_exists("xclip"):
clipboard = init_xclip_clipboard()
class TestXSel(_TestClipboard):
if _executable_exists("xsel"):
clipboard = init_xsel_clipboard()
class TestKlipper(_TestClipboard):
if _executable_exists("klipper") and _executable_exists("qdbus"):
clipboard = init_klipper_clipboard()
class TestNoClipboard(unittest.TestCase):
copy, paste = init_no_clipboard()
def test_copy(self):
with self.assertRaises(RuntimeError):
self.copy("foo")
def test_paste(self):
else:
clipboard = init_qt_clipboard()
class TestXClip(_TestClipboard):
if _executable_exists("xclip"):
clipboard = init_xclip_clipboard()
class TestXSel(_TestClipboard):
if _executable_exists("xsel"):
clipboard = init_xsel_clipboard()
class TestKlipper(_TestClipboard):
if _executable_exists("klipper") and _executable_exists("qdbus"):
clipboard = init_klipper_clipboard()
class TestNoClipboard(unittest.TestCase):
copy, paste = init_no_clipboard()
def test_copy(self):
with self.assertRaises(RuntimeError):
self.copy("foo")
def test_paste(self):
with self.assertRaises(RuntimeError):
self.paste()
if __name__ == '__main__':
if HAS_DISPLAY:
try:
import PyQt5
except ImportError:
try:
import PyQt4
except ImportError:
pass
else:
clipboard = init_qt_clipboard()
else:
clipboard = init_qt_clipboard()
class TestXClip(_TestClipboard):
if _executable_exists("xclip"):
clipboard = init_xclip_clipboard()
class TestXSel(_TestClipboard):
if _executable_exists("xsel"):
clipboard = init_xsel_clipboard()
class TestKlipper(_TestClipboard):
if _executable_exists("klipper") and _executable_exists("qdbus"):
clipboard = init_klipper_clipboard()
class TestNoClipboard(unittest.TestCase):
copy, paste = init_no_clipboard()