diff options
author | 2018-07-02 14:33:38 -0700 | |
---|---|---|
committer | 2018-07-06 22:22:11 -0700 | |
commit | f048645778033bed905ca391c93234dc9c880067 (patch) | |
tree | c26d770708506e17dad4f1ae21fc4b11c0dd54ac /gkeys/gkeys/__init__.py | |
parent | gkeys-ldap update-seeds.sh: Add -S option to git commits to ensure they are g... (diff) | |
download | gentoo-keys-f048645778033bed905ca391c93234dc9c880067.tar.gz gentoo-keys-f048645778033bed905ca391c93234dc9c880067.tar.bz2 gentoo-keys-f048645778033bed905ca391c93234dc9c880067.zip |
gkeys/actions/py: Move the py_input & _unicode import to __init__.py
This way it is done once and can be re-used anywhere in the code.
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
Diffstat (limited to 'gkeys/gkeys/__init__.py')
-rw-r--r-- | gkeys/gkeys/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gkeys/gkeys/__init__.py b/gkeys/gkeys/__init__.py index 05fc730..a1e901c 100644 --- a/gkeys/gkeys/__init__.py +++ b/gkeys/gkeys/__init__.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- +import sys from collections import OrderedDict @@ -11,6 +12,13 @@ from gkeys.action_map import Action_Map, Available_Actions __version__ = '0.2' __license__ = 'GPLv2' +if sys.version_info[0] >= 3: + py_input = input + _unicode = str +else: + py_input = raw_input + _unicode = unicode + subdata = OrderedDict() for cmd in Available_Actions: |