kbc.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. # if start_as_llmserver == True:
  40. kbc_sqlite.oc['cp'] = ['home']
  41. if __name__ == "__main__":
  42. kbc_controller.start()
  43. kbc_controller.direct()
  44. kbc_alt.pause()