ToolChain

Submodules

Exceptions

Classes

exception ToolChain.ToolChainException(message='')[source]

Base class for all tool specific exceptions

Inheritance

Inheritance diagram of ToolChainException

Members

__init__(message='')

Exception initializer

Parameters:message (str) – The exception message.
__str__()

Returns the exception’s message text.

args
exception ToolChain.ConfigurationException(message='')[source]

ConfigurationException is raise while running configuration or database tasks in PoC

Inheritance

Inheritance diagram of ConfigurationException

Members

__init__(message='')

Exception initializer

Parameters:message (str) – The exception message.
__str__()

Returns the exception’s message text.

args
exception ToolChain.SkipConfigurationException(message='')[source]

SkipConfigurationException is a ConfigurationException, which can be skipped.

Inheritance

Inheritance diagram of SkipConfigurationException

Members

__init__(message='')

Exception initializer

Parameters:message (str) – The exception message.
__str__()

Returns the exception’s message text.

args
class ToolChain.ConfigurationState[source]

Describes the configuration state of a tool or vendor.

Inheritance

Inheritance diagram of ConfigurationState

Members

Unconfigured = 0
Configured = 1
class ToolChain.ChangeState[source]

Describes if a configuration was changed.

Inheritance

Inheritance diagram of ChangeState

Members

Unchanged = 0
Changed = 1
class ToolChain.ToolMixIn(platform, dryrun, binaryDirectoryPath, version, logger=None)[source]

Inheritance

Inheritance diagram of ToolMixIn

Members

class ToolChain.AskMixIn[source]

Inheritance

Inheritance diagram of AskMixIn

Members

_Ask(question, default, beforeDefault='', afterDefault='', indent=1)[source]
_Ask_YesNoPass(question, indent=1)[source]

Ask a YES/no/pass question.

_AskYes_NoPass(question, indent=1)[source]

Ask a yes/NO/pass question.

_PrintAvailableEditions(editions, selectedEdition)[source]

Print all available editions and return the selected index.

class ToolChain.Configuration(host: Base.IHost)[source]

Base class for all Configuration classes.

Inheritance

Inheritance diagram of Configuration

Members

_vendor = 'Unknown'

The name of the tools vendor.

_section = 'INSTALL.Name'

The name of the configuration section. Pattern: INSTALL.Tool.

_multiVersionSupport = False

True if a tool supports multiple versions installed on the same system.

_template = {'Windows': {'INSTALL.Name': {}}, 'Darwin': {'INSTALL.Name': {}}, 'ALL': {'INSTALL.Name': {}}, 'Linux': {'INSTALL.Name': {}}}

The template for the configuration sections represented as nested dictionaries.

Host

Return the hosting object.

State

Return the configuration state.

SectionName

Return the configuration’s section name.

IsSupportedPlatform()[source]

Return true if the given platform is supported by this configuration routine.

IsConfigured()[source]

Return true if the configurations section is configured

CheckDependency()[source]

Check if all vendor or tool dependencies are fulfilled to configure this tool.

classmethod GetSections(platform)[source]

Return all section names for this configuration.

PrepareSections(warningWasWritten, writeWarnings=True)[source]
ClearSection(writeWarnings=False)[source]

Clear the configuration section associated to this Configuration class.

PrepareOptions(writeWarnings=True)[source]
ConfigureForDarwin()[source]

Start the configuration procedure for Darwin.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Darwin specific configuration routine.

ConfigureForLinux()[source]

Start the configuration procedure for Linux.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Linux specific configuration routine.

ConfigureForWindows()[source]

Start the configuration procedure for Windows.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Windows specific configuration routine.

ConfigureForAll()[source]

Start a generic (platform independent) configuration procedure.

Overwrite this method to implement a generic configuration routine for a (tool) Configuration class.

_AskInstalled(question)[source]

Ask a Yes/No/Pass question.

_ConfigureInstallationDirectory()[source]

Asks for installation directory and updates section. Checks if entered directory exists and returns Path object. If no installation directory was configured before, then _GetDefaultInstallationDir is called.

_GetDefaultInstallationDirectory()[source]

Return unresolved default installation directory (str) from template.

