Base abstract invocable
base_abstract_invocable ¶
The Base abstract Invocable that all other invocables should inherit from.
BaseAbstractInvocable ¶
The Abstract Invocable.
The base abstract invocable that other invocables should inherit from. Provides base functionality to configure logging and the environment.
Attributes:
Name | Type | Description |
---|---|---|
log_filename |
str
|
logfile path |
log_perf_measurements |
bool
|
whether to measure and log invocable command performance or not |
plugin_manager |
PluginManager
|
the plugin manager |
helper |
HelperFunctions
|
container for all helper functions |
ParseCommandLineOptions ¶
ParseCommandLineOptions() -> None
Parse command line arguments.
Tip
Required Override in a subclass
GetWorkspaceRoot ¶
GetWorkspaceRoot() -> str
Return the workspace root for initializing the Self Describing Environment.
Tip
Required Override in a subclass
Returns:
Type | Description |
---|---|
str
|
absolute path to workspace root |
GetActiveScopes ¶
GetActiveScopes() -> tuple
Return tuple containing scopes that should be active for this process.
Tip
Required Override in a subclass
Warning
A single scope should end in a comma i.e. (scope,)
Returns:
Type | Description |
---|---|
Tuple
|
scopes |
GetSkippedDirectories ¶
GetSkippedDirectories() -> tuple
Return tuple containing workspace-relative directory paths that should be skipped for processing.
Tip
Optional Override in a subclass
Warning
A single directory should end with a comma i.e. (dir,)
Returns:
Type | Description |
---|---|
Tuple
|
directories |
GetLoggingLevel ¶
GetLoggingLevel(loggerType: str) -> Optional[int]
Get the logging level depending on logger type.
Tip
Required Override in a subclass
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loggerType |
str
|
type of logger being logged to |
required |
Returns:
Type | Description |
---|---|
int
|
The logging level |
None
|
No logging of this type |
loggerType possible values
"base": lowest logging level supported
"con": logs to screen
"txt": logs to plain text file
GetLoggingFolderRelativeToRoot ¶
GetLoggingFolderRelativeToRoot() -> str
Return the path to a directory to hold all log files.
Hint
Required Override in a subclass
Returns:
Type | Description |
---|---|
str
|
path to the directory |
InputParametersConfiguredCallback ¶
InputParametersConfiguredCallback() -> int
A Callback once all input parameters are collected.
Hint
Optional override in subclass
GetVerifyCheckRequired ¶
GetVerifyCheckRequired() -> bool
Will call self_describing_environment.VerifyEnvironment if this returns True.
Hint
Optional override in a subclass
Returns:
Type | Description |
---|---|
bool
|
whether verify check is required or not |
GetLoggingFileName ¶
GetLoggingFileName(loggerType: str) -> Optional[str]
Get the logging File name to provide file name customization.
Hint
Required Override this in a subclass
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loggerType |
str
|
values can be base, con, txt, md. See hint below |
required |
Returns:
Type | Description |
---|---|
str
|
filename |
None
|
No logging file should be created |
loggerType possible values
"base": lowest logging level supported
"con": logs to screen
"txt": logs to plain text file
Go ¶
Go() -> None
Main function to run.
Main function to run after the environment and logging has been configured.
Tip
Required Override in a subclass
ConfigureLogging ¶
ConfigureLogging() -> None
Sets up the logging.
Tip
Optional override in a subclass if new behavior is needed
Invoke ¶
Invoke() -> None
Main process function to configure logging and the environment.
Danger
Do not override this method