b3j0f.conf.params module¶
-
class
b3j0f.conf.params.
Configuration
(*categories)[source]¶ Bases:
object
Manage conf such as a list of Categories.
The order of categories permit to ensure param overriding.
-
ERRORS
= 'ERRORS'¶ category name which contains errors
-
FOREIGNS
= 'FOREIGN'¶ category name which contains not local parameters
-
VALUES
= 'VALUES'¶ category name which contains local parameter values
-
add_unified_category
(name, copy=False, new_content=None)[source]¶ Add a unified category to self and add new_content if not None.
-
copy
(cleaned=False)[source]¶ Copy this Configuration.
Parameters: cleaned (bool) – copy this element without parameter values.
-
get_unified_category
(name, copy=False)[source]¶ Add a category with input name which takes all params provided by other categories.
Parameters:
-
unify
(copy=False)[source]¶ Get a conf which contains only two categories:
- VALUES where params are all self params where values are not
exceptions.contains all values
- ERRORS where params are all self params where values are
exceptions
Parameters: copy (bool) – copy self params (default False). Returns: two categories named respectivelly VALUES and ERRORS and contain respectivelly self param values and parsing errors. Return type: Configuration
-
-
class
b3j0f.conf.params.
Category
(name, *params)[source]¶ Bases:
object
Parameter category which contains a dictionary of params.
-
class
b3j0f.conf.params.
Parameter
(name, parser=None, value=None, critical=False, local=True, asitem=None)[source]¶ Bases:
object
Parameter identified among a category by its name.
Provide a value (None by default) and a parser (str by default).
-
static
array
(item_type=<type 'str'>)[source]¶ Get an array from an input value where items are separated by ‘,’.
-
value
¶
-
static