loop_step package#
Submodules#
loop_step.loop module#
Non-graphical part of the Loop step in a SEAMM flowchart
- exception loop_step.loop.BreakLoop(message='break from the loop')[source]#
Bases:
Exception
Indicates that SEAMM should break from the loop
- exception loop_step.loop.ContinueLoop(message='continue with next iteration of loop')[source]#
Bases:
Exception
Indicates that SEAMM should continue from the loop
- class loop_step.loop.Loop(flowchart=None, extension=None)[source]#
Bases:
Node
- default_edge_subtype()[source]#
Return the default subtype of the edge. Usually this is ‘next’ but for nodes with two or more edges leaving them, such as a loop, this method will return an appropriate default for the current edge. For example, by default the first edge emanating from a loop-node is the ‘loop’ edge; the second, the ‘exit’ edge.
A return value of ‘too many’ indicates that the node exceeds the number of allowed exit edges.
- description_text(P=None)[source]#
Return a short description of this step.
Return a nicely formatted string describing what this step will do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- property git_revision#
The git version of this module.
- property iter_format#
- property version#
The semantic version of this module.
- property working_path#
loop_step.loop_parameters module#
Control parameters for loops
- class loop_step.loop_parameters.LoopParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for loops
- parameters = {'configuration name': {'default': '', 'default_units': '', 'description': '', 'enumeration': (), 'format_string': 's', 'help_text': 'The filter for the configuration name', 'kind': 'string'}, 'default configuration': {'default': 'last', 'default_units': '', 'description': 'Select configuration:', 'enumeration': ('all', 'last', 'first', 'name is', 'name matches', 'name regexp'), 'format_string': 's', 'help_text': 'The configuration to select as the default.', 'kind': 'string'}, 'directory name': {'default': 'loop iteration', 'default_units': '', 'description': 'Directory names:', 'enumeration': ('loop iteration', 'system name', 'configuration name'), 'format_string': 's', 'help_text': 'The directory name for the loop iteration.', 'kind': 'string'}, 'end': {'default': '10', 'default_units': '', 'description': 'to', 'enumeration': (), 'format_string': '', 'help_text': 'The ending value of the loop.', 'kind': 'float'}, 'errors': {'default': 'continue to next iteration', 'default_units': '', 'description': 'On errors', 'enumeration': ('continue to next iteration', 'exit the loop', 'stop the job'), 'format_string': 's', 'help_text': 'How to handle errors', 'kind': 'string'}, 'query-column': {'default': '', 'default_units': '', 'description': '', 'enumeration': (), 'format_string': 's', 'help_text': 'The column to test', 'kind': 'string'}, 'query-op': {'default': '==', 'default_units': '', 'description': '', 'enumeration': ('==', '!=', '>', '>=', '<', '<=', 'contains', 'does not contain', 'contains regexp', 'does not contain regexp', 'is empty', 'is not empty'), 'format_string': 's', 'help_text': 'The column to test', 'kind': 'string'}, 'query-value': {'default': '', 'default_units': '', 'description': '', 'enumeration': (), 'format_string': 's', 'help_text': 'Value to use in the test', 'kind': 'string'}, 'start': {'default': '1', 'default_units': '', 'description': 'from', 'enumeration': (), 'format_string': '', 'help_text': 'The starting value of the loop.', 'kind': 'float'}, 'step': {'default': '1', 'default_units': '', 'description': 'by', 'enumeration': (), 'format_string': '', 'help_text': 'The step or increment of the loop value.', 'kind': 'float'}, 'system name': {'default': '', 'default_units': '', 'description': '', 'enumeration': (), 'format_string': 's', 'help_text': 'The filter for the system name', 'kind': 'string'}, 'table': {'default': 'table1', 'default_units': '', 'description': '', 'enumeration': (), 'format_string': 's', 'help_text': 'The table to iterate over.', 'kind': 'string'}, 'type': {'default': 'For', 'default_units': '', 'description': '', 'enumeration': ('For', 'Foreach', 'For rows in table', 'For systems in the database'), 'format_string': 's', 'help_text': 'The type of loop used.', 'kind': 'enumeration'}, 'values': {'default': '', 'default_units': '', 'description': 'value in', 'enumeration': (), 'format_string': 's', 'help_text': 'The list of values for the loop.', 'kind': 'string'}, 'variable': {'default': 'i', 'default_units': '', 'description': 'loop variable', 'enumeration': (), 'format_string': '', 'help_text': 'The name of the loop variable.', 'kind': 'string'}, 'where': {'default': 'Use all rows', 'default_units': '', 'description': '', 'enumeration': ('Use all rows', 'Select rows where column'), 'format_string': 's', 'help_text': 'The filter for rows, defaults to all rows.', 'kind': 'string'}, 'where system name': {'default': 'is anything', 'default_units': '', 'description': 'where name:', 'enumeration': ('is anything', 'is', 'matches', 'regexp'), 'format_string': 's', 'help_text': 'The filter for the system name, defaults to all systems.', 'kind': 'string'}}#
loop_step.loop_step module#
Helper class needed for the stevedore integration. Needs to provide a description() method that returns a dict containing a description of this node, and a factory() method for creating the graphical and non-graphical nodes.
loop_step.tk_loop module#
The graphical part of a Loop step
- class loop_step.tk_loop.TkLoop(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50, my_logger=<Logger loop_step.tk_loop (WARNING)>)[source]#
Bases:
TkNode
The node_class is the class of the ‘real’ node that this class is the Tk graphics partner for
- criteria_callback(widget, criterion, event, what)[source]#
Handle changes in the search criteria widget.
- Parameters:
widget (Tk widget) – The widget.
criterion (sw.Criterion) – The row – Criterion widget – in the table.
event (tk.Event) – The event causing the callback.
what (str) – The item that changed: ‘inclusion’, ‘field’, ‘operator’, ‘self.two_values’, ‘clear’, ‘set’, ‘add row’, ‘remove row’
- default_edge_subtype()[source]#
Return the default subtype of the edge. Usually this is ‘next’ but for nodes with two or more edges leaving them, such as a loop, this method will return an appropriate default for the current edge. For example, by default the first edge emanating from a loop-node is the ‘loop’ edge; the second, the ‘exit’ edge.
A return value of ‘too many’ indicates that the node exceeds the number of allowed exit edges.
Module contents#
loop_step A step for loops in the SEAMM flowcharts