Commit b6315f89 by sikang

自动生成描述

parent fe8aa22b
#!/usr/bin/env python3
import json
import string
import random
import base64
import glob, os
import sys
# def gen_rand_str():
# rand_str = ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase, k=8))
# return rand_str + str(random.randint(0, 1000000))
def setAdress(line):
if "${email}" in line:
if len(sys.argv[2]) >0:
line = line.replace("${email}",sys.argv[2])
else:
line = ""
if "${phone_num}" in line:
if len(sys.argv[3]) >0:
line = line.replace("${phone_num}",sys.argv[3])
else:
line = ""
if "${adress}" in line:
if len(sys.argv[4]) >0:
line = line.replace("${adress}",sys.argv[4])
else:
line = ""
return line
def create_desc(read_path,write_path):
with open(read_path, "r") as f:
lines = f.readlines()
search_str = "-@Example " + str(random.randint(0, 18)) + "-"
is_target = False
print (search_str)
print (sys.argv[1])
with open(write_path, "w") as f_w:
for line in lines:
if search_str in line:
is_target=True
continue
if is_target and "@End" in line:
is_target=False
continue
if is_target:
line = line.replace("${app_name}",sys.argv[1])
line = setAdress(line)
if len(line) > 0:
f_w.write(line)
create_desc("/Users/connor/StudioProjects/WorkSpace/app_desc.txt","/Users/connor/Documents/apks/"+sys.argv[5]+"_desc.txt")
...@@ -255,6 +255,8 @@ elif (($commod == '26'));then ...@@ -255,6 +255,8 @@ elif (($commod == '26'));then
echo "${corp_id} ${app_name} " echo "${corp_id} ${app_name} "
echo "对内协议:${agreement_url}" echo "对内协议:${agreement_url}"
echo "对外协议:${home}/privacy.html" echo "对外协议:${home}/privacy.html"
cd print
python create_desc.py "${app_name}" "${cus_email}" "${hot_line}" "${cus_adress}" "${corp_id}"
echo " " echo " "
elif (($commod == '10000')) elif (($commod == '10000'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment