config_menu.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule']
  18. # 日常的任务
  19. self.menu["Daily Task"] = ['Territorial Demon', 'Coin Challenge']
  20. @cached_property
  21. def gui_menu(self) -> str:
  22. """
  23. 生成的是json字符串
  24. :return:
  25. """
  26. return json.dumps(self.menu, ensure_ascii=False, sort_keys=False, default=str)
  27. if __name__ == "__main__":
  28. try:
  29. m = ConfigMenu()
  30. print(m.gui_menu)
  31. except:
  32. print('weih')