Browse Source

Drop Python 2 support

Python 2 went EOL almost 1 year and half ago, and Python 2 bits are
tested less and less. Even more, Python 3 has been available for years
before that.

Hence, drop the support for Python 2, and assume Python 3 instead.
pull/23/head
Pino Toscano 3 years ago
parent
commit
e86d98c8c6
  1. 5
      README.md
  2. 5
      man/xdgmenumaker.t2t
  3. 21
      src/xdgmenumaker

5
README.md

@ -23,10 +23,9 @@ xdgmenumaker currently supports generating menus for:
* windowmaker
**xdgmenumaker** requires:
* Python 2.7 or 3.x
* Python 3.x
* pyxdg
* pygtk (for Python 2)
* pygobject and gobject-instrospection (for Python 3)
* pygobject and gobject-instrospection
* Pillow (optional)

5
man/xdgmenumaker.t2t

@ -40,9 +40,8 @@ according to the running user locale settings.
- windowmaker
**xdgmenumaker** requires //Python 2.7// or //3.x//, //pygtk//
(for Python 2.7) or //pygobject// and //gobject-instrospection//
(for Python 3.x), as well as //pyxdg//. //Pillow// is an optional
**xdgmenumaker** requires //Python 3.x//, //pygobject// and
//gobject-instrospection//, as well as //pyxdg//. //Pillow// is an optional
dependency (used by the **--max-icon-size** option).

21
src/xdgmenumaker

@ -13,21 +13,12 @@ import xdg.Exceptions as exc
import xdg.BaseDirectory as bd
from operator import attrgetter
# ConfigParser in Python2 has been renamed to configparser (all lower case)
# in Python3. So, it's a good way to find out which Python version is being
# used.
python3 = False
try:
import ConfigParser as cp
except ImportError:
import configparser as cp
python3 = True
# Under Python3, load the gtk compatibility layer
if python3:
from gi import pygtkcompat
pygtkcompat.enable()
pygtkcompat.enable_gtk(version='3.0')
import configparser as cp
# Load the gtk compatibility layer
from gi import pygtkcompat
pygtkcompat.enable()
pygtkcompat.enable_gtk(version='3.0')
import gtk
seticon = False

Loading…
Cancel
Save