84 lines
2.1 KiB
Python
84 lines
2.1 KiB
Python
import massedit
|
|
import credentials
|
|
|
|
import config__definitions
|
|
from config__definitions import *
|
|
from config_default import Config_Default
|
|
|
|
import json
|
|
import inspect
|
|
|
|
import utilities_script as utilities
|
|
|
|
class Config_Management_Module(Config_Default):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.config = Config_Poppet()
|
|
|
|
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()
|
|
#self.autoEnabled_Twitch_rgbLightControl
|
|
|
|
#print(config.credentialsNickname)
|
|
|
|
|
|
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_Poppet(Config_Default):
|
|
def __init__(self):
|
|
super().__init__()
|
|
#self.currentConfig = Config()
|
|
|
|
class Config(Config_Default):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.name = "default_config"
|
|
self.data = {}
|
|
|
|
def getConfig(self, key):
|
|
return self.data[key]
|
|
|
|
def setConfig(self, key, value):
|
|
self.data[key] = value
|
|
|
|
def loadConfig(self, filename):
|
|
pass
|
|
|
|
def loadConfig_Default(self):
|
|
tempConfig = Config_Default()
|
|
for obj in inspect.getmembers(tempConfig):
|
|
name = obj[0]
|
|
#print(name)
|
|
self.data[name] = obj[1]
|
|
|
|
for var in self.data:
|
|
print(var ," = ", self.data[var])
|
|
#self.var = self.data[var]
|
|
|
|
#for shit in self.data:
|
|
#print("found some", shit)
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
testModule = Config_Management_Module()
|
|
|
|
testModule.mainTest() |