Package Gnumed :: Package timelinelib :: Package wxgui :: Module utils
[frames] | no frames]

Module utils

source code

Classes
  WildcardHelper
Functions
 
category_tree(category_list, parent=None, remove=None)
Transform flat list of categories to a tree based on parent attribute.
source code
 
show_modal(fn_create_dialog, fn_handle_db_error, fn_success=None)
Show a modal dialog using error handling pattern.
source code
 
create_dialog_db_error_handler(dialog) source code
 
handle_db_error_in_dialog(dialog, error) source code
 
set_wait_cursor(parent) source code
 
set_default_cursor(parent) source code
 
time_picker_for(time_type) source code
Variables
  BORDER = 5
  ID_ERROR = wx.NewId()

Imports: wx, TimelineIOError, sort_categories


Function Details

category_tree(category_list, parent=None, remove=None)

source code 

Transform flat list of categories to a tree based on parent attribute.

The top-level categories have the given parent and each level in the tree is sorted.

If remove is given then the subtree with remove as root will not be included.

The tree is represented as a list of tuples, (cat, sub-tree), where cat is the parent category and subtree is the same tree representation of the children.