planemo.autopygen.commands package — Planemo 0.75.31.dev0 documentation (original) (raw)
Submodules
planemo.autopygen.commands.command_utils module
Module used for creation and manipulation of template elements are parts of template, separated from the rest by comments with specific structure Example of the comments:
## foo definition … block itself … ## end foo definition
Elements can be nested
exception planemo.autopygen.commands.command_utils.DefinitionNotFoundException[source]
Bases: Exception
Exception raised if part of template definition cannot be found
exception planemo.autopygen.commands.command_utils.ParamTypeNotSupported[source]
Bases: Exception
planemo.autopygen.commands.command_utils.create_body_expression(info: ParamInfo, variable: str, depth: int, indentation: int = 4) → str[source]
planemo.autopygen.commands.command_utils.create_element_with_body(kind: str, head: str, body: List[str], comment: str, depth: int, indent: int = 4, body_indented: bool = True, add_comment: bool = False) → str[source]
Function used to create block of template, like if or loop
Parameters
kindstr
string defining what kind of element is created, for example if or for (loop)
headstr
body of block header, for example predicate of condition, or the body of loop
bodystr
body of the block, can be another element
commentstr
comment, used to set the start and end of the block
depthint
integer, used to set the depth of the current element. This value is used to indent the block properly
indentint
default value for size of the block indent
body_indentedbool
option that define whether body is already correctly indented
add_commentbool
option that enables or disables formatting comments
Returns
string containing the created template element
planemo.autopygen.commands.command_utils.create_flag(variable: str, comment: str, depth: int, indent=4, add_comment: bool = False) → str[source]
Function used to create a flag definition, wrapped in a comment
Parameters
variablestr
name of variable, containing $ at the beginning
commentstr
wrapping comment
depthint
integer, used to set the depth of the current element. This value is used to indent the block properly
indentint
default value for size of the block indent
add_commentbool
option that enables or disables formatting comments
planemo.autopygen.commands.command_utils.transform_param_info(info: ParamInfo, namespace: str, depth: int)[source]