aquaduct.apps.valveconfig.utils module

get_widget_bg(widget)[source]

Return background color of specified widget.

Parameters

widget – Ttk widget.

Returns

Background color.

Return type

str

widget_factory(parent, default, state='normal')[source]

Creates widget depending on default argument.

Parameters
  • parent – Parent of new widget.

  • default – Default widget value.

  • state – State of widget.

Returns

Widget and variable attached to it.

Return type

tuple

entry_factory(parent, row, entry_name, default, help, state='normal', info_text=None, warning_text=None)[source]

Determines which class is used to handle specified default value.

Parameters
  • parent – Parent of widget.

  • row – Row number where first Entry will be grided.

  • entry_name – Readable entry name.

  • default – Default values of entry.

  • help – Text which will be displayed in tooltip.

  • state – State of widget.

Returns

Entry based on default value.

class Text(parent, textvariable, **kwargs)[source]

Bases: tkinter.Text, object

class Entry(parent, row)[source]

Bases: object

Abstract class for various Entries that manage different type of default values.

Represents single row of configuration option with Label and all input widgets.

get()[source]

Gets Entry value.

Returns

Entry value.

set(value)[source]

Sets Entry value.

Parameters

value – New value of Entry.

highlight()[source]

Changes color of input frame.

Used to highlight, which required entry is unfilled.

unhighlight()[source]

Sets entry to default color.

class StandardEntry(parent, row, entry_name_long, default, help, state, info_text=None, warning_text=None)[source]

Bases: aquaduct.apps.valveconfig.utils.Entry

get()[source]

Gets Entry value.

Returns

Entry value.

set(value)[source]

Sets Entry value.

Parameters

value – New value of Entry.

class BoolEntry(parent, row, entry_name_long, input_default, control_default, help, info_text=None, warning_text=None)[source]

Bases: aquaduct.apps.valveconfig.utils.Entry

get()[source]

Get Entry value.

Returns

If Checkbox is checked it return input widget value, otherwise False.

set(value)[source]

Set Entry value.

Parameters

value – Value that input widget will be set too.

System Message: WARNING/2 (/home/kara/Desktop/AQ/aqua-duct/src/aquaduct/apps/valveconfig/utils.py:docstring of aquaduct.apps.valveconfig.utils.BoolEntry.set, line 4)

Field list ends without a blank line; unexpected unindent.

If False it will set only Checkbox value to False and input widget to “”. If value have str type it will set Checkbox to True and input widget to that value.

class FileEntry(parent, row, entry_name_long, default, help, info_text=None, warning_text=None)[source]

Bases: aquaduct.apps.valveconfig.utils.Entry

callback_load_file(e)[source]

Callback for selecting file.

Sets widget content to loaded file name.

get()[source]

Gets Entry value.

Returns

Entry value.

set(value)[source]

Sets Entry value.

Parameters

value – New value of Entry.

class ManyFileEntry(parent, row, entry_name_long, default, help, info_text=None, warning_text=None)[source]

Bases: aquaduct.apps.valveconfig.utils.Entry

append_entry()[source]

Creates new entry with input widget and load button

callback_load_file(index)[source]

Callback for selecting file.

Appends loaded file name at the end of Text widget.

Parameters

index – Index of variable in self.input_vars

get()[source]

Gets Entry value.

Returns

Entry value.

set(value)[source]

Sets Entry value.

If value is set to “” it deletes all input widgets, except first and sets it to “”

Parameters

value – New value. It can be single path or paths separated by os.pathsep.

highlight()[source]

Changes color of input frame.

Used to highlight, which required entry is unfilled.

unhighlight()[source]

Sets entry to default color.

class DirEntry(parent, row, entry_name_long, default, help, info_text=None, warning_text=None)[source]

Bases: aquaduct.apps.valveconfig.utils.Entry

callback_load_dir(e)[source]

Callback for selecting dir.

Sets widget content to loaded dir name.

get()[source]

Gets Entry value.

Returns

Entry value.

set(value)[source]

Sets Entry value.

Parameters

value – New value of Entry.

class ParenthesedEntry(parent, row, entry_name_long, input_default, control_default, help, info_text=None, warning_text=None)[source]

Bases: aquaduct.apps.valveconfig.utils.Entry

get()[source]

Gets Entry value.

Returns

Value of Entry widget and value of second Entry in parentheses, eg. Value1(Value2).

set(value)[source]

Sets Entry value.

Parameters

value – First value and second value in parentheses or without second value and parentheses.

class WarningIconWidget(parent, text)[source]

Bases: tkinter.ttk.Label, object

class InfoIconWidget(parent, text)[source]

Bases: tkinter.ttk.Label, object

class HidingFrame(parent, row, text, **kwargs)[source]

Bases: tkinter.ttk.Frame, object

show()[source]

Method to grid Frame with predefinied configuration.

class ToolTip(widget)[source]

Bases: object

Code found: http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_01.shtml

class VerticalScrolledFrame(parent, *args, **kw)[source]

Bases: tkinter.Frame

A pure Tkinter scrollable frame that actually works! * Use the ‘interior’ attribute to place widgets inside the scrollable frame * Construct and pack/place/grid normally * This frame only allows vertical scrolling