systemsettings.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # -*- coding: utf-8 -*-
  2. #!/usr/bin/env python
  3. import click
  4. from base import init_env
  5. init_env(interactive=True)
  6. from apps.web.constant import Const
  7. from apps.web.user.models import Redpack
  8. @click.group()
  9. def cli():
  10. click.echo(u"欢迎进入系统配置修改脚本")
  11. @cli.command()
  12. def modify_redpack_support_list():
  13. """修改红包支持类型列表"""
  14. dev_type_list = ['100206', '100206', '100202', '100278', '1002101', '10020622', '100210']
  15. for code in range(int(Const.DEVICE_TYPE_CODE_PULSE_BEGIN), int(Const.DEVICE_TYPE_CODE_PULSE_END) + 1):
  16. dev_type_list.append(str(code))
  17. for code in range(int(Const.DEVICE_TYPE_CODE_TIMESWITCH1), int(Const.DEVICE_TYPE_CODE_TIMESWITCH8) + 1):
  18. dev_type_list.append(str(code))
  19. dev_type_list.extend([
  20. Const.DEVICE_TYPE_CODE_QUICK_CHARGE,
  21. Const.DEVICE_TYPE_CODE_WASHER_SCHZ,
  22. Const.DEVICE_TYPE_CODE_PEDICURE2,
  23. Const.DEVICE_TYPE_CODE_HUITENG,
  24. Const.DEVICE_TYPE_CODE_PEDICURE_HONGPAI,
  25. Const.DEVICE_TYPE_CODE_BINNUO,
  26. Const.DEVICE_TYPE_CODE_CHUIFENGJI,
  27. Const.DEVICE_TYPE_CODE_WASHCAR_HAIER
  28. ])
  29. Redpack.renew_support_repack_list(dev_type_list)
  30. click.echo(dev_type_list)
  31. click.echo(u'修改红包支持类型列表成功')
  32. if __name__ == '__main__':
  33. cli()