kbc.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import kbc_alt
  2. import kbc_toml
  3. import kbc_sqlite
  4. import kbc_llm
  5. import datetime
  6. # class config def read(), reload()
  7. class kbc_controller():
  8. def get_app_config(returnDict:bool=True):
  9. tomls = kbc_toml.MatchTomlTable("dev.toml", "app_config", "dict")
  10. if returnDict == True:
  11. return tomls
  12. def get_help():
  13. pass
  14. def rewrite_config():
  15. pass
  16. # [todo 4]
  17. def display_in_timezone(timezone:int=0):
  18. pass
  19. # [todo 2]
  20. def validCheck():
  21. pass
  22. def makeLog():
  23. pass
  24. def transitCommand():
  25. while(True):
  26. pass
  27. # Input exception check
  28. # [todo 1]
  29. # Controller.InputCheck(app_commands)
  30. def direct():
  31. sqls = input("direct sqls(ONE SQL STATEMENT ONLY): ")
  32. res = kbc_sqlite.exec_fetchall(kbc_sqlite.oc['dp'], sqls)
  33. print("res: ", res)
  34. # [todo 4]
  35. def start():
  36. app_config = kbc_controller.get_app_config()["app_config"]
  37. kbc_sqlite.oc['dt'] = app_config['DBType']
  38. kbc_sqlite.oc['dp'] = app_config['DBPath']
  39. kbc_sqlite.oc['cp'] = ['home']
  40. if __name__ == "__main__":
  41. kbc_controller.start()
  42. kbc_controller.direct()
  43. kbc_alt.pause()