ToolChain¶
Submodules
Exceptions
ToolChainException
: Base class for all tool specific exceptionsConfigurationException
:ConfigurationException
is raise while running configuration or databaseSkipConfigurationException
:SkipConfigurationException
is aConfigurationException
,
Classes
ConfigurationState
: Describes the configuration state of a tool or vendor.ChangeState
: Describes if a configuration was changed.ToolMixIn
: Undocumented.AskMixIn
: Undocumented.Configuration
: Base class for all Configuration classes.VendorConfiguration
: Base class for all vendor Configuration classes.ToolConfiguration
: Base class for all tool Configuration classes.EditionDescription
: EditionDescription(Name, Section)Edition
: An enumeration.ToolSelector
: Base class for all Selector classes.Configurator
: A instance of this class controls the interactive configuration process.
-
exception
ToolChain.
ToolChainException
(message='')[source]¶ Base class for all tool specific exceptions
Inheritance
Members
-
__str__
()¶ Returns the exception’s message text.
-
args
¶
-
-
exception
ToolChain.
ConfigurationException
(message='')[source]¶ ConfigurationException
is raise while running configuration or database tasks in PoCInheritance
Members
-
__str__
()¶ Returns the exception’s message text.
-
args
¶
-
-
exception
ToolChain.
SkipConfigurationException
(message='')[source]¶ SkipConfigurationException
is aConfigurationException
, which can be skipped.Inheritance
Members
-
__str__
()¶ Returns the exception’s message text.
-
args
¶
-
-
class
ToolChain.
ConfigurationState
[source]¶ Describes the configuration state of a tool or vendor.
Inheritance
Members
-
Unconfigured
= 0¶
-
Configured
= 1¶
-
-
class
ToolChain.
ChangeState
[source]¶ Describes if a configuration was changed.
Inheritance
Members
-
Unchanged
= 0¶
-
Changed
= 1¶
-
-
class
ToolChain.
ToolMixIn
(platform, dryrun, binaryDirectoryPath, version, logger=None)[source]¶ Inheritance
Members
-
class
ToolChain.
Configuration
(host: Base.IHost)[source]¶ Base class for all Configuration classes.
Inheritance
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.
-
CheckDependency
()[source]¶ Check if all vendor or tool dependencies are fulfilled to configure this tool.
-
ClearSection
(writeWarnings=False)[source]¶ Clear the configuration section associated to this Configuration class.
-
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.
-
_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.
-
_TestDefaultInstallPath
(defaults)[source]¶ Helper function for automatic search of installation directory.
-
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
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 classConfiguration
.
-
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
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 classConfiguration
.
-
_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.
-
_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 asPath
object.
-
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
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.
ToolSelector
(host: Base.IHost)[source]¶ Base class for all Selector classes.
Inheritance
Members
-
_toolName
= ''¶
-
ToolName
¶
-
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
Members
-
Configurations
= None¶ List of all available (and thus enabled) Configuration classes.
-
Selectors
= None¶ List of all available (and thus enabled) Selector classes.
-
InitializeConfiguration
()[source]¶ Initialize PoC’s configuration with empty sections.
The list of sections is gathered from all enabled configurators’
_template
fields.
-
_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.
-
_WriteConfigurationHeader
()[source]¶ Write a header containing general information about the configuration and list allowed input values for yes/no/pass questions.
-
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)¶
-