Module misc
source code
Miscellaneous functions used throughout the GUI.
wx.BoxSizer instance
|
add_border(box,
border=0,
packing=wx.VERTICAL,
debug=False)
Create the main part of the frame, returning the central sizer. |
source code
|
|
str
|
|
|
|
bool
|
|
str
|
|
Imports:
deepcopy,
os,
platform,
wrap,
wx,
AllRelaxErrors,
Status,
gui_raise
add_border(box,
border=0,
packing=wx.VERTICAL,
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.
|
Format the text by stripping whitespace.
- Parameters:
table (lists of lists of str) - The table.
- Returns: str
- The formatted table.
|
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.
|
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.
|
table_line(text=None,
widths=None,
bottom=False)
| source code
|
Format a line of a table.
- Parameters:
text (list of str or None) - The list of table elements. If not given, an empty line will be
be produced.
widths (list of int) - The list of column widths for the table.
botton - A flag which if True will cause a table bottom line to be
produced.
bottom (bool)
- Returns: str
- The table line.
|