ppanggolin.utility package
Submodules
ppanggolin.utility.utils module
- ppanggolin.utility.utils.deduplicate_actions(actions: List[_SubParsersAction]) List[_SubParsersAction]
Deduplicate duplicate actions based on their dest.
When two actions with the same dest attribute, only the first one is kept in the returned list.
- Parameters:
actions – list of parser action arguments.
- Returns:
list of parser action arguments deduplicated.
- ppanggolin.utility.utils.get_default_argument_lines(argument_actions: List[_SubParsersAction]) List[str]
Get default arguments for a specific list of parser actions and format them for the yaml output.
Help and possible values of the argument is added as comment line.
- Parameters:
argument_actions – list of parser action arguments.
- Returns:
default arguments for the given command
- ppanggolin.utility.utils.get_input_argument_lines(argument_actions: List[_SubParsersAction]) List[str]
Manage input argument from a specific list of parser actions and format them for the yaml output.
Input arguments are commented in the config file: as no default is valid. Help and possible values of the argument is added as comment line.
- Parameters:
argument_actions – list of parser action for input arguments.
- Returns:
default arguments for the given command
- ppanggolin.utility.utils.launch(args: Namespace)
Command launcher
- Parameters:
args – All arguments provide by user
- ppanggolin.utility.utils.launch_default_config(args: Namespace)
Command launcher
- Parameters:
args – All arguments provide by user
- ppanggolin.utility.utils.parser_default_config(parser: ArgumentParser)
Parser for specific argument of utils command
- Parameters:
parser – parser for utils argument
- ppanggolin.utility.utils.split(list_object: list, chunk_count: int) List[List[int]]
Split list into n chunk.
- Params list_object:
list to split
- Params chunk_count:
number of final chunk
:return : list of chunk of the initial list.
- ppanggolin.utility.utils.split_comment_string(comment_string: str, max_word_count: int = 20, prefix: str = '\n # ') str
Split a line of comment into multiple line.
- Params comment_string:
comment string to split
- Params max_word_count:
maximum number of word per line
- Params prefix:
prefix used to start a new comment line
:return : the split comment line.
- ppanggolin.utility.utils.subparser(sub_parser: _SubParsersAction) ArgumentParser
Subparser to launch PPanGGOLiN in Command line
:param sub_parser : sub_parser for info command
:return : parser arguments for info command