Base.Executable

Exceptions

Classes

exception Base.Executable.ExecutableException(message='')[source]

This exception is raised by all executable abstraction classes.

Inheritance

Inheritance diagram of ExecutableException

Members

__str__()

Returns the exception’s message text.

args
class Base.Executable.CommandLineArgument[source]

Base class (and meta class) for all Arguments classes.

Inheritance

Inheritance diagram of CommandLineArgument

Members

_value = None
mro() → list

return a type’s method resolution order

class Base.Executable.ExecutableArgument[source]

Represents the executable.

Inheritance

Inheritance diagram of ExecutableArgument

Members

Value
AsArgument()[source]
_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

Inheritance diagram of NamedCommandLineArgument

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 calls git-checkout.exe.

Inheritance

Inheritance diagram of CommandArgument

Members

_pattern = '{0}'
Value
AsArgument()[source]
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

Inheritance diagram of ShortCommandArgument

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

Inheritance diagram of LongCommandArgument

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

Inheritance diagram of WindowsCommandArgument

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

Inheritance diagram of StringArgument

Members

_pattern = '{0}'
Value
AsArgument()[source]
_value = None
mro() → list

return a type’s method resolution order

class Base.Executable.StringListArgument[source]

Represents a list of string arguments.

Inheritance

Inheritance diagram of StringListArgument

Members

_pattern = '{0}'
Value
AsArgument()[source]
_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

Inheritance diagram of PathArgument

Members

_PosixFormat = False
Value
AsArgument()[source]
_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

Inheritance diagram of FlagArgument

Members

_pattern = '{0}'
Value
AsArgument()[source]
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

Inheritance diagram of ShortFlagArgument

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

Inheritance diagram of LongFlagArgument

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

Inheritance diagram of WindowsFlagArgument

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

Inheritance diagram of ValuedFlagArgument

Members

_pattern = '{0}={1}'
Value
AsArgument()[source]
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

Inheritance diagram of ShortValuedFlagArgument

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

Inheritance diagram of LongValuedFlagArgument

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

Inheritance diagram of WindowsValuedFlagArgument

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. Each ValuedFlagArgument 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

Inheritance diagram of ValuedFlagListArgument

Members

_pattern = '{0}={1}'
Value
AsArgument()[source]
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

Inheritance diagram of ShortValuedFlagListArgument

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

Inheritance diagram of LongValuedFlagListArgument

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

Inheritance diagram of WindowsValuedFlagListArgument

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

Inheritance diagram of TupleArgument

Members

_switchPattern = '{0}'
_valuePattern = '{0}'
Value
AsArgument()[source]
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

Inheritance diagram of ShortTupleArgument

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

Inheritance diagram of LongTupleArgument

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

Inheritance diagram of WindowsTupleArgument

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

Inheritance diagram of CommandLineArgumentList

Members

ToArgumentList()[source]
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.Environment[source]

Inheritance

Inheritance diagram of Environment

Members

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

Inheritance diagram of Executable

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
StartProcess(parameterList)[source]
Send(line, end='\n')[source]
SendBoundary()[source]
Terminate()[source]
GetReader()[source]
ReadUntilBoundary(indent=0)[source]