kbc.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import kbc_alt
  2. import kbc_toml
  3. import kbc_sqlite
  4. import kbc_llm
  5. import datetime
  6. oc = {
  7. "dt":str, # DBType
  8. "dp":str, # DBPath
  9. "cp":list, # CurrentPath
  10. "pp":list, # PreviousPath
  11. "next_move":str,
  12. "tp":list, # TargetPath
  13. "tp_in":list, # ~ after command parameter "in"(&& before command parameter "to")
  14. "tp_to":list, # ~ after command parameter "to"
  15. "tp_attr":str # ~ like "-name" in "edit -name oldName to newName"
  16. }
  17. # some thoughts:
  18. # class oc():
  19. # def get_oc(), def move_oc()
  20. class kbc_controller():
  21. def get_app_config(returnDict:bool=True):
  22. tomls = kbc_toml.MatchTomlTable("dev.toml", "app_config", "dict")
  23. global app_config
  24. app_config = tomls["app_config"]
  25. if returnDict == True:
  26. return app_config
  27. def get_help():
  28. pass
  29. def rewrite_config():
  30. pass
  31. # [todo 3]
  32. def inUTC(timeZone:int=0):
  33. dt_now_UTC0 = str(datetime.datetime.now(datetime.timezone.utc))
  34. return(dt_now_UTC0)
  35. # [todo 2]
  36. # 前端只检查输入数量正确, 内容正确统一代回后端检查
  37. def inputHandler():
  38. pass
  39. def transitCommand():
  40. # do while or for (1)
  41. while(1):
  42. app_commands = input(currentPath + "/: ", ).split(" ")
  43. # Input exception check
  44. # [todo 1]
  45. # Controller.InputCheck(app_commands)
  46. def makeLog():
  47. pass
  48. # [todo 4]
  49. def start():
  50. pass
  51. # 2. Valid DB
  52. # startState = Stateful.Translator(['/', app_config["dbPath"], app_config["dbType"]])
  53. # print(startState)
  54. # kbc_controller.TransitCommand()
  55. if __name__ == "__main__":
  56. kbc_controller.start()