modules::clSettings::settings Class Reference

Main config class holds functions to access config file. More...

List of all members.

Public Member Functions

def __init__
 The Constructor.
def section_exists
 Tests whether a section exists or not.
def option_exists
 Tests whether an option exists or not.
def set_value
 Set a option's value and write it to pyjama.cfg.
def get_value
 Reads a value from an option.
def remove_option
 Removes an option from pyjama.cfg.
def write_config
 Writes pyjama.cfg to disc In most cases this is done by set_value automatically.
def isbool
 Tests if a string contains a boolean.
def parsebool
 Return the boolean value a string contains.

Public Attributes

 parent
 Pointer to Pyjama.
 home_config
 stores the config file URI
 config
 Parser Object Pointer.
 options
 List holding options from pyjama.cfg.


Detailed Description

Main config class holds functions to access config file.

Definition at line 29 of file clSettings.py.


Member Function Documentation

def modules::clSettings::settings::__init__ (   self,
  parent = None 
)

The Constructor.

Parameters:
self The Object pointer
parent Pyjama Object Pointer

Definition at line 33 of file clSettings.py.

def modules::clSettings::settings::get_value (   self,
  section,
  option,
  default = None,
  func = None 
)

Reads a value from an option.

Parameters:
self The Object pointer
section A section as string
option An option as string
default A default value
func A function to run over the value read out - think of float conversions etc.
Returns:
The option's value or default if section or option do not exist

Definition at line 107 of file clSettings.py.

def modules::clSettings::settings::isbool (   self,
  string 
)

Tests if a string contains a boolean.

Parameters:
self The Object pointer
string The strint to test
Returns:
bool

Definition at line 176 of file clSettings.py.

def modules::clSettings::settings::option_exists (   self,
  section,
  option 
)

Tests whether an option exists or not.

Parameters:
self The Object pointer
self The Object Pointer
section The section in which the option should be found as string
option The option to test for as string
Returns:
bool

Definition at line 79 of file clSettings.py.

def modules::clSettings::settings::parsebool (   self,
  string 
)

Return the boolean value a string contains.

Parameters:
self The Object pointer
Returns:
bool

Definition at line 184 of file clSettings.py.

def modules::clSettings::settings::remove_option (   self,
  section,
  option 
)

Removes an option from pyjama.cfg.

Parameters:
self The Object pointer
section The option's section
option The option to delete
Returns:
bool

Definition at line 146 of file clSettings.py.

def modules::clSettings::settings::section_exists (   self,
  section 
)

Tests whether a section exists or not.

Parameters:
self The Object pointer
self The Object pointer
section A string
Returns:
bool

Definition at line 70 of file clSettings.py.

def modules::clSettings::settings::set_value (   self,
  section,
  option,
  value,
  func = None 
)

Set a option's value and write it to pyjama.cfg.

Parameters:
self The Object pointer
section The section as string
option The option as string
value The value to set as string
func A function to run over the value before it is written to config
Returns:
bool

Definition at line 90 of file clSettings.py.

def modules::clSettings::settings::write_config (   self  ) 

Writes pyjama.cfg to disc In most cases this is done by set_value automatically.

Parameters:
self The Object pointer
Returns:
None

Definition at line 155 of file clSettings.py.


The documentation for this class was generated from the following file:

Generated on Thu Jun 4 19:08:24 2009 for Pyjama by  doxygen 1.5.8