Package fife :: Package extensions :: Module fife_utils
[hide private]
[frames] | no frames]

Module fife_utils

source code

This file contains some functions that may be useful

Functions [hide private]
 
is_fife_exc(type, original_exc)
Checks if an exception is of given type.
source code
 
getUserDataDirectory(vendor, appname)
Gets the proper location to save configuration and data files, depending on depending on OS.
source code
Variables [hide private]
  _exc_re = re.compile(r'_\[(\w+)\]_')

Imports: str, fife, re, sys, os


Function Details [hide private]

is_fife_exc(type, original_exc)

source code 

Checks if an exception is of given type. Example:

       try:
               obj = self.model.createObject(str(id), str(nspace), parent)
       except RuntimeError, e:
               if is_fife_exc(fife.NameClash, e):
                       raise NameClash('Tried to create already existing object, ignoring')
               raise

getUserDataDirectory(vendor, appname)

source code 

Gets the proper location to save configuration and data files, depending on depending on OS.

Windows: %APPDATA% endorppname Mac: ~/Library/Application Support/vendor/appname Linux/Unix/Other: ~/.vendor/appname

See: Brian Vanderburg II @ http://mail.python.org/pipermail/python-list/2008-May/660779.html