commit: 734aed55964979017863639edfc9ca9036a629c0
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 23 15:40:21 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 25 16:43:13 2015 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=734aed55
gkeys/base.py: Add an alternate args class for compatibility use for Action as
an API
Rough draft, so it can be used for the args arguments in Actions functions.
An alternate to having an argsparser innstance.
gkeys/gkeys/base.py | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/gkeys/gkeys/base.py b/gkeys/gkeys/base.py
index fba1976..b422caf 100644
--- a/gkeys/gkeys/base.py
+++ b/gkeys/gkeys/base.py
@@ -26,6 +26,33 @@ if sys.version_info[0] >= 3:
unicode = str
+class Args(object):
+ '''Basic argsparser replacement for using gkeys Actions via an API
+
+ Holds the full spectrum of possible options supported.
+ Not all options used by all actions.'''
+
+
+ def __init__(self):
+ self.status = False
+ self.all = False
+ self.category = None
+ self.cleankey = False
+ self.destination = None
+ self.exact = False
+ self.filename = None
+ self.fingerprint = None
+ self.keyid = None
+ self.keyring = None
+ self.keys = None
+ self.nick = None
+ self.name = None
+ self.keydir = None
+ self.seedfile = None
+ self.signature = None
+ self.uid = None
+
+
class CliBase(object):
'''Common cli and argsparse options class'''