Skip to content

Commit 3355291

Browse files
xcz011jreback
authored andcommitted
remove outdated gtk package from code (#26590)
1 parent addc5fc commit 3355291

File tree

7 files changed

+9
-36
lines changed

7 files changed

+9
-36
lines changed

doc/source/install.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ Optional Dependencies
281281
`qtpy <https://github.com/spyder-ide/qtpy>`__ (requires PyQt or PySide),
282282
`PyQt5 <https://www.riverbankcomputing.com/software/pyqt/download5>`__,
283283
`PyQt4 <http://www.riverbankcomputing.com/software/pyqt/download>`__,
284-
`pygtk <http://www.pygtk.org/>`__,
285284
`xsel <http://www.vergenet.net/~conrad/software/xsel/>`__, or
286285
`xclip <https://github.com/astrand/xclip/>`__: necessary to use
287286
:func:`~pandas.read_clipboard`. Most package managers on Linux distributions will have ``xclip`` and/or ``xsel`` immediately available for installation.

doc/source/user_guide/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3272,7 +3272,7 @@ We can see that we got the same content back, which we had earlier written to th
32723272

32733273
.. note::
32743274

3275-
You may need to install xclip or xsel (with gtk, PyQt5, PyQt4 or qtpy) on Linux to use these methods.
3275+
You may need to install xclip or xsel (with PyQt5, PyQt4 or qtpy) on Linux to use these methods.
32763276

32773277
.. _io.pickle:
32783278

doc/source/whatsnew/v0.25.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ Other API Changes
434434
- The ``arg`` argument in :meth:`pandas.core.groupby.DataFrameGroupBy.agg` has been renamed to ``func`` (:issue:`26089`)
435435
- The ``arg`` argument in :meth:`pandas.core.window._Window.aggregate` has been renamed to ``func`` (:issue:`26372`)
436436
- Most Pandas classes had a ``__bytes__`` method, which was used for getting a python2-style bytestring representation of the object. This method has been removed as a part of dropping Python2 (:issue:`26447`)
437+
- Removed support of gtk package for clipboards (:issue:`26563`)
437438

438439
.. _whatsnew_0250.deprecations:
439440

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ def to_clipboard(self, excel=True, sep=None, **kwargs):
26792679
-----
26802680
Requirements for your platform.
26812681
2682-
- Linux : `xclip`, or `xsel` (with `gtk` or `PyQt4` modules)
2682+
- Linux : `xclip`, or `xsel` (with `PyQt4` modules)
26832683
- Windows : none
26842684
- OS X : none
26852685

pandas/io/clipboard/__init__.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,19 @@
1818
On Linux, install xclip or xsel via package manager. For example, in Debian:
1919
sudo apt-get install xclip
2020
21-
Otherwise on Linux, you will need the gtk, qtpy or PyQt modules installed.
21+
Otherwise on Linux, you will need the qtpy or PyQt modules installed.
2222
qtpy also requires a python-qt-bindings module: PyQt4, PyQt5, PySide, PySide2
2323
24-
gtk and PyQt4 modules are not available for Python 3,
25-
and this module does not work with PyGObject yet.
24+
This module does not work with PyGObject yet.
2625
"""
2726
__version__ = '1.5.27'
2827

2928
import platform
3029
import os
3130
import subprocess
32-
from .clipboards import (init_osx_clipboard,
33-
init_gtk_clipboard, init_qt_clipboard,
34-
init_xclip_clipboard, init_xsel_clipboard,
35-
init_klipper_clipboard, init_no_clipboard)
31+
from .clipboards import (
32+
init_osx_clipboard, init_qt_clipboard, init_xclip_clipboard,
33+
init_xsel_clipboard, init_klipper_clipboard, init_no_clipboard)
3634
from .windows import init_windows_clipboard
3735

3836
# `import qtpy` sys.exit()s if DISPLAY is not in the environment.
@@ -60,14 +58,6 @@ def determine_clipboard():
6058
return init_osx_clipboard()
6159
if HAS_DISPLAY:
6260
# Determine which command/module is installed, if any.
63-
try:
64-
# Check if gtk is installed
65-
import gtk # noqa
66-
except ImportError:
67-
pass
68-
else:
69-
return init_gtk_clipboard()
70-
7161
try:
7262
# qtpy is a small abstraction layer that lets you write
7363
# applications using a single api call to either PyQt or PySide
@@ -104,7 +94,6 @@ def set_clipboard(clipboard):
10494
global copy, paste
10595

10696
clipboard_types = {'osx': init_osx_clipboard,
107-
'gtk': init_gtk_clipboard,
10897
'qt': init_qt_clipboard,
10998
'xclip': init_xclip_clipboard,
11099
'xsel': init_xsel_clipboard,

pandas/io/clipboard/clipboards.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,6 @@ def paste_osx():
2222
return copy_osx, paste_osx
2323

2424

25-
def init_gtk_clipboard():
26-
import gtk
27-
28-
def copy_gtk(text):
29-
global cb
30-
cb = gtk.Clipboard()
31-
cb.set_text(text)
32-
cb.store()
33-
34-
def paste_gtk():
35-
clipboardContents = gtk.Clipboard().wait_for_text()
36-
return clipboardContents
37-
38-
return copy_gtk, paste_gtk
39-
40-
4125
def init_qt_clipboard():
4226
# $DISPLAY should exist
4327

pandas/io/clipboards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def to_clipboard(obj, excel=True, sep=None, **kwargs): # pragma: no cover
9191
Notes
9292
-----
9393
Requirements for your platform
94-
- Linux: xclip, or xsel (with gtk or PyQt4 modules)
94+
- Linux: xclip, or xsel (with PyQt4 modules)
9595
- Windows:
9696
- OS X:
9797
"""

0 commit comments

Comments
 (0)