The CroCoWX Class

class croco_wx.CroCoMainFrame[source]

Bases: wx._core.Frame

The wx window class for the croco cross-link converter GUI

availReads

dict – Dictionary with writing operation to list: [function to call (func), options for displaying a related widget (list)]. Structure of options list: (Label for the widget (str)), type of the widget (can be ‘file’/’dir’/’input’/’check’), Help text (str), Optional multi-purpose field: e.g. default value for input fields)

availWrites

dict – Dictionary with writing operation to list. For structure see availReads.

currentPath

str – set starting path for folder selection GUI

col_order

list of str – defines the column headers required for xtable output

inputOptionsToUserInput

dict – mapping the label names to the user-provided input

outputOptionsToUserInput

dict – mapping the label names to the user-provided input

create_widgets()[source]

Create the widgets for the croco MainFrame

compactTableCheck

wx.CheckBox – whether to compact the table before passing to output function

mergeTableCheck

wx.CheckBox – Whether to merge multiple files (pass paths in loop)

sameSettingsCheck

wx.CheckBox – whether to apply the same settings to all files or call separately

writeFormat

str – the format to write data to (from availWrites)

readFormat

str – the format to read data from (from availReads)

display_info(message, caption='CroCo')[source]

Generate a message dialog

Parameters:
  • message (str) – Message to send
  • caption (str) – Title for the wx-window
display_warning(message, caption='Warning!')[source]

Issue a warning on the console and as a wx window

Parameters:
  • message (str) – Message to send
  • caption (str) – Title for the wx-window
make_menu_bar()[source]

Create the top menu for the CroCo MainFrame

on_about(event)[source]

Show the about dialog

on_exit(event)[source]

Close the frame, terminating the application.

on_input_dir()[source]

Open a dir dialog and set the paths

on_input_file()[source]

Open a file dialog and set the paths

theInput

list of str – selected input paths

on_open_switch(event)[source]

Open a dir-opening dialog if pLink was selected, else file-opening

Parameters:event (wx.Event) –
on_output_dir(event)[source]

Open a dialog to select an output dir

theOutput

str – Path to write output

on_read_format(event)[source]

function to enable the file input button only after an input format was chosen

Parameters:event (wx.Event) –
on_run(event)[source]

Collect all necessary information from self and start the conversion by calling the actual conversion script

Parameters:event (wx.Event) –
on_start(event)[source]

Show dialog if additional user input is required. Otherwise start the conversion

on_write_format(event)[source]

function to enable the file output button only after an input format was chosen

Parameters:event (wx.Event) –
readSet = None

bool – True if the read format is set

writeSet = None

bool – True if the write format is set

class croco_wx.CroCoOptionsFrame(parent)[source]

Bases: wx._core.Frame

Child Frame to CroCoMainWindow asking the user for input regarding the possible options of a submodule

parent

wx.Frame – parent frame

currentPath

str – current working directory

InputOptionsToAsk

list – Input options from CroCoMainWindow

InputOptionsToAsk

list – Output options from CroCoMainWindow

display_info(message, caption='CroCo')[source]

Info dialog method of CroCoOptionsWindow

on_okay(event)[source]

If the user clicks okay, all inputs will be evaluated, returned to the parent classe and the on_run method of the parent class will be called

on_open_dir(event, dictToAppend, label)[source]

Dir opening method of CroCoOptionsWindow

on_open_file(event, dictToAppend, label)[source]

File opening method of CroCoOptionsWindow

update_options()[source]

Collect the variables that determine the layout of the options window and compute the window layout

textCtrls

dict – mapping text labels to input text fields. all inputs done by extra dialog widgets (file and paths) are stored upon closing the dialogs. Text and checkbox inputs have to be evaaluated when the okay-Button has been pressed