diff options
author | Brian Dolbec <dolsen@gentoo.org> | 2018-07-02 14:33:38 -0700 |
---|---|---|
committer | Brian Dolbec <dolsen@gentoo.org> | 2018-07-06 22:22:11 -0700 |
commit | f048645778033bed905ca391c93234dc9c880067 (patch) | |
tree | c26d770708506e17dad4f1ae21fc4b11c0dd54ac | |
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>
-rw-r--r-- | gkeys/gkeys/__init__.py | 8 | ||||
-rw-r--r-- | gkeys/gkeys/actions.py | 9 |
2 files changed, 9 insertions, 8 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: diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index 71ed081..64d6123 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -15,18 +15,11 @@ from __future__ import print_function import itertools import os -import sys - -if sys.version_info[0] >= 3: - py_input = input - _unicode = str -else: - py_input = raw_input - _unicode = unicode from collections import defaultdict +from gkeys import _unicode, py_input from gkeys.actionbase import ActionBase from gkeys.gkey import GKEY from gkeys.checks import SPECCHECK_SUMMARY, convert_pf, convert_yn |