72 lines
1.6 KiB
Python
72 lines
1.6 KiB
Python
import massedit
|
|
import credentials
|
|
|
|
import config
|
|
|
|
import config_default
|
|
|
|
import json
|
|
import inspect
|
|
|
|
import utilities_script as utilities
|
|
|
|
class Config_Management_Module():
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.configNames = ['config.py']
|
|
self.config = Config_Wrap()
|
|
|
|
def mainTest(self):
|
|
print("[Config Management Module]> test")
|
|
#print(self.doesConfigExist("twitch_module"))
|
|
#self.editConfig('twitch_module: bool = False', 'twitch_module: bool = True')
|
|
#test = config_default.Config_Default()
|
|
test = {1:2, 3:4, 5:6, 7:8, 987:{1:2, 3:4, 5:6, 7:8}}
|
|
print(self.tempFunc(test))
|
|
testConfig = Config_Wrap()
|
|
testConfig.currentConfig.loadConfig_Default()
|
|
|
|
def tempFunc(self, configtext):
|
|
#return json.dump(configtext, "")
|
|
return json.dumps(self, default=lambda o:configtext, sort_keys=True, indent=4)
|
|
|
|
def main():
|
|
pass
|
|
|
|
def doesConfigExist(self, configName):
|
|
doesExist = False
|
|
|
|
return doesExist
|
|
|
|
class Config_Wrap():
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.currentConfig = Config()
|
|
|
|
class Config():
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.name = "default_config"
|
|
self.data = {}
|
|
|
|
def getConfig(self):
|
|
pass
|
|
|
|
def setConfig(self):
|
|
pass
|
|
|
|
def loadConfig(self):
|
|
pass
|
|
|
|
def loadConfig_Default(self):
|
|
tempConfig = config_default.Config_Default()
|
|
for obj in inspect.getmembers(tempConfig):
|
|
print(obj)
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
testModule = Config_Management_Module()
|
|
|
|
testModule.mainTest() |