diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-16 20:18:42 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-16 20:18:42 -0400 |
commit | 7d57c0df1b16f6ddc8d5007b82244baabb91ed62 (patch) | |
tree | 01e22fed8a0d18b3cb2ffb1e630b35bf7f50509c /cbc | |
parent | 5981375bdb05cba221fa54eb2ac38d1d5df31f8f (diff) | |
download | cbc-7d57c0df1b16f6ddc8d5007b82244baabb91ed62.tar.gz |
Initial commit; moved CBCConfigParser to its own module
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 |