Class Arguments
source code
Wrapper for arguments in all controls. All non-"_" control
methods are assumed to take some representation of the command line. This
can either be:
-
the line as a string
-
the shlex'd line as a string list
To simplify usage, this class can be used at the beginning of every
method so:
def method(self, args):
args = Arguments(args)
and it will handle the above cases as well as wrapping other Argument
instances. If the method takes varargs and it is desired to test for
single argument of the above type, then use:
args = Arguments(*args)
|
|
|
|
|
|
|
|
|
shlex(self,
input)
Used to split a string argument via shlex.split(). |
source code
|
|
|
|
|
|
|
|
|
|
|
|
Used to split a string argument via shlex.split(). If the argument is
not a string, then it is returned unchnaged. This is useful since the arg
argument to all plugins can be either a list or a string.
|
For every argument without an "=" we return True. Otherwise,
the value following the first "=" is returned.
|