Uranium
Application Framework
Loading...
Searching...
No Matches
UM.FastConfigParser.FastConfigParser Class Reference

Public Member Functions

None __init__ (self, str data)
 
bool __contains__ (self, str key)
 
Dict[str, supported_data] __getitem__ (self, str key)
 
 __iter__ (self)
 

Static Public Attributes

 header_regex = re.compile(r"\[(\w+?)\]\n(.*?)(?:(?=\n\[(?:\w+?)\])|\Z)", re.S)
 
 key_value_regex = re.compile(r"([^=\n !]+)[ \t]*=[ \t]*(.*?)(?:(?=\s+(?:^[^=\n\t !<>\[]+)[ \t]*=[ \t]*[^=])|(?=\n\[)|\Z)", flags = re.S|re.M)
 

Protected Attributes

dict _parsed_data = {}
 

Detailed Description

This class is to replace the much slower configparser provided by Python itself.
It's probably nowhere near as robust and supports only a fraction of the functionality of the real deal.

In it's current state it supports reading config headers and the key value pairs beneath it.
It also supports the contains syntax (So if the config has a header [Foo], "Foo" in config will be true) as well
as the getItem syntax config["foo"] returns a dict with the key value pairs in the header.

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