26 lines
531 B
Python
26 lines
531 B
Python
|
|
|
|
class Config():
|
|
|
|
def __init__(self, script_dir, bot):
|
|
self.script_dir = script_dir
|
|
self.bot = bot
|
|
|
|
self.internal = {}
|
|
|
|
self.core_setup()
|
|
|
|
def core_setup(self):
|
|
|
|
self.internal["paths"] = {
|
|
"script_dir": self.script_dir
|
|
}
|
|
|
|
def __getattr__(self, name):
|
|
"""
|
|
Quick and dirty shortcuts. Will only get called for undefined attributes.
|
|
"""
|
|
|
|
if hasattr(self.bot.config, name):
|
|
return eval("self.bot.config.%s" % name)
|