Package isnLib :: Module coreEnv :: Class coreEnv
[show private | hide private]
[frames | no frames]

Class coreEnv


Method Summary
  __init__(self)
  cmdLineParsed(self)
called right after cmdline parms were parsed, so core env can adjust some of it's settings from what user passed at command line.
  datapath(self, f)
returns preferences dir for the current user, and append file f to it
  dummy(self, *args)
dummy callback function: doest nothing
  ensureDownloadDir(self)
makes sure download dir exists.
  errorMsg(self, txt)
  getRandomID(self)
  infoMsg(self, txt)
this fcn is called to show the user some info.
  loadObject(self, fname)
load an object from a filename on user's data dir
  loadSettings(self, sector, default)
load settings dictionary from pickled data on settings dir
  saveObject(self, fname, obj)
persist this object to a filename on user's data dir
  saveSettings(self, sector)
persist settings dict
  shutdown(self)
responsible for shutting down the entire system

Class Variable Summary
dict default_opts = {'db_module': 'ShelfDB', 'log_level': 10,...

Method Details

cmdLineParsed(self)

called right after cmdline parms were parsed, so core env can adjust some of it's settings from what user passed at command line.

#TODO2: perhaps cmdline parsing can move here...

datapath(self, f)

returns preferences dir for the current user, and append file f to it

dummy(self, *args)

dummy callback function: doest nothing

ensureDownloadDir(self)

makes sure download dir exists. Download dir is a 'core' option
Returns:
the download dir full path

infoMsg(self, txt)

this fcn is called to show the user some info. Should be overriden by GUI with a msg box or something

loadObject(self, fname)

load an object from a filename on user's data dir
Parameters:
fname - filename to load from, not full path. Path is guessed from user data dir

loadSettings(self, sector, default)

load settings dictionary from pickled data on settings dir

The only reason why loadSettings exists instead of just loadObject, is that settings have a .cfg on the end, and that they have default values in case the file doesn't exist.
Parameters:
sector - settings file to be loaded: 'datadir/sector.cfg'
default - default settings to be returned in case settings file doesn't exist

saveObject(self, fname, obj)

persist this object to a filename on user's data dir

saveSettings(self, sector)

persist settings dict
Parameters:
sector - save settings dict to sector.cfg

shutdown(self)

responsible for shutting down the entire system

Class Variable Details

default_opts

Type:
dict
Value:
{'db_adddir_batch': 6,
 'db_module': 'ShelfDB',
 'ext_ip': '127.0.0.1',
 'log_level': 10,
 'pbport': 8848,
 'user_download_dir': None}                                            

Generated by Epydoc 2.0 on Thu Dec 25 10:59:56 2003 http://epydoc.sf.net