Overwrite function in sub-class for automatic search of installation directory.

_GetDefaultOptionValue(optionName)[source]
_TestDefaultInstallPath(defaults)[source]

Helper function for automatic search of installation directory.

RunPostConfigurationTasks()[source]

Virtual method. Overwrite to execute post-configuration tasks.

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.

_Ask(question, default, beforeDefault='', afterDefault='', indent=1)
_AskYes_NoPass(question, indent=1)

Ask a yes/NO/pass question.

_Ask_YesNoPass(question, indent=1)

Ask a YES/no/pass question.

_PrintAvailableEditions(editions, selectedEdition)

Print all available editions and return the selected index.

_TryLog(*args, condition=True, **kwargs)
class ToolChain.VendorConfiguration(host: Base.IHost)[source]

Base class for all vendor Configuration classes.

Inheritance

Inheritance diagram of VendorConfiguration

Members

_section = 'INSTALL.Vendor.Tool'

The name of the configuration section. Pattern: INSTALL.Vendor.

_template = {'Windows': {'INSTALL.Vendor.Tool': {'InstallationDirectory': 'C:/Vendor'}}, 'Linux': {'INSTALL.Vendor.Tool': {'InstallationDirectory': '/opt/Vendor'}}, 'Darwin': {'INSTALL.Vendor.Tool': {'InstallationDirectory': '/opt/Vendor'}}}

The template for the configuration section represented as nested dictionaries.

IsConfigured()

Return true if the vendor represented by this Configuration class is configured in PoC.

Inherited method IsConfigured() from class Configuration.

ConfigureForAll()[source]

Start a generic (platform independent) vendor configuration procedure.

This method configures a vendor path. Overwrite this method to implement a vendor specific configuration routine for a vendor Configuration class.

CheckDependency()

Check if all vendor or tool dependencies are fulfilled to configure this tool.

ClearSection(writeWarnings=False)

Clear the configuration section associated to this Configuration class.

ConfigureForDarwin()

Start the configuration procedure for Darwin.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Darwin specific configuration routine.

ConfigureForLinux()

Start the configuration procedure for Linux.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Linux specific configuration routine.

ConfigureForWindows()

Start the configuration procedure for Windows.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Windows specific configuration routine.

GetSections(platform)

Return all section names for this configuration.

Host

Return the hosting object.

IsSupportedPlatform()

Return true if the given platform is supported by this configuration routine.

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.

PrepareOptions(writeWarnings=True)
PrepareSections(warningWasWritten, writeWarnings=True)
RunPostConfigurationTasks()

Virtual method. Overwrite to execute post-configuration tasks.

SectionName

Return the configuration’s section name.

State

Return the configuration state.

_Ask(question, default, beforeDefault='', afterDefault='', indent=1)
_AskInstalled(question)

Ask a Yes/No/Pass question.

_AskYes_NoPass(question, indent=1)

Ask a yes/NO/pass question.

_Ask_YesNoPass(question, indent=1)

Ask a YES/no/pass question.

_ConfigureInstallationDirectory()

Asks for installation directory and updates section. Checks if entered directory exists and returns Path object. If no installation directory was configured before, then _GetDefaultInstallationDir is called.

_GetDefaultInstallationDirectory()

Return unresolved default installation directory (str) from template.

Overwrite function in sub-class for automatic search of installation directory.

_GetDefaultOptionValue(optionName)
_PrintAvailableEditions(editions, selectedEdition)

Print all available editions and return the selected index.

_TestDefaultInstallPath(defaults)

Helper function for automatic search of installation directory.

_TryLog(*args, condition=True, **kwargs)
_multiVersionSupport = False
_vendor = 'Unknown'
class ToolChain.ToolConfiguration(host: Base.IHost)[source]

Base class for all tool Configuration classes.

Inheritance

Inheritance diagram of ToolConfiguration

Members

_section = 'INSTALL.Vendor.Tool'

The name of the configuration section. Pattern: INSTALL.Vendor.ToolName.

_toolName = 'Tool'

The name of the tool.

