diff options
Diffstat (limited to 'cbc')
| -rw-r--r-- | cbc/parsers.py | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/cbc/parsers.py b/cbc/parsers.py new file mode 100644 index 0000000..78b5c5d --- /dev/null +++ b/cbc/parsers.py @@ -0,0 +1,10 @@ +from configparser import ConfigParser, ExtendedInterpolation + + +class CBCConfigParser(ConfigParser): +    def getlist(self,section,option): +        value = self.get(section,option) +        return list(filter(None, (x.strip() for x in value.splitlines()))) + +    def getlistint(self,section,option): +        return [int(x) for x in self.getlist(section,option)]
\ No newline at end of file | 
