Package Gnumed :: Package pycommon :: Module gmCfg2 :: Class gmCfgData |
[frames] | no frames]

# Class gmCfgData

source code

      object --+
               |
    gmBorg.cBorg --+
                   |
                  gmCfgData

Instance Methods
__init__(self) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
get(self, group=None, option=None, source_order=None) Get the value of a configuration option in a config file. | source code
set_option(self, option=None, value=None, group=None, source=None) Set a particular option to a particular value. | source code
add_stream_source(self, source=None, stream=None) | source code
add_file_source(self, source=None, file=None, encoding=`'``utf8``'`) Add a source (a file) to the instance. | source code
remove_source(self, source) Remove a source from the instance. | source code
reload_file_source(self, file=None, encoding=`'``utf8``'`) | source code
add_cli(self, short_options=`u'````'`, long_options=None) Add command line parameters to config data. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods
Inherited from `gmBorg.cBorg`: `__new__`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__ (inherited documentation)

### get(self, group=None, option=None, source_order=None) | source code
    Get the value of a configuration option in a config file.

    <source_order> the order in which config files are searched
            a list of tuples (source, policy)
            policy:
                    return: return only this value immediately
                    append: append to list of potential values to return
                    extend: if the value per source happens to be a list
                            extend (rather than append to) the result list

    returns NONE when there's no value for an option

### set_option(self, option=None, value=None, group=None, source=None) | source code
Set a particular option to a particular value. Note that this does NOT PERSIST the option anywhere !

### add_cli(self, short_options=`u'````'`, long_options=None) | source code
    Add command line parameters to config data.

    short:
            string containing one-letter options such as u'h?' for -h -?
    long:
            list of strings
            'conf-file=' -> --conf-file=<...>
            'debug' -> --debug