|
- __init__(self)
- initialize VMSP data class
- _logi(self, msg, type='Info', logfile=None)
- utility error/info logging.
This is an internal logging function.
Default is to stderr, but a logfile may be used.
- dat_alist(self, datfile)
- convenience function
- dat_clist(self, datfile)
- convenience function
- dat_get(self, item)
- Request an item from the data file.
This function alters the datafile, and writes
the result back to it, effectively with admin
privileges.
The success of the query is denoted by the variables
got and nitem.
if item exists and is gotten : got = 1, nitem = 1
if item doesnt exist : got = 0, nitem = 0
if item exits, but NOT gotten: got = 0, nitem = 1
The data file is not altered except when got=1 and
nitem=1
- dat_list(self, ilist, type='admin', bank=None)
- list a data file dependent on access level.
type should be either client or admin.
bank is an optional argument, only required if
admin access is desired.
Returns the listed data, dependent on admin or
normal client access.
- dat_rfile(self, filename)
- default datafile read method
You should override this method if your datafile
is structured differently.
If file reading fails, return an error message.
Otherwise return the bank and the items list.
- dat_wfile(self, bank, ilist, amount, item, name)
- update the data file with new (if any) data
This method must also be overridden if your
data file is differently structured.
This requires the changed items from interaction
with the client. It should not be necessary to call
this method if no changes have been made!
Returns error message if fails, otherwise writes the file.
- log_rfile(self, filename, function)
- general log read menthod.
You must supply a function to act on tlist.
|