Package gui :: Module misc
[hide private]
[frames] | no frames]

Module misc

source code

Miscellaneous functions used throughout the GUI.

Functions [hide private]
wx.BoxSizer instance
add_border(box, border=0, packing=8, debug=False)
Create the main part of the frame, returning the central sizer.
source code
unicode
bool_to_gui(bool)
Convert the bool into the GUI string.
source code
float
convert_to_float(string)
Method to convert a string like '1.02*1e-10' to a float variable.
source code
unicode
float_to_gui(num)
Convert the float into the GUI string.
source code
bool
gui_to_bool(string)
Convert the GUI obtained string to a bool.
source code
float or None
gui_to_float(string)
Convert the GUI obtained string to an float.
source code
int or None
gui_to_int(string)
Convert the GUI obtained string to an int.
source code
int or int list
gui_to_int_or_list(string)
Convert the GUI obtained string to a list.
source code
list
gui_to_list(string)
Convert the GUI obtained string to a list.
source code
str
gui_to_str(string)
Convert the GUI obtained string to a string.
source code
int or int list
gui_to_str_or_list(string)
Convert the GUI obtained string to a list.
source code
unicode
int_to_gui(num)
Convert the int into the GUI string.
source code
unicode
list_to_gui(list)
Convert the list into the GUI string.
source code
 
open_file(file, force_text=False)
Open the file in the platform's native editor/viewer.
source code
bool
protected_exec(fn, *args, **kargs)
Apply the given function, catching all RelaxErrors.
source code
unicode
str_to_gui(string)
Convert the string into the GUI string.
source code
Variables [hide private]
  status = Status()
  __package__ = 'gui'

Imports: pow, os, platform, split, wx, AllRelaxErrors, Status, gui_raise


Function Details [hide private]

add_border(box, border=0, packing=8, debug=False)

source code 

Create the main part of the frame, returning the central sizer.

Parameters:
  • box (wx.BoxSizer instance) - The box sizer element to pack the borders into.
  • border (int) - The size of the border in pixels.
  • packing (wx.VERTICAL or wx.HORIZONTAL) - Specify if the central sizer should be vertically or horizontally packed.
  • debug (bool) - A flag which if true will make colourful borders.
Returns: wx.BoxSizer instance
The central sizer.

bool_to_gui(bool)

source code 

Convert the bool into the GUI string.

Parameters:
  • bool (bool) - The boolean value of True or False.
Returns: unicode
The GUI string.

convert_to_float(string)

source code 

Method to convert a string like '1.02*1e-10' to a float variable.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: float
The floating point number.

float_to_gui(num)

source code 

Convert the float into the GUI string.

Parameters:
  • num (float or None) - The number in float or None form.
Returns: unicode
The GUI string.

gui_to_bool(string)

source code 

Convert the GUI obtained string to a bool.

Parameters:
  • string (str or unicode) - The bool in string form.
Returns: bool
The bool.

gui_to_float(string)

source code 

Convert the GUI obtained string to an float.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: float or None
The float

gui_to_int(string)

source code 

Convert the GUI obtained string to an int.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: int or None
The integer

gui_to_int_or_list(string)

source code 

Convert the GUI obtained string to a list.

Parameters:
  • string (str or unicode) - The list in string form.
Returns: int or int list
The integer or list of integers.

gui_to_list(string)

source code 

Convert the GUI obtained string to a list.

Parameters:
  • string (str or unicode) - The list in string form.
Returns: list
The list.

gui_to_str(string)

source code 

Convert the GUI obtained string to a string.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: str
The string.

gui_to_str_or_list(string)

source code 

Convert the GUI obtained string to a list.

Parameters:
  • string (str or unicode) - The list in string form.
Returns: int or int list
The integer or list of integers.

int_to_gui(num)

source code 

Convert the int into the GUI string.

Parameters:
  • num (int or None) - The number in int or None form.
Returns: unicode
The GUI string.

list_to_gui(list)

source code 

Convert the list into the GUI string.

Parameters:
  • list (list or None) - The Python list.
Returns: unicode
The GUI string.

open_file(file, force_text=False)

source code 

Open the file in the platform's native editor/viewer.

Parameters:
  • file (str) - The path of the file to open.
  • force_text (bool) - A flag which if True will cause a text editor to be launched.

protected_exec(fn, *args, **kargs)

source code 

Apply the given function, catching all RelaxErrors.

All args and keyword args supplied will be directly applied to the given function.

Parameters:
  • fn (func) - The function to apply.
Returns: bool
The status of execution.

str_to_gui(string)

source code 

Convert the string into the GUI string.

Parameters:
  • string (str or None) - The string or None to convert.
Returns: unicode
The GUI string.