Controller.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import Alt
  2. import Stateful
  3. class Client():
  4. def get_config():
  5. # T-B-C...
  6. configs = ['lang', 'listStyle', 'DBType', 'DBPath']
  7. # rl == 'r'eturn 'l'ist
  8. rl = Stateful.matchTomlKeys("config.toml", configs)
  9. global lang, listStyle, dbType, dbPath
  10. lang = rl[0]
  11. listStyle = rl[1]
  12. dbType = rl[2]
  13. dbPath = rl[3]
  14. def get_help():
  15. print(Stateful.matchTomlKey("config.toml", lang, "command-help"))
  16. def TransitCommand():
  17. # do while or for (1)
  18. app_command = input(currentPath).split(" ")
  19. app_command.append(dbPath)
  20. app_command.append(dbType)
  21. Stateful.TransitHandler(app_command)
  22. def start():
  23. # 1. get config
  24. Client.get_config()
  25. global currentPath
  26. currentPath = "/: "
  27. # ↓↓↓ test code here ↓↓↓
  28. # ↑↑↑ test code here ↑↑↑
  29. # Normalized Start Process
  30. startState = Stateful.TransitHandler(['list', 'board', dbPath, dbType])
  31. Client.TransitCommand()
  32. # 2. list board
  33. # Command.list
  34. if __name__ == "__main__":
  35. Client.start()