config_menu.py 947 B

1234567891011121314151617181920212223242526272829303132333435
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. import json
  5. from cached_property import cached_property
  6. from pydantic import BaseModel, ValidationError, validator, Field
  7. from module.config.utils import *
  8. class ConfigMenu:
  9. # 手动的代码配置菜单
  10. def __init__(self) -> None:
  11. self.menu = {}
  12. # 总览
  13. self.menu["Overview"] = []
  14. # 脚本设置
  15. self.menu['Script'] = ['Script', 'General', 'Restart']
  16. # 日常的任务
  17. self.menu["Daily Task"] = ['Territorial Demon', 'Coin Challenge']
  18. @cached_property
  19. def gui_menu(self) -> str:
  20. """
  21. 生成的是json字符串
  22. :return:
  23. """
  24. return json.dumps(self.menu, ensure_ascii=False, sort_keys=False, default=str)
  25. if __name__ == "__main__":
  26. try:
  27. m = ConfigMenu()
  28. print(m.gui_menu)
  29. except:
  30. print('weih')