Package linspector :: Package lib :: Package config :: Module parser :: Class ConfigParser
[hide private]
[frames] | no frames]

Class ConfigParser

source code

Known Subclasses:

Instance Methods [hide private]
 
__init__(self, log)
initializes a new ConfigParser Object
source code
 
_create_new_config_dict(self) source code
 
create_config(self, config) source code
 
_read_json_config(self, configFilename)
reads the config File and returns a dictionary, while lowering the first keys
source code
 
_get_as_list(self, configValue)
In some cases the config permits to define a list or a single value.
source code
 
_create_raw_Object(self, jsonDict, msgName, creator) source code
 
create_layouts_from_json(self, jsonLayouts) source code
 
create_hostgroups_from_json(self, jsonHostGroups)
creates Hostgroups from the jsonConfig
source code
 
create_members_from_json(self, jsonMembers)
creates Members from the jsonConfig
source code
 
_load_module(self, clazz, modPart) source code
 
replace_with_import(self, objList, modPart, items_func, class_check) source code
 
replace_pointer(self, objectList, replObjectList, id_list_func, id_get_func) source code
 
parse_config(self, configFilename)
parses the json configuration and returns a list of layouts, which contains all nessesary information of the config file.
source code
Method Details [hide private]

__init__(self, log)
(Constructor)

source code 

initializes a new ConfigParser Object

params: 
    log: pre configured logger Object to post messages while parsing"

_read_json_config(self, configFilename)

source code 

reads the config File and returns a dictionary, while lowering the first keys

params:
    configFilename: the path under which the configuration file should be found

_get_as_list(self, configValue)

source code 

In some cases the config permits to define a list or a single value.

returns the value as list

parse_config(self, configFilename)

source code 

parses the json configuration and returns a list of layouts, 
which contains all nessesary information of the config file.
It will only parse nessesary Objects.
Parsing will be done in 3 steps:
1. get raw Config Objects by just passing the values defined inside the config
2. replace references by objects
3. do sanity checks

params:
    configFilename: indicates which configuration file to parse