# -*- coding: utf-8 -*- #!/usr/bin/env python import click from base import init_env init_env(interactive=True) from apps.web.constant import Const from apps.web.user.models import Redpack @click.group() def cli(): click.echo(u"欢迎进入系统配置修改脚本") @cli.command() def modify_redpack_support_list(): """修改红包支持类型列表""" dev_type_list = ['100206', '100206', '100202', '100278', '1002101', '10020622', '100210'] for code in range(int(Const.DEVICE_TYPE_CODE_PULSE_BEGIN), int(Const.DEVICE_TYPE_CODE_PULSE_END) + 1): dev_type_list.append(str(code)) for code in range(int(Const.DEVICE_TYPE_CODE_TIMESWITCH1), int(Const.DEVICE_TYPE_CODE_TIMESWITCH8) + 1): dev_type_list.append(str(code)) dev_type_list.extend([ Const.DEVICE_TYPE_CODE_QUICK_CHARGE, Const.DEVICE_TYPE_CODE_WASHER_SCHZ, Const.DEVICE_TYPE_CODE_PEDICURE2, Const.DEVICE_TYPE_CODE_HUITENG, Const.DEVICE_TYPE_CODE_PEDICURE_HONGPAI, Const.DEVICE_TYPE_CODE_BINNUO, Const.DEVICE_TYPE_CODE_CHUIFENGJI, Const.DEVICE_TYPE_CODE_WASHCAR_HAIER ]) Redpack.renew_support_repack_list(dev_type_list) click.echo(dev_type_list) click.echo(u'修改红包支持类型列表成功') if __name__ == '__main__': cli()