Base.Executable¶
Exceptions
ExecutableException
: This exception is raised by all executable abstraction classes.
Classes
CommandLineArgument
: Base class (and meta class) for all Arguments classes.ExecutableArgument
: Represents the executable.NamedCommandLineArgument
: Base class for all command line arguments with a name.CommandArgument
: Represents a command name.ShortCommandArgument
: Represents a command name with a single dash.LongCommandArgument
: Represents a command name with a double dash.WindowsCommandArgument
: Represents a command name with a single slash.StringArgument
: Represents a simple string argument.StringListArgument
: Represents a list of string arguments.PathArgument
: Represents a path argument.FlagArgument
: Base class for all FlagArgument classes, which represents a simple flag argument.ShortFlagArgument
: Represents a flag argument with a single dash.LongFlagArgument
: Represents a flag argument with a double dash.WindowsFlagArgument
: Represents a flag argument with a single slash.ValuedFlagArgument
: Class and base class for all ValuedFlagArgument classes, which represents a flag argument with data.ShortValuedFlagArgument
: Represents aValuedFlagArgument
with a single dash.LongValuedFlagArgument
: Represents aValuedFlagArgument
with a double dash.WindowsValuedFlagArgument
: Represents aValuedFlagArgument
with a single slash.ValuedFlagListArgument
: Class and base class for all ValuedFlagListArgument classes, which represents a list ofValuedFlagArgument
instances.ShortValuedFlagListArgument
: Represents aValuedFlagListArgument
with a single dash.LongValuedFlagListArgument
: Represents aValuedFlagListArgument
with a double dash.WindowsValuedFlagListArgument
: Represents aValuedFlagListArgument
with a single slash.TupleArgument
: Class and base class for all TupleArgument classes, which represents a switch with separate data.ShortTupleArgument
: Represents aTupleArgument
with a single dash in front of the switch name.LongTupleArgument
: Represents aTupleArgument
with a double dash in front of the switch name.WindowsTupleArgument
: Represents aTupleArgument
with a single slash in front of the switch name.CommandLineArgumentList
: Represent a list of all available commands, flags and switch of an executable.Environment
: Undocumented.Executable
: Represent an executable.
-
exception
Base.Executable.
ExecutableException
(message='')[source]¶ This exception is raised by all executable abstraction classes.
Inheritance
Members
-
__str__
()¶ Returns the exception’s message text.
-
args
¶
-
-
class
Base.Executable.
CommandLineArgument
[source]¶ Base class (and meta class) for all Arguments classes.
Inheritance
Members
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ExecutableArgument
[source]¶ Represents the executable.
Inheritance
Members
-
Value
¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
NamedCommandLineArgument
[source]¶ Base class for all command line arguments with a name.
Inheritance
Members
-
_name
= None¶
-
Name
¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
CommandArgument
[source]¶ Represents a command name.
It is usually used to select a sub parser in a CLI argument parser or to hand over all following parameters to a separate tool. An example for a command is ‘checkout’ in
git.exe checkout
, which callsgit-checkout.exe
.Inheritance
Members
-
_pattern
= '{0}'¶
-
Value
¶
-
Name
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ShortCommandArgument
[source]¶ Represents a command name with a single dash.
Inheritance
Members
-
_pattern
= '-{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
LongCommandArgument
[source]¶ Represents a command name with a double dash.
Inheritance
Members
-
_pattern
= '--{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
WindowsCommandArgument
[source]¶ Represents a command name with a single slash.
Inheritance
Members
-
_pattern
= '/{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
StringArgument
[source]¶ Represents a simple string argument.
Inheritance
Members
-
_pattern
= '{0}'¶
-
Value
¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
StringListArgument
[source]¶ Represents a list of string arguments.
Inheritance
Members
-
_pattern
= '{0}'¶
-
Value
¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
PathArgument
[source]¶ Represents a path argument.
The output format can be forced to the POSIX format with
_PosixFormat
.Inheritance
Members
-
_PosixFormat
= False¶
-
Value
¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
FlagArgument
[source]¶ Base class for all FlagArgument classes, which represents a simple flag argument.
A simple flag is a single boolean value (absent/present or off/on) with no data.
Inheritance
Members
-
_pattern
= '{0}'¶
-
Value
¶
-
Name
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ShortFlagArgument
[source]¶ Represents a flag argument with a single dash.
Example:
-optimize
Inheritance
Members
-
_pattern
= '-{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
LongFlagArgument
[source]¶ Represents a flag argument with a double dash.
Example:
--optimize
Inheritance
Members
-
_pattern
= '--{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
WindowsFlagArgument
[source]¶ Represents a flag argument with a single slash.
Example:
/optimize
Inheritance
Members
-
_pattern
= '/{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ValuedFlagArgument
[source]¶ Class and base class for all ValuedFlagArgument classes, which represents a flag argument with data.
A valued flag is a flag name followed by a value. The default delimiter sign is equal (
=
). Name and value are passed as one arguments to the executable even if the delimiter sign is a whitespace character.Example:
width=100
Inheritance
Members
-
_pattern
= '{0}={1}'¶
-
Value
¶
-
Name
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ShortValuedFlagArgument
[source]¶ Represents a
ValuedFlagArgument
with a single dash.Example:
-optimizer=on
Inheritance
Members
-
_pattern
= '-{0}={1}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
LongValuedFlagArgument
[source]¶ Represents a
ValuedFlagArgument
with a double dash.Example:
--optimizer=on
Inheritance
Members
-
_pattern
= '--{0}={1}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
WindowsValuedFlagArgument
[source]¶ Represents a
ValuedFlagArgument
with a single slash.Example:
/optimizer:on
Inheritance
Members
-
_pattern
= '/{0}:{1}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ValuedFlagListArgument
[source]¶ Class and base class for all ValuedFlagListArgument classes, which represents a list of
ValuedFlagArgument
instances.Each list item gets translated into a
ValuedFlagArgument
, with the same flag name, but differing values. EachValuedFlagArgument
is passed as a single argument to the executable, even if the delimiter sign is a whitespace character.Example:
file=file1.txt file=file2.txt
Inheritance
Members
-
_pattern
= '{0}={1}'¶
-
Value
¶
-
Name
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ShortValuedFlagListArgument
[source]¶ Represents a
ValuedFlagListArgument
with a single dash.Example:
-file=file1.txt -file=file2.txt
Inheritance
Members
-
_pattern
= '-{0}={1}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
LongValuedFlagListArgument
[source]¶ Represents a
ValuedFlagListArgument
with a double dash.Example:
--file=file1.txt --file=file2.txt
Inheritance
Members
-
_pattern
= '--{0}={1}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
WindowsValuedFlagListArgument
[source]¶ Represents a
ValuedFlagListArgument
with a single slash.Example:
/file:file1.txt /file:file2.txt
Inheritance
Members
-
_pattern
= '/{0}:{1}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
TupleArgument
[source]¶ Class and base class for all TupleArgument classes, which represents a switch with separate data.
A tuple switch is a command line argument followed by a separate value. Name and value are passed as two arguments to the executable.
Example:
width 100
Inheritance
Members
-
_switchPattern
= '{0}'¶
-
_valuePattern
= '{0}'¶
-
Value
¶
-
Name
¶
-
_name
= None¶
-
_value
= None¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
ShortTupleArgument
[source]¶ Represents a
TupleArgument
with a single dash in front of the switch name.Example:
-file file1.txt
Inheritance
Members
-
_switchPattern
= '-{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
_valuePattern
= '{0}'¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
LongTupleArgument
[source]¶ Represents a
TupleArgument
with a double dash in front of the switch name.Example:
--file file1.txt
Inheritance
Members
-
_switchPattern
= '--{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
_valuePattern
= '{0}'¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
WindowsTupleArgument
[source]¶ Represents a
TupleArgument
with a single slash in front of the switch name.Example:
/file file1.txt
Inheritance
Members
-
_switchPattern
= '/{0}'¶
-
AsArgument
()¶
-
Name
¶
-
Value
¶
-
_name
= None¶
-
_value
= None¶
-
_valuePattern
= '{0}'¶
-
mro
() → list¶ return a type’s method resolution order
-
-
class
Base.Executable.
CommandLineArgumentList
(*args)[source]¶ Represent a list of all available commands, flags and switch of an executable.
Inheritance
Members
-
append
(object) → None -- append object to end¶
-
clear
() → None -- remove all items from L¶
-
copy
() → list -- a shallow copy of L¶
-
count
(value) → integer -- return number of occurrences of value¶
-
extend
(iterable) → None -- extend list by appending elements from the iterable¶
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
insert
()¶ L.insert(index, object) – insert object before index
-
pop
([index]) → item -- remove and return item at index (default last).¶ Raises IndexError if list is empty or index is out of range.
-
remove
(value) → None -- remove first occurrence of value.¶ Raises ValueError if the value is not present.
-
reverse
()¶ L.reverse() – reverse IN PLACE
-
sort
(key=None, reverse=False) → None -- stable sort *IN PLACE*¶
-
-
class
Base.Executable.
Executable
(platform: str, dryrun: bool, executablePath: pathlib.Path, environment: Base.Executable.Environment = None, logger: Base.Logging.Logger = None)[source]¶ Represent an executable.
Inheritance
Members
-
_POC_BOUNDARY
= '====== POC BOUNDARY ======'¶
-
Log
(entry, condition=True)¶ Write an entry to the local logger.
-
LogDebug
(*args, condition=True, **kwargs)¶
-
LogDryRun
(*args, condition=True, **kwargs)¶
-
LogError
(*args, condition=True, **kwargs)¶
-
LogFatal
(*args, condition=True, **kwargs)¶
-
LogInfo
(*args, condition=True, **kwargs)¶
-
LogNormal
(*args, condition=True, **kwargs)¶
-
LogQuiet
(*args, condition=True, **kwargs)¶
-
LogVerbose
(*args, condition=True, **kwargs)¶
-
LogWarning
(*args, condition=True, **kwargs)¶
-
Logger
¶ Return the local logger instance.
-
_TryLog
(*args, condition=True, **kwargs)¶
-
Path
¶
-