class documentation

Create a INI parser bounded to the list of provided sections. Optionaly convert multiline strings to list.

Example (if split_ml_text_to_list=False):

# this is a comment
; also a comment
[my-software]
# how to specify a key-value pair
format-string: restructuredtext
# white space are ignored, so name = value same as name=value
# this is why you can quote strings
quoted-string = '       hello   mom...  '
# how to set an arg which has action="store_true"
warnings-as-errors = true
# how to set an arg which has action="count" or type=int
verbosity = 1
# how to specify a list arg (eg. arg which has action="append")
repeatable-option = ["https://docs.python.org/3/objects.inv",
               "https://twistedmatrix.com/documents/current/api/objects.inv"]
# how to specify a multiline text:
multi-line-text =
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    Vivamus tortor odio, dignissim non ornare non, laoreet quis nunc.
    Maecenas quis dapibus leo, a pellentesque leo.

Example (if split_ml_text_to_list=True):

# the same rules are applicable with the following changes:
[my-software]
# how to specify a list arg (eg. arg which has action="append")
repeatable-option = # Just enter one value per line (the list literal format can also be used)
    https://docs.python.org/3/objects.inv
    https://twistedmatrix.com/documents/current/api/objects.inv
# how to specify a multiline text (you have to quote it):
multi-line-text = '''
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    Vivamus tortor odio, dignissim non ornare non, laoreet quis nunc.
    Maecenas quis dapibus leo, a pellentesque leo.
    '''
Method __call__ Undocumented
Method __init__ No summary
Method get_syntax_description Returns a string describing the config file syntax.
Method parse Parses the keys and values from an INI config file.
Instance Variable sections Undocumented
Instance Variable split_ml_text_to_list Undocumented

Inherited from ConfigFileParser:

Method serialize Does the inverse of config parsing by taking parsed values and converting them back to a string representing config file contents.
def __call__(self): (source)

Undocumented

def __init__(self, sections, split_ml_text_to_list): (source)
Parameters
sectionsThe section names bounded to the new parser.
split_ml_text_to_listUndocumented
Unknown Field: split_ml_text_to_list
Wether to convert multiline strings to list
def get_syntax_description(self): (source)

Returns a string describing the config file syntax.

def parse(self, stream): (source)

Parses the keys and values from an INI config file.

sections = (source)

Undocumented

split_ml_text_to_list = (source)

Undocumented