main.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. '''
  2. Author: deng.yinping deng.yinping@muchinfo.cn
  3. Date: 2024-12-06 15:02:12
  4. LastEditors: deng.yinping deng.yinping@muchinfo.cn
  5. LastEditTime: 2025-03-07 16:13:23
  6. FilePath: \MTP20_i18n_Tool\main.py
  7. Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. '''
  9. from src.common import CommonUti
  10. from src.tools import Tools
  11. output_folder_pc="output"
  12. json_folder_pc="C:/Workspaces/Code_Git/MTP20_WEB_GLOBAL/public/locales/"
  13. oem_json_folder_pc = "C:/Workspaces/Code_Git/MTP20_WEB_GLOBAL/oem/"
  14. output_folder_manage="output_manage"
  15. json_folder_manage="C:/Workspaces/Code_Git/MTP2.0_NEWMANAGE_WEB\public/locales/"
  16. oem_json_folder_manage = "C:/Workspaces/Code_Git/MTP2.0_NEWMANAGE_WEB/oem/"
  17. if __name__ == "__main__":
  18. while True:
  19. platform = input("请选择平台 (pc, manage, exit): ")
  20. if platform == "exit":
  21. break
  22. type = input("请选择生成类型 (excel, json): ")
  23. if platform == "pc":
  24. oem = "tss"
  25. inc_file = "20250306_tss_inc"
  26. print("inc_file:" + inc_file)
  27. if type == "excel":
  28. # 生成交易前端excel及增量
  29. Tools.generate_excel(oem, inc_file, output_folder_pc, json_folder_pc, oem_json_folder_pc)
  30. elif type == "json":
  31. # 生成交易前端json及增量
  32. Tools.generate_json(oem, output_folder_pc, json_folder_pc, oem_json_folder_pc)
  33. elif platform == "manage":
  34. oem = "newmanage"
  35. inc_file = "20250306_newmanage_inc"
  36. print("inc_file:" + inc_file)
  37. if type == "excel":
  38. # 生成新管理后台excel及增量
  39. Tools.generate_excel(oem, inc_file, output_folder_manage, json_folder_manage, oem_json_folder_manage)
  40. elif type == "json":
  41. # 生成新管理后台json
  42. Tools.generate_json(oem, output_folder_manage, json_folder_manage, oem_json_folder_manage)
  43. else:
  44. print("输入错误,请重新输入...")
  45. print("==============================")