Factory class used to generate argument class instances for argparse.
More...
Factory class used to generate argument class instances for argparse.
Definition at line 31 of file trfArgClasses.py.
◆ __init__()
def python.trfArgClasses.argFactory.__init__ |
( |
|
self, |
|
|
|
genclass, |
|
|
* |
args, |
|
|
** |
kwargs |
|
) |
| |
Definition at line 32 of file trfArgClasses.py.
32 def __init__(self, genclass, *args, **kwargs):
33 msg.debug(
'Initialised class %s with args=%s; kwargs=%s', genclass, args, kwargs)
34 self._genclass = genclass
◆ __call__()
def python.trfArgClasses.argFactory.__call__ |
( |
|
self, |
|
|
|
valueString = None |
|
) |
| |
Definition at line 38 of file trfArgClasses.py.
38 def __call__(self, valueString=None):
39 msg.debug(
'Called class %s with value=%s; args=%s; kwargs=%s', self._genclass, valueString, self._args, self._kwargs)
47 if valueString
is None:
48 obj = self._genclass(*self._args, **self._kwargs)
50 obj = self._genclass(valueString, *self._args, **self._kwargs)
51 except Exception
as e:
52 msg.fatal(
'Got this exception raised when calling object factory: {0}'.
format(e))
◆ __str__()
def python.trfArgClasses.argFactory.__str__ |
( |
|
self | ) |
|
Definition at line 56 of file trfArgClasses.py.
57 return 'argFactory for {0}, args {1}, kwargs {2}'.
format(self._genclass, self._args, self._kwargs)
◆ _args
python.trfArgClasses.argFactory._args |
|
private |
◆ _genclass
python.trfArgClasses.argFactory._genclass |
|
private |
◆ _kwargs
python.trfArgClasses.argFactory._kwargs |
|
private |
The documentation for this class was generated from the following file: