21
21
sudo apt-get install xclip
22
22
sudo apt-get install xsel
23
23
24
- Otherwise on Linux, you will need the gtk or PyQt5/PyQt4 modules installed.
24
+ Otherwise on Linux, you will need the PyQt5 modules installed.
25
25
26
- gtk and PyQt4 modules are not available for Python 3,
27
- and this module does not work with PyGObject yet.
28
-
29
- Note: There seems to be a way to get gtk on Python 3, according to:
30
- https://askubuntu.com/questions/697397/python3-is-not-supporting-gtk-module
26
+ This module does not work with PyGObject yet.
31
27
32
28
Cygwin is currently not supported.
33
29
@@ -138,28 +134,6 @@ def paste_osx_pyobjc():
138
134
return copy_osx_pyobjc , paste_osx_pyobjc
139
135
140
136
141
- def init_gtk_clipboard ():
142
- global gtk
143
- import gtk
144
-
145
- def copy_gtk (text ):
146
- global cb
147
- text = _stringifyText (text ) # Converts non-str values to str.
148
- cb = gtk .Clipboard ()
149
- cb .set_text (text )
150
- cb .store ()
151
-
152
- def paste_gtk ():
153
- clipboardContents = gtk .Clipboard ().wait_for_text ()
154
- # for python 2, returns None if the clipboard is blank.
155
- if clipboardContents is None :
156
- return ""
157
- else :
158
- return clipboardContents
159
-
160
- return copy_gtk , paste_gtk
161
-
162
-
163
137
def init_qt_clipboard ():
164
138
global QApplication
165
139
# $DISPLAY should exist
@@ -529,7 +503,7 @@ def determine_clipboard():
529
503
accordingly.
530
504
"""
531
505
532
- global Foundation , AppKit , gtk , qtpy , PyQt4 , PyQt5
506
+ global Foundation , AppKit , qtpy , PyQt4 , PyQt5
533
507
534
508
# Setup for the CYGWIN platform:
535
509
if (
@@ -566,13 +540,6 @@ def determine_clipboard():
566
540
567
541
# Setup for the LINUX platform:
568
542
if HAS_DISPLAY :
569
- try :
570
- import gtk # check if gtk is installed
571
- except ImportError :
572
- pass # We want to fail fast for all non-ImportError exceptions.
573
- else :
574
- return init_gtk_clipboard ()
575
-
576
543
if _executable_exists ("xsel" ):
577
544
return init_xsel_clipboard ()
578
545
if _executable_exists ("xclip" ):
@@ -611,7 +578,6 @@ def set_clipboard(clipboard):
611
578
implement the copy/paste feature. The clipboard parameter must be one of:
612
579
- pbcopy
613
580
- pbobjc (default on Mac OS X)
614
- - gtk
615
581
- qt
616
582
- xclip
617
583
- xsel
@@ -624,7 +590,6 @@ def set_clipboard(clipboard):
624
590
clipboard_types = {
625
591
"pbcopy" : init_osx_pbcopy_clipboard ,
626
592
"pyobjc" : init_osx_pyobjc_clipboard ,
627
- "gtk" : init_gtk_clipboard ,
628
593
"qt" : init_qt_clipboard , # TODO - split this into 'qtpy', 'pyqt4', and 'pyqt5'
629
594
"xclip" : init_xclip_clipboard ,
630
595
"xsel" : init_xsel_clipboard ,
0 commit comments