Package Bio :: Package Application :: Class _Option
[hide private]
[frames] | no frames]

Class _Option

source code

_AbstractParameter --+
                     |
                    _Option

Represent an option that can be set for a program.

This holds UNIXish options like --append=yes and -a yes,
where a value (here "yes") is generally expected.

For UNIXish options like -kimura in clustalw which don't
take a value, use the _Switch object instead.

Attributes:

o names -- a list of string names (typically two entries) by which
the parameter can be set via the legacy set_parameter method
(eg ["-a", "--append", "append"]). The first name in list is used
when building the command line. The last name in the list is a
"human readable" name describing the option in one word. This
must be a valid Python identifier as it is used as the property
name and as a keyword argument, and should therefore follow PEP8
naming.

o description -- a description of the option. This is used as
the property docstring.

o filename -- True if this argument is a filename and should be
automatically quoted if it contains spaces.

o checker_function -- a reference to a function that will determine
if a given value is valid for this parameter. This function can either
raise an error when given a bad value, or return a [0, 1] decision on
whether the value is correct.

o equate -- should an equals sign be inserted if a value is used?

o is_required -- a flag to indicate if the parameter must be set for
the program to be run.

o is_set -- if the parameter has been set

o value -- the value of a parameter

Instance Methods [hide private]
 
__init__(self, names, description, filename=False, checker_function=None, is_required=False, equate=True) source code
 
__str__(self)
Return the value of this option for the commandline.
source code
Method Details [hide private]

__init__(self, names, description, filename=False, checker_function=None, is_required=False, equate=True)
(Constructor)

source code 
Overrides: _AbstractParameter.__init__

__str__(self)
(Informal representation operator)

source code 
Return the value of this option for the commandline.

Includes a trailing space.

Overrides: _AbstractParameter.__str__