Package moul :: Package file :: Module wdysini :: Class ConfFile
[hide private]
[frames] | no frames]

Class ConfFile



object --+
         |
        ConfFile
Known Subclasses:
AudioIni, GraphicsIni

Instance Methods [hide private]
  __init__(self, path)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  clear(self)
Clear all informations
  reset(self)
Reset state of the ini parser
  exists(self)
Test if the file exists
  isChanged(self)
Check if the data was changed
  read(self)
Open encrypted file at 'path' and parse its data
  create(self)
Create a new file using default values
  write(self)
Write data to file The write method uses the savest way possible.
  _parseEncFile(self, fd_name)
Read and parse file (fd or file name)
  _parseString(self, s)
Parse string with file contents
  _parserDoneHook(self)
Hook called after the data is read and parsed
  _writeString(self)
Create a string with new file contents
  _writeEncFile(self, fd_name)
Write file (fd or file name)
  _get(self, name)
get descriptor helper
  _set(self, name, value)
set descriptor helper
  _getp(self, name)
get descriptor helper for % sliders
  _setp(self, name, value)
set descriptor helper for % sliders
  _setboolint(self, name, value)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]
  _options = {}
  _defaults = {}
  _filename = None
helper for pickle

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, path)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

clear(self)

 
Clear all informations

reset(self)

 

Reset state of the ini parser

Copies file data to new data

exists(self)

 
Test if the file exists

isChanged(self)

 
Check if the data was changed

read(self)

 
Open encrypted file at 'path' and parse its data

create(self)

 
Create a new file using default values

write(self)

 
Write data to file

The write method uses the savest way possible. The old file is backed
up, the new data is written to another file and at last the original
file is replaced with the new file.

WINDOWS
-------
  os.rename() can't replace the file in place under Windows. The final
  operation is not atomic. :(

_parseEncFile(self, fd_name)

 
Read and parse file (fd or file name)

_parseString(self, s)

 
Parse string with file contents
Parameters:
  • s (string) - newline seperated file

_parserDoneHook(self)

 
Hook called after the data is read and parsed

_writeString(self)

 
Create a string with new file contents

_writeEncFile(self, fd_name)

 
Write file (fd or file name)

_get(self, name)

 
get descriptor helper

_set(self, name, value)

 
set descriptor helper

_getp(self, name)

 

get descriptor helper for % sliders

The slider must have values between 0 and 100

_setp(self, name, value)

 
set descriptor helper for % sliders

_setboolint(self, name, value)

 

Class Variable Details [hide private]

_options

None
Value:
{}                                                                     
      

_defaults

None
Value:
{}                                                                     
      

_filename

helper for pickle
Value:
None