custom_step package#

Submodules#

custom_step.colourchooser module#

class custom_step.colourchooser.ColourChooser(master, **kwargs)[source]#

Bases: Toplevel

save()[source]#
set_colour(sv)[source]#

custom_step.custom module#

Non-graphical part of the Custom step in a SEAMM flowchart

class custom_step.custom.Custom(flowchart=None, title='Custom Python', extension=None, logger=<Logger custom_step.custom (WARNING)>)[source]#

Bases: Node

description_text(P=None)[source]#

Create the text description of what this step will do. The dictionary of control values is passed in as P so that the code can test values, etc.

Parameters:

P (dict) – An optional dictionary of the current values of the control parameters.

Returns:

A description of the current step.

Return type:

str

property git_revision#

The git version of this module.

run()[source]#

Run a Custom step.

property version#

The semantic version of this module.

class custom_step.custom.cd(newPath)[source]#

Bases: object

Context manager for changing the current working directory

custom_step.custom_parameters module#

Control parameters for the Custom step in a SEAMM flowchart

class custom_step.custom_parameters.CustomParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for a Custom step.

The developer will add a dictionary of Parameters to this class. The keys are parameters for the current plugin, which themselves might be dictionaries.

You need to replace the ‘time’ example below with one or more definitions of the control parameters for your plugin and application.

parameters{<see items below>}

A dictionary containing the parameters for the current step. Each key of the dictionary is a dictionary that contains the the following keys: kind, default, default_units, enumeration, format_string, description and help text.

‘kind’custom

Specifies the kind of a variable. While the ‘kind’ of a variable might be a numeric value, it may still have enumerated custom values meaningful to the user. For instance, if the parameter is a convergence criterion for an optimizer, custom values like ‘normal’, ‘precise’, etc, might be adequate. In addition, any parameter can be set to a variable of expression, indicated by having ‘$’ as the first character in the field. For example, $OPTIMIZER_CONV.

‘default’‘integer’ or ‘float’ or ‘string’ or ‘boolean’ or ‘enum’

The default value of the parameter, used to reset it.

‘default_units’str

The default units, used for resetting the value.

‘enumeration’tuple

A tuple of enumerated values.

‘format_string’str

A format string for ‘pretty’ output.

‘description’str

A short string used as a prompt in the GUI.

‘help_text’tuple

A longer string to display as help for the user.

See also

Custom, TkCustom, CustomParameters, CustomStep

Examples

parameters = {
    "time": {
        "default": 100.0,
        "kind": "float",
        "default_units": "ps",
        "enumeration": tuple(),
        "format_string": ".1f",
        "description": "Simulation time:",
        "help_text": ("The time to simulate in the dynamics run.")
    },
}
parameters = {'script': {'default': '', 'default_units': None, 'description': 'Script:', 'enumeration': (), 'format_string': '', 'help_text': 'The Python script', 'kind': 'string'}}#

custom_step.custom_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.

class custom_step.custom_step.CustomStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'An interface for Custom Python steps', 'group': 'Custom', 'name': 'Python'}#

custom_step.findwindow module#

class custom_step.findwindow.FindWindow(master, **kwargs)[source]#

Bases: Toplevel

on_cancel()[source]#
on_find()[source]#
on_replace()[source]#

custom_step.fontchooser module#

class custom_step.fontchooser.FontChooser(master, **kwargs)[source]#

Bases: Toplevel

save()[source]#

custom_step.highlighter module#

class custom_step.highlighter.Highlighter(text_widget, syntax_file)[source]#

Bases: object

clear_highlight()[source]#
configure_tags()[source]#
force_highlight()[source]#
highlight(event=None)[source]#
highlight_regex(regex, tag)[source]#
on_key_release(event=None)[source]#
parse_syntax_file()[source]#

custom_step.linenumbers module#

class custom_step.linenumbers.LineNumbers(master, text_widget, **kwargs)[source]#

Bases: Text

force_update()[source]#
on_key_press(event=None)[source]#

custom_step.textarea module#

class custom_step.textarea.TextArea(master, **kwargs)[source]#

Bases: Text

bind_events()[source]#
cancel_find()[source]#
copy(event=None)[source]#
cut(event=None)[source]#
display_file_contents(filepath)[source]#
find(text_to_find)[source]#
paste(event=None)[source]#
redo(event=None)[source]#
replace_text(target, replacement)[source]#
select_all(event=None)[source]#
undo(event=None)[source]#

custom_step.texteditor module#

custom_step.tk_custom module#

The graphical part of a Custom step

class custom_step.tk_custom.TkCustom(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50)[source]#

Bases: TkNode

The graphical part of a Custom step in a flowchart.

tk_flowchart#

The flowchart that we belong to.

Type:

TkFlowchart = None

node#

The corresponding node of the non-graphical flowchart

Type:

Node = None

namespace#

The namespace of the current step.

Type:

str

sub_tk_flowchart#

A graphical Flowchart representing a subflowchart

Type:

TkFlowchart

canvas#

The Tk Canvas to draw on

Type:

tkCanvas = None

dialog#

The Pmw dialog object

Type:

Dialog

x#

The x-coordinate of the center of the picture of the node

Type:

int = None

y#

The y-coordinate of the center of the picture of the node

Type:

int = None

w#

The width in pixels of the picture of the node

Type:

int = 200

h#

The height in pixels of the picture of the node

Type:

int = 50

self[widget]#

A dictionary of tk widgets built using the information contained in Set Cell_parameters.py

Type:

dict

See also

Custom, TkCustom, CustomParameters

create_dialog()[source]#

Create the dialog!

handle_dialog(result)[source]#

Do the right thing when the dialog is closed.

right_click(event)[source]#

Probably need to add our dialog…

Module contents#

custom_step A step in a SEAMM flowchart for custom Python