Stateful.py 909 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # from Controller import kbc_config
  2. import kbc_alt
  3. import kbc_toml
  4. import kbc_sqlite
  5. # ------ Basics ------
  6. def get_app_config(returnDict:bool=True):
  7. tomls = kbc_toml.MatchTomlTable("dev.toml", "app_config", "dict")
  8. global app_config
  9. app_config = tomls["app_config"]
  10. if returnDict == True:
  11. return app_config
  12. # ----- Core Function -----
  13. def Translator():
  14. global oc
  15. oc = {
  16. "dt":str, # DBType
  17. "dp":str, # DBPath
  18. "cp":list, # CurrentPath
  19. "pp":list, # PreviousPath
  20. "next_move":str,
  21. "tp":list, # TargetPath
  22. "tp_in":list, # ~ after command parameter "in"(&& before command parameter "to")
  23. "tp_to":list, # ~ after command parameter "to"
  24. "tp_attr":str # ~ like "-name" in "edit -name oldName to newName"
  25. }
  26. # some thoughts:
  27. # class oc():
  28. # def get_oc(), def move_oc()
  29. if __name__ == "__main__":
  30. pass