Controller.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # @author: nandHyf
  2. import Stateful, View
  3. class Command():
  4. def list():
  5. pass
  6. def add():
  7. pass
  8. def delete():
  9. pass
  10. def edit():
  11. pass
  12. def move():
  13. pass
  14. def backHome():
  15. pass
  16. def backPrevious():
  17. pass
  18. class Client():
  19. def get_config():
  20. # T-B-C...
  21. configs = ['lang', 'listStyle', 'DBType', 'DBPath']
  22. # rl == 'r'eturn 'l'ist
  23. rl = Stateful.matchTomlKeys("config.toml", configs)
  24. global lang, listStyle, dbType, dbPath
  25. lang = rl[0]
  26. listStyle = rl[1]
  27. dbType = rl[2]
  28. dbPath = rl[3]
  29. global commands
  30. commands = []
  31. def get_help():
  32. print(Stateful.matchTomlKey("config.toml", lang, "command-help"))
  33. def handleCommand():
  34. pass
  35. def start():
  36. # 1. get config
  37. Client.get_config()
  38. # test code
  39. # 2. list board
  40. # Command.list
  41. # 3. wait command input
  42. command = input()
  43. if __name__ == "__main__":
  44. Client.start()