_template = {'Windows': {'INSTALL.Vendor.Tool': {'BinaryDirectory': '${InstallationDirectory}/bin', 'InstallationDirectory': '${INSTALL.Vendor:InstallationDirectory}/${Version}/Tool/'}}, 'Darwin': {'INSTALL.Vendor.Tool': {'BinaryDirectory': '${InstallationDirectory}/bin', 'InstallationDirectory': '${INSTALL.Vendor:InstallationDirectory}/${Version}/Tool'}}, 'ALL': {'INSTALL.Vendor.Tool': {'Version': '1.0'}}, 'Linux': {'INSTALL.Vendor.Tool': {'BinaryDirectory': '${InstallationDirectory}/bin', 'InstallationDirectory': '${INSTALL.Vendor:InstallationDirectory}/${Version}/Tool'}}}

The template for the configuration section represented as nested dictionaries.

IsConfigured()

Return true if the tool represented by this Configuration class is configured in PoC.

Inherited method IsConfigured() from class Configuration.

_ConfigureVersion()[source]

If no version was configured before, then _GetDefaultVersion is called. Asks for version and updates section. Returns version as string.

_GetDefaultVersion()[source]

Returns unresolved default version (str) from template.

Overwrite this method in a sub-class for automatic search of version.

_ConfigureEdition(editions, defaultEdition)[source]
_GetDefaultEdition()[source]

Returns unresolved default edition (str) from template.

Overwrite this method in a sub-class for automatic search of editions.

_ConfigureBinaryDirectory()[source]

Updates section with value from _template and returns directory as Path object.

PrepareVersionedSections(writeWarnings=False)[source]
CheckDependency()

Check if all vendor or tool dependencies are fulfilled to configure this tool.

ClearSection(writeWarnings=False)

Clear the configuration section associated to this Configuration class.

ConfigureForAll()

Start a generic (platform independent) configuration procedure.

Overwrite this method to implement a generic configuration routine for a (tool) Configuration class.

ConfigureForDarwin()

Start the configuration procedure for Darwin.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Darwin specific configuration routine.

ConfigureForLinux()

Start the configuration procedure for Linux.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Linux specific configuration routine.

ConfigureForWindows()

Start the configuration procedure for Windows.

This method is a wrapper for ConfigureForAll(). Overwrite this method to implement a Windows specific configuration routine.

GetSections(platform)

Return all section names for this configuration.

Host

Return the hosting object.

IsSupportedPlatform()

Return true if the given platform is supported by this configuration routine.

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.

PrepareOptions(writeWarnings=True)
PrepareSections(warningWasWritten, writeWarnings=True)
RunPostConfigurationTasks()

Virtual method. Overwrite to execute post-configuration tasks.

SectionName

Return the configuration’s section name.

State

Return the configuration state.

_Ask(question, default, beforeDefault='', afterDefault='', indent=1)
_AskInstalled(question)

Ask a Yes/No/Pass question.

_AskYes_NoPass(question, indent=1)

Ask a yes/NO/pass question.

_Ask_YesNoPass(question, indent=1)

Ask a YES/no/pass question.

_ConfigureInstallationDirectory()

Asks for installation directory and updates section. Checks if entered directory exists and returns Path object. If no installation directory was configured before, then _GetDefaultInstallationDir is called.

_GetDefaultInstallationDirectory()

Return unresolved default installation directory (str) from template.

Overwrite function in sub-class for automatic search of installation directory.

_GetDefaultOptionValue(optionName)
_PrintAvailableEditions(editions, selectedEdition)

Print all available editions and return the selected index.

_TestDefaultInstallPath(defaults)

Helper function for automatic search of installation directory.

_TryLog(*args, condition=True, **kwargs)
_multiVersionSupport = False
_vendor = 'Unknown'
class ToolChain.EditionDescription(Name, Section)

Inheritance

Inheritance diagram of EditionDescription

Members

Name

Alias for field number 0

Section

Alias for field number 1

_asdict()

Return a new OrderedDict which maps field names to their values.

_fields = ('Name', 'Section')
classmethod _make(iterable, new=<built-in method __new__ of type object>, len=<built-in function len>)

Make a new EditionDescription object from a sequence or iterable

_replace(_self, **kwds)

Return a new EditionDescription object replacing specified fields with new values

