コード例 #1
0
ファイル: utils.py プロジェクト: falcolee/PyIDM
def alternative_to_gtk_clipboard():
    """
    This is an ugly fix for pyperclip to stop using gtk
    for unknown reason Gtk clipboard cause PyIDM to freeze system task bar in Manjaro kde, if we use is_solo()
    """
    def executable_exists(name):
        return subprocess.call(['which', name], stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0

    if executable_exists("xsel"):
        return clipboard.init_xsel_clipboard()
    if executable_exists("xclip"):
        return clipboard.init_xclip_clipboard()
    if executable_exists("klipper") and executable_exists("qdbus"):
        return clipboard.init_klipper_clipboard()
    else:
        log('clipboard needs "xsel", or "xclip" installed to run properly')
        return clipboard.init_no_clipboard()
コード例 #2
0
class TestXClip(_TestClipboard):
    if _executable_exists("xclip"):
        clipboard = init_xclip_clipboard()