1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- # coding=utf-8
- from common.logging import Logging
- from sdk.tool.ad_ecpm_config_txt import AdEcpmConfigTxt
- def _gen_unity_ad_worth(package_name, config_txt_path, to_path):
- from sdk.tool.ad_worth import get_ad_worth_from_web
- ad_worth = get_ad_worth_from_web(package_name)
- txt = AdEcpmConfigTxt()
- txt.read(config_txt_path)
- from sdk.tool.ad_worth import add_unity_config
- add_unity_config(ad_worth, txt)
- ad_worth.print_info()
- ad_worth.write(to_path)
- Logging.info("写入完成:{}".format(to_path))
- def _printScriptInfo():
- print "************************************************************"
- print "* 脚本作用: 从服务器更新ad_worth.json 并插入unity的配置 "
- print "* 参数说明:"
- print "* 包名 (iOS的话:填入字符串的bundleId, 而不是数字版的appId"
- print "* 插屏价格配置文件路径"
- print "* 更新后写入的文件"
- print "* 例:"
- print "* python ad_worth_add_unity.py com.red.test /user/test/inter_cfg.txt /user/test/ad_worth.json"
- print "************************************************************"
- print ""
- def run(argv):
- _printScriptInfo()
- if len(argv) < 4:
- Logging.error("参数个数小于3个")
- exit(0)
- package_name = argv[1]
- config_txt_path = argv[2]
- to_path = argv[3]
- Logging.info("包名:{}".format(package_name))
- Logging.info("写入文件:{}".format(to_path))
- _gen_unity_ad_worth(package_name, config_txt_path, to_path)
- if __name__ == '__main__':
- run([
- "ad_worth_add_unity.py",
- "com.shootingzombie.deadcity",
- "/Users/zhuge/Temp/20201226/test/archery_inter_20200805_20200904_summary.txt",
- "/Users/zhuge/Temp/20201226/test/ad_worth_unity.json",
- ])
|