import json from lib.config import Config as Config import lib.commands import logging, logging.config import select, sys import valkey import lib.pluginLoader global GavelVersion GravelVersion = "0.1.0" global Logger with open("logging.json") as _loggingConfigFile: logging.config.dictConfig(json.load(_loggingConfigFile)) Logger = logging.getLogger("GravelMC.Main") def main(): Logger.info("Starting GravelMC") Logger.info("Version: " + GravelVersion) Logger.debug("Loading config") configFilePath = "config.json" config = Config(configFilePath) Logger.debug("Config Loaded") Logger.debug(f"Configuring Valkey client with DB: {config.valkeyConf.db} , Host: {config.valkeyConf.host}, Port: {config.valkeyConf.port}") valkey.Valkey(host=config.valkeyConf.host, port=config.valkeyConf.port, db=config.valkeyConf.db) Logger.debug("Loading Plugins") lib.pluginLoader.LoadPlugins() Logger.debug("Plugins Loaded") Logger.debug("Beginning to loop") while True: loop() Logger.debug("Ended loop") bye() def loop(): #Logger.debug("Beginning of loop") ready, _, _ = select.select([sys.stdin], [], [], 0) if ready: line = sys.stdin.readline().strip() lib.commands.Parse(line) #Logger.debug("End of loop") def bye(): Logger.info("Stopping Gravel.") if __name__ == "__main__": try: main() except KeyboardInterrupt: bye()