Module guihelper
[hide private]
[frames] | no frames]

Module guihelper

source code

Various helper routines for gui based code

Classes [hide private]
  ArtProvider
ArtProvider manages the art for the application
  MultiMessageBox
Functions [hide private]
 
getwxmimetype(filename)
Returns wx's mime type for the extension of filename, or None
source code
 
BusyWrapper(method) source code
 
MessageDialog(*args, **kwargs) source code
 
getextension(str)
Returns the extension of a filename (characters after last period)
source code
 
basename(str)
Returns the last part of the name (everything after last /)
source code
 
dirname(str)
Returns everything before the last / in the name
source code
Bool
IsMSWindows()
Are we running on Windows?
source code
Bool
IsGtk()
Are we running on GTK (Linux)
source code
Bool
IsMac()
Are we running on Mac
source code
wxBitmap
getbitmap(name)
Gets a bitmap from the resource directory
source code
wx.Image
getimage(name)
Gets an image from the resource directory
source code
string
getresourcefile(filename)
Returns name of file by adding it to resource directory pathname
source code
 
gethelpfilename()
Returns what name we use for the helpfile
source code
 
getresourcefiles(wildcard)
Returns a list of filenames matching the wildcard in the resource directory
source code
 
GetOpenCommand(mimetypes, filename) source code
Variables [hide private]
  ID_FILENEW = 159
  ID_FILEOPEN = 176
  ID_FILESAVE = 154
  ID_FILEIMPORT = 182
  ID_FILEEXPORT = 163
  ID_FILEPRINT = 175
  ID_FILEPRINTPREVIEW = 149
  ID_FILEEXIT = 157
  ID_EDITADDENTRY = 146
  ID_EDITDELETEENTRY = 118
  ID_EDITSELECTALL = 148
  ID_EDITSETTINGS = 130
  ID_EDITPHONEINFO = 105
  ID_EDITDETECT = 103
  ID_EDITCOPY = 145
  ID_EDITPASTE = 112
  ID_EDITRENAME = 153
  ID_DATAGETPHONE = 165
  ID_DATASENDPHONE = 132
  ID_DATAHISTORICAL = 135
  ID_DATANEWDB = 115
  ID_AUTOSYNCSETTINGS = 172
  ID_AUTOSYNCEXECUTE = 179
  ID_VIEWCOLUMNS = 129
  ID_VIEWPREVIEW = 101
  ID_VIEWLOGDATA = 123
  ID_VIEWCLEARLOGS = 166
  ID_VIEWFILESYSTEM = 133
  ID_HELPHELP = 140
  ID_HELPCONTENTS = 122
  ID_HELPTOUR = 185
  ID_HELPSUPPORT = 124
  ID_HELP_UPDATE = 155
  ID_HELPABOUT = 169
  ID_HELPPHONE = 134
  ID_HELPHOWTOS = 177
  ID_HELPFAQ = 180
  ID_DR_SETTINGS = 120
  ID_DEBUG_SCRIPT = 174
  ID_FILEVIEW_THUMBNAIL = 104
  ID_FILEVIEW_LIST = 127
  ID_FV_SAVE = 106
  ID_FV_HEXVIEW = 109
  ID_FV_OVERWRITE = 116
  ID_FV_MOVE = 181
  ID_FV_NEWSUBDIR = 114
  ID_FV_NEWFILE = 102
  ID_FV_DELETE = 121
  ID_FV_OPEN = 164
  ID_FV_RENAME = 183
  ID_FV_REFRESH = 160
  ID_FV_PROPERTIES = 119
  ID_FV_ADD = 131
  ID_FV_BACKUP = 128
  ID_FV_BACKUP_TREE = 186
  ID_FV_RESTORE = 142
  ID_FV_PASTE = 137
  ID_FV_TOTAL_REFRESH = 150
  ID_FV_OFFLINEPHONE = 111
  ID_FV_REBOOTPHONE = 143
  ID_FV_MODEMMODE = 167
  ID_FV_COPY = 168
  ID_FV_REPLACE = 138
  ID_EXPORT_VCARD_CONTACTS = 126
  ID_EXPORT_GROUPWARE_CONTACTS = 113
  ID_EXPORT_CSV_CONTACTS = 158
  ID_EXPORT_CSV_CALENDAR = 170
  ID_EXPORT_SMS = 161
  ID_EXPORT_CSV_CALL_HISTORY = 136
  ID_EXPORT_MEDIA_TO_DIR = 162
  ID_EXPORT_MEDIA_TO_ZIP = 184
  ID_IMPORT_CSV_CONTACTS = 147
  ID_IMPORT_CSV_CALENDAR = 152
  ID_IMPORT_VCARDS = 107
  ID_IMPORT_VCALENDAR = 141
  ID_IMPORT_ICALENDAR = 125
  ID_IMPORT_GCALENDAR = 178
  ID_IMPORT_OUTLOOK_CONTACTS = 171
  ID_IMPORT_OUTLOOK_CALENDAR = 108
  ID_IMPORT_OUTLOOK_NOTES = 156
  ID_IMPORT_OUTLOOK_TASKS = 144
  ID_IMPORT_EVO_CONTACTS = 173
  ID_IMPORT_QTOPIA_CONTACTS = 117
  ID_IMPORT_GROUPWARE_CONTACTS = 110
  ID_CALENDAR_WIZARD = 151
  ID_IMPORT_WPL = 139
  ID_EXPORT_ICALENDAR = 100
  idmap = {100: 'ID_EXPORT_ICALENDAR', 101: 'ID_VIEWPREVIEW', 10...
  _wxmimemapping = {'ani': 'image/x-ani', 'bmp': 'image/x-bmp', ...
  resourcedirectory = 'c:\\projects\\resources'
  helpdirectory = 'c:\\projects\\help'
  _ourart = {'ART_ADD_CONTACT': 'add_contact', 'ART_ADD_FIELD': ...
  ART_ADD_CONTACT = 'ART_ADD_CONTACT'
  ART_ADD_FIELD = 'ART_ADD_FIELD'
  ART_ADD_MEMO = 'ART_ADD_MEMO'
  ART_ADD_RINGER = 'ART_ADD_RINGER'
  ART_ADD_SMS = 'ART_ADD_SMS'
  ART_ADD_TODO = 'ART_ADD_TODO'
  ART_ADD_WALLPAPER = 'ART_ADD_WALLPAPER'
  ART_ARROW_DOWN = 'ART_ARROW_DOWN'
  ART_ARROW_LEFT = 'ART_ARROW_LEFT'
  ART_ARROW_RIGHT = 'ART_ARROW_RIGHT'
  ART_ARROW_UP = 'ART_ARROW_UP'
  ART_AUTOSYNCEXECUTE = 'ART_AUTOSYNCEXECUTE'
  ART_DATAGETPHONE = 'ART_DATAGETPHONE'
  ART_DATAHISTORICAL = 'ART_DATAHISTORICAL'
  ART_DATASENDPHONE = 'ART_DATASENDPHONE'
  ART_DEL_CONTACT = 'ART_DEL_CONTACT'
  ART_DEL_FIELD = 'ART_DEL_FIELD'
  ART_DEL_MEMO = 'ART_DEL_MEMO'
  ART_DEL_RINGER = 'ART_DEL_RINGER'
  ART_DEL_SMS = 'ART_DEL_SMS'
  ART_DEL_TODO = 'ART_DEL_TODO'
  ART_DEL_WALLPAPER = 'ART_DEL_WALLPAPER'
  ART_EDITDETECT = 'ART_EDITDETECT'
  ART_EDITPHONEINFO = 'ART_EDITPHONEINFO'
  ART_EDITSETTINGS = 'ART_EDITSETTINGS'
  ART_FOLDER = 'ART_FOLDER'
  ART_FOLDER_OPEN = 'ART_FOLDER_OPEN'
  ART_HELPHELP = 'ART_HELPHELP'
  ART_MEDIA_LIST_VIEW = 'ART_MEDIA_LIST_VIEW'
  ART_MEDIA_THUMB_VIEW = 'ART_MEDIA_THUMB_VIEW'
  ART_SEL_CALENDAR = 'ART_SEL_CALENDAR'
  ART_SEL_CALLHISTORY = 'ART_SEL_CALLHISTORY'
  ART_SEL_CALLS = 'ART_SEL_CALLS'
  ART_SEL_CAMERA = 'ART_SEL_CAMERA'
  ART_SEL_CONSOLE = 'ART_SEL_CONSOLE'
  ART_SEL_FILE = 'ART_SEL_FILE'
  ART_SEL_IMAGE = 'ART_SEL_IMAGE'
  ART_SEL_LOG = 'ART_SEL_LOG'
  ART_SEL_MEDIA = 'ART_SEL_MEDIA'
  ART_SEL_MEMO = 'ART_SEL_MEMO'
  ART_SEL_MESSAGE = 'ART_SEL_MESSAGE'
  ART_SEL_PHONE = 'ART_SEL_PHONE'
  ART_SEL_PHONEBOOK = 'ART_SEL_PHONEBOOK'
  ART_SEL_PHONE_ROOT = 'ART_SEL_PHONE_ROOT'
  ART_SEL_PLAYLIST = 'ART_SEL_PLAYLIST'
  ART_SEL_PROTOCOL = 'ART_SEL_PROTOCOL'
  ART_SEL_RINGERS = 'ART_SEL_RINGERS'
  ART_SEL_ROOT_IMAGE = 'ART_SEL_ROOT_IMAGE'
  ART_SEL_SMS = 'ART_SEL_SMS'
  ART_SEL_SOUNDS = 'ART_SEL_SOUNDS'
  ART_SEL_TODO = 'ART_SEL_TODO'
  ART_SEL_VIDEO = 'ART_SEL_VIDEO'
  ART_SEL_WALLPAPER = 'ART_SEL_WALLPAPER'
  idmapname = 'ID_FV_BACKUP_TREE'
  idnum = 186
  s = 'ART_ARROW_UP'
Function Details [hide private]

MessageDialog(*args, **kwargs)

source code 
Decorators:
  • @BusyWrapper

getextension(str)

source code 

Returns the extension of a filename (characters after last period)

An empty string is returned if the file has no extension. The period character is not returned

getresourcefile(filename)

source code 

Returns name of file by adding it to resource directory pathname

No attempt is made to verify the file exists

Returns: string

gethelpfilename()

source code 

Returns what name we use for the helpfile

Without trailing extension as wxBestHelpController figures that out


Variables Details [hide private]

idmap

Value:
{100: 'ID_EXPORT_ICALENDAR',
 101: 'ID_VIEWPREVIEW',
 102: 'ID_FV_NEWFILE',
 103: 'ID_EDITDETECT',
 104: 'ID_FILEVIEW_THUMBNAIL',
 105: 'ID_EDITPHONEINFO',
 106: 'ID_FV_SAVE',
 107: 'ID_IMPORT_VCARDS',
...

_wxmimemapping

Value:
{'ani': 'image/x-ani',
 'bmp': 'image/x-bmp',
 'cur': 'image/x-cur',
 'gif': 'image/gif',
 'ico': 'image/x-ico',
 'iff': 'image/iff',
 'jpeg': 'image/jpeg',
 'jpg': 'image/jpeg',
...

_ourart

Value:
{'ART_ADD_CONTACT': 'add_contact',
 'ART_ADD_FIELD': 'add_field',
 'ART_ADD_MEMO': 'add_memo',
 'ART_ADD_RINGER': 'add_ringer',
 'ART_ADD_SMS': 'add_sms',
 'ART_ADD_TODO': 'add_todo',
 'ART_ADD_WALLPAPER': 'add_picture',
 'ART_ARROW_DOWN': 'arrow_down',
...