Controller.py 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. global commands
  15. commands = []
  16. def get_help():
  17. print(Stateful.matchTomlKey("config.toml", lang, "command-help"))
  18. def TransitCommand():
  19. # current path as a var instead↓ of input text
  20. app_command = input(" ~/: ").split(" ")
  21. app_command.append(dbType)
  22. app_command.append(dbPath)
  23. Stateful.TransitHandler(app_command)
  24. def start():
  25. # 1. get config
  26. Client.get_config()
  27. # test code
  28. Client.TransitCommand()
  29. # 2. list board
  30. # Command.list
  31. if __name__ == "__main__":
  32. Client.start()