_source = "from builtins import property as _property, tuple as _tuple\nfrom operator import itemgetter as _itemgetter\nfrom collections import OrderedDict\n\nclass EditionDescription(tuple):\n 'EditionDescription(Name, Section)'\n\n __slots__ = ()\n\n _fields = ('Name', 'Section')\n\n def __new__(_cls, Name, Section):\n 'Create new instance of EditionDescription(Name, Section)'\n return _tuple.__new__(_cls, (Name, Section))\n\n @classmethod\n def _make(cls, iterable, new=tuple.__new__, len=len):\n 'Make a new EditionDescription object from a sequence or iterable'\n result = new(cls, iterable)\n if len(result) != 2:\n raise TypeError('Expected 2 arguments, got %d' % len(result))\n return result\n\n def _replace(_self, **kwds):\n 'Return a new EditionDescription object replacing specified fields with new values'\n result = _self._make(map(kwds.pop, ('Name', 'Section'), _self))\n if kwds:\n raise ValueError('Got unexpected field names: %r' % list(kwds))\n return result\n\n def __repr__(self):\n 'Return a nicely formatted representation string'\n return self.__class__.__name__ + '(Name=%r, Section=%r)' % self\n\n def _asdict(self):\n 'Return a new OrderedDict which maps field names to their values.'\n return OrderedDict(zip(self._fields, self))\n\n def __getnewargs__(self):\n 'Return self as a plain tuple. Used by copy and pickle.'\n return tuple(self)\n\n Name = _property(_itemgetter(0), doc='Alias for field number 0')\n\n Section = _property(_itemgetter(1), doc='Alias for field number 1')\n\n"
count(value) → integer -- return number of occurrences of value
index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

class ToolChain.Edition(name, section)[source]

An enumeration.

Inheritance

Inheritance diagram of Edition

Members

class ToolChain.ToolSelector(host: Base.IHost)[source]

Base class for all Selector classes.

Inheritance

Inheritance diagram of ToolSelector

Members

_toolName = ''
ToolName
_GetConfiguredEditions(editions)[source]

Return all configured editions.

_AskSelection(editions, defaultEdition)[source]
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.

_Ask(question, default, beforeDefault='', afterDefault='', indent=1)
_AskYes_NoPass(question, indent=1)

Ask a yes/NO/pass question.

_Ask_YesNoPass(question, indent=1)

Ask a YES/no/pass question.

_PrintAvailableEditions(editions, selectedEdition)

Print all available editions and return the selected index.

_TryLog(*args, condition=True, **kwargs)
class ToolChain.Configurator(host: Base.IHost)[source]

A instance of this class controls the interactive configuration process.

Inheritance

Inheritance diagram of Configurator

Members

Configurations = None

List of all available (and thus enabled) Configuration classes.

Selectors = None

List of all available (and thus enabled) Selector classes.

ConfigureAll()[source]

Select all tool chains for configuration

ConfigureTool(toolChain)[source]

Select tool chains for configuration.

InitializeConfiguration()[source]

Initialize PoC’s configuration with empty sections.

The list of sections is gathered from all enabled configurators’ _template fields.

UpdateConfiguration()[source]

Update an existing configuration e.g. after a PoC update.

_ConfigureTools(configurators)[source]

Run the configuration routines for a list of configurators

_ConfigurationLoop(configurator)[source]

Retry to configure a vendor or tool until it succeeds or the user presses P to pass a configuration step.

A :py:exec:`KeyboardInterrupt` should be handled in a calling method.

ConfigureDefaultTools()[source]
_ConfigureDefaultTools()[source]
_WriteConfigurationHeader()[source]

Write a header containing general information about the configuration and list allowed input values for yes/no/pass questions.

_AskConfigureDefaultTools()[source]

Ask if default tools should be configured now.

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

_Ask(question, default, beforeDefault='', afterDefault='', indent=1)
_AskYes_NoPass(question, indent=1)

Ask a yes/NO/pass question.

_Ask_YesNoPass(question, indent=1)

Ask a YES/no/pass question.

_PrintAvailableEditions(editions, selectedEdition)

Print all available editions and return the selected index.

_TryLog(*args, condition=True, **kwargs)