CLI Package¶
TODO.
Authors:
Philipp Schuette
- class pyzeal.cli.controller_facade.CLIControllerFacade(*args, **kwargs)[source]
Interface for a generic controller instance used with the PyZEAL cli.
- __init__(*args, **kwargs)
- handleChangeSubcommand(args)[source]
Check if the ‘change’ subcommand was selected and change settings accordingly.
- Parameters:
args (
SettingsParseResults) – Parsed settings values- Return type:
None
- handlePluginSubcommand(args)[source]
Check if the ‘plugin’ subcommand was selected and manipulate plugins accordingly.
- Parameters:
args (
PluginParseResults) – Parsed plugin request values- Return type:
None
- handleTestingOption(args)[source]
Check if the ‘–test’ option was selected and start testing the local PyZEAL installation accordingly.
- Parameters:
args (
InstallTestingParseResults) – parsed testing option- Returns:
bool– flag indicating if the testing option was given
- handleViewSubcommand(args)[source]
Check if the ‘view’ subcommand was selected and print current settings.
- Parameters:
args (
SettingsParseResults) – Parsed settings values- Return type:
None
Class PyZEALParserInterface from the package pyzeal_cli. This module provides a facade for argparser.ArgumentParser class from the standard library argparse module. Any access to (CLI-)parsers in this project should happen only through this interface.
Authors:
Philipp Schuette
- class pyzeal.cli.parser_facade.PyZEALParserInterface(*args, **kwargs)[source]
Acts as a facade for the standard library ArgumentParser.
- __init__(*args, **kwargs)
- parseArgs()[source]
Read command line arguments, parse the read arguments and return them wrapped according to the pyzeal_cli data contract for parsed command line arguments.
- Returns:
Tuple[SettingsParseResults,PluginParseResults,InstallTestingParseResults] – the wrapped parsing results
This module contains dataclasses for storing results fof command-line parsing.
Authors:
Philipp Schuette
- class pyzeal.cli.parse_results.InstallTestingParseResults(doTest)[source]
Container for parsing results related to testing of the installation.
- __eq__(other)
Return self==value.
- __hash__ = None
- __init__(doTest)
- __repr__()
Return repr(self).
- class pyzeal.cli.parse_results.PluginParseResults(listPlugins, listModules, install, uninstall)[source]
Container for parsing results related to plugins.
- __eq__(other)
Return self==value.
- __hash__ = None
- __init__(listPlugins, listModules, install, uninstall)
- __repr__()
Return repr(self).
- class pyzeal.cli.parse_results.SettingsParseResults(doPrint, container, algorithm, estimator, logLevel, verbose, precision)[source]
Container for parsing results related to settings.
- __eq__(other)
Return self==value.
- __hash__ = None
- __init__(doPrint, container, algorithm, estimator, logLevel, verbose, precision)
- __repr__()
Return repr(self).
Module cli_parser.py from the pyzeal_cli package. This module implements a very PyZEAL specific command line argument parser which gets used by the main entry point __main__.py to parse incoming user arguments.
Authors:
Philipp Schuette
- class pyzeal.cli.cli_parser.PyZEALParser[source]
Specialized argparse.ArgumentParser which parses arguments provided to the PyZEAL CLI by a user.
- __init__()[source]
Initialize a new PyZEALParser parser instance. The parser recognizes basic optional arguments like –help and –version as well as the subcommands change and view related to customization of settings.
- addChangeSubcommand(subParsers)[source]
Add change subcommand and its options to the cli.
- Parameters:
subParsers – The subparser to add Plugin commands to
- addPluginSubcommand(subParsers)[source]
Add plugin subcommand and its options to the cli.
- Parameters:
subParsers – The subparser to add Plugin commands to
- addTestingOption()[source]
Add complete project testing option to the cli.
- Return type:
None
- addVersionOption()[source]
Add version info option to the cli.
- Return type:
None
- addViewSubcommand(subParsers)[source]
Add view subcommand and its options to the cli.
- Parameters:
subParsers – The subparser to add Plugin commands to
- parseArgs()[source]
Read command line arguments, parse the read arguments and return them wrapped according to the pyzeal_cli data contract for parsed command line arguments.
- Returns:
Tuple[SettingsParseResults,PluginParseResults,InstallTestingParseResults] – the wrapped results of the parsing process