Make the PluginConfig class heritate the poezio Config
We can use the nice and safe get() method
This commit is contained in:
parent
cb2796abc5
commit
a090b235d7
1 changed files with 3 additions and 1 deletions
|
@ -1,9 +1,10 @@
|
||||||
import os
|
import os
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
import config
|
||||||
import inspect
|
import inspect
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
class PluginConfig(ConfigParser):
|
class PluginConfig(config.Config):
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
ConfigParser.__init__(self)
|
ConfigParser.__init__(self)
|
||||||
self.__config_file__ = filename
|
self.__config_file__ = filename
|
||||||
|
@ -23,6 +24,7 @@ class PluginConfig(ConfigParser):
|
||||||
except IOError:
|
except IOError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class SafetyMetaclass(type):
|
class SafetyMetaclass(type):
|
||||||
# A hack
|
# A hack
|
||||||
core = None
|
core = None
|
||||||
|
|
Loading…
Reference in a new issue