2019-12-16 18:12:10 +01:00
|
|
|
import configparser
|
2019-09-09 22:40:17 +02:00
|
|
|
|
|
|
|
|
2019-12-17 22:41:54 +01:00
|
|
|
class Config(configparser.RawConfigParser):
|
2019-09-09 22:40:17 +02:00
|
|
|
__slots__ = ('name', '_db')
|
|
|
|
|
|
|
|
def __init__(self, name):
|
2019-12-17 22:41:54 +01:00
|
|
|
super().__init__()
|
2019-09-09 22:40:17 +02:00
|
|
|
self.name = name
|
|
|
|
|
2019-12-17 22:41:54 +01:00
|
|
|
self._db = super()
|
2019-12-16 18:12:10 +01:00
|
|
|
self._db.read(self.name)
|
2019-09-09 22:40:17 +02:00
|
|
|
|
2019-12-16 18:12:10 +01:00
|
|
|
def all(self) -> list:
|
|
|
|
return self._db.sections()
|