Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
5d9fd89b
Commit
5d9fd89b
authored
Aug 30, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持固定描述模板
parent
c079dbd6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
23 deletions
+36
-23
script/print/create_desc.py
+27
-21
script/script_help.sh
+9
-2
No files found.
script/print/create_desc.py
View file @
5d9fd89b
...
@@ -14,30 +14,35 @@ import sys
...
@@ -14,30 +14,35 @@ import sys
def
setAdress
(
line
):
def
setAdress
(
line
):
if
"${email}"
in
line
:
if
"${email}"
in
line
:
if
len
(
sys
.
argv
[
2
])
>
0
:
if
len
(
sys
.
argv
[
2
])
>
0
:
line
=
line
.
replace
(
"${email}"
,
sys
.
argv
[
2
])
line
=
line
.
replace
(
"${email}"
,
sys
.
argv
[
2
])
else
:
else
:
line
=
""
line
=
""
if
"${phone_num}"
in
line
:
if
"${phone_num}"
in
line
:
if
len
(
sys
.
argv
[
3
])
>
0
:
if
len
(
sys
.
argv
[
3
])
>
0
:
line
=
line
.
replace
(
"${phone_num}"
,
sys
.
argv
[
3
])
line
=
line
.
replace
(
"${phone_num}"
,
sys
.
argv
[
3
])
else
:
else
:
line
=
""
line
=
""
if
"${adress}"
in
line
:
if
"${adress}"
in
line
:
if
len
(
sys
.
argv
[
4
])
>
0
:
if
len
(
sys
.
argv
[
4
])
>
0
:
line
=
line
.
replace
(
"${adress}"
,
sys
.
argv
[
4
])
line
=
line
.
replace
(
"${adress}"
,
sys
.
argv
[
4
])
else
:
else
:
line
=
""
line
=
""
return
line
return
line
def
create_desc
(
read_path
,
write_path
):
def
create_desc
(
read_path
,
write_path
):
with
open
(
read_path
,
"r"
)
as
f
:
with
open
(
read_path
,
"r"
)
as
f
:
lines
=
f
.
readlines
()
lines
=
f
.
readlines
()
search_str
=
"-@Example "
+
str
(
random
.
randint
(
0
,
16
)
+
1
)
+
"-"
index
=
random
.
randint
(
0
,
17
)
+
1
if
int
(
sys
.
argv
[
8
])
>
0
:
index
=
sys
.
argv
[
8
]
search_str
=
"-@Example "
+
str
(
index
)
+
"-"
is_target
=
False
is_target
=
False
print
(
search_str
)
print
(
search_str
)
print
(
sys
.
argv
[
1
])
print
(
sys
.
argv
[
1
])
...
@@ -46,37 +51,39 @@ def create_desc(read_path,write_path):
...
@@ -46,37 +51,39 @@ def create_desc(read_path,write_path):
for
line
in
lines
:
for
line
in
lines
:
if
search_str
in
line
:
if
search_str
in
line
:
is_target
=
True
is_target
=
True
continue
continue
if
is_target
and
"@End"
in
line
:
if
is_target
and
"@End"
in
line
:
is_target
=
False
is_target
=
False
continue
continue
if
is_target
:
if
is_target
:
line
=
line
.
replace
(
"${app_name}"
,
sys
.
argv
[
1
])
line
=
line
.
replace
(
"${app_name}"
,
sys
.
argv
[
1
])
line
=
setAdress
(
line
)
line
=
setAdress
(
line
)
if
len
(
line
)
>
0
:
if
len
(
line
)
>
0
:
f_w
.
write
(
line
)
f_w
.
write
(
line
)
def
create_config
(
read_path
,
write_path
):
def
create_config
(
read_path
,
write_path
):
with
open
(
read_path
,
"r"
)
as
f
:
with
open
(
read_path
,
"r"
)
as
f
:
lines
=
f
.
readlines
()
lines
=
f
.
readlines
()
with
open
(
write_path
,
"w"
)
as
f_w
:
with
open
(
write_path
,
"w"
)
as
f_w
:
for
line
in
lines
:
for
line
in
lines
:
line
=
line
.
replace
(
"${app_name}"
,
sys
.
argv
[
1
])
\
line
=
line
.
replace
(
"${app_name}"
,
sys
.
argv
[
1
])
\
.
replace
(
"${desc}"
,
sys
.
argv
[
5
]
+
"_desc.txt"
)
\
.
replace
(
"${desc}"
,
sys
.
argv
[
5
]
+
"_desc.txt"
)
\
.
replace
(
"${privacy_url}"
,
sys
.
argv
[
6
]
+
"?name="
+
sys
.
argv
[
1
]
.
replace
(
" "
,
"
%20
"
))
\
.
replace
(
"${privacy_url}"
,
sys
.
argv
[
6
]
+
"?name="
+
sys
.
argv
[
1
]
.
replace
(
" "
,
"
%20
"
))
\
.
replace
(
"${website}"
,
""
)
.
replace
(
"${website}"
,
""
)
# .replace("${website}",sys.argv[7])
# .replace("${website}",sys.argv[7])
f_w
.
write
(
line
)
f_w
.
write
(
line
)
output
=
"/Users/connor/Documents/apks/"
+
sys
.
argv
[
5
]
+
"_"
+
sys
.
argv
[
1
];
output
=
"/Users/connor/Documents/apks/"
+
sys
.
argv
[
5
]
+
"_"
+
sys
.
argv
[
1
];
if
not
os
.
path
.
exists
(
output
):
if
not
os
.
path
.
exists
(
output
):
os
.
makedirs
(
output
)
os
.
makedirs
(
output
)
create_desc
(
"/Users/connor/StudioProjects/WorkSpace/app_desc.txt"
,
output
+
"/"
+
sys
.
argv
[
5
]
+
"_desc.txt"
)
create_desc
(
"/Users/connor/StudioProjects/WorkSpace/app_desc.txt"
,
output
+
"/"
+
sys
.
argv
[
5
]
+
"_desc.txt"
)
create_config
(
"/Users/connor/StudioProjects/WorkSpace/config.json"
,
output
+
"/config.json"
)
create_config
(
"/Users/connor/StudioProjects/WorkSpace/config.json"
,
output
+
"/config.json"
)
\ No newline at end of file
script/script_help.sh
View file @
5d9fd89b
...
@@ -269,7 +269,13 @@ elif (($commod == '26'));then
...
@@ -269,7 +269,13 @@ elif (($commod == '26'));then
echo
"官网:
${
home
}
"
echo
"官网:
${
home
}
"
echo
" "
echo
" "
cd
print
cd
print
python create_desc.py
"
${
app_name
}
"
"
${
cus_email
}
"
"
${
hot_line
}
"
"
${
cus_adress
}
"
"
${
corp_id
}
"
"
${
home
}
/privacy.html"
"
${
home
}
"
code
=
${
desc_code
}
if
[[
!
${
code
}
]]
;
then
code
=
-1
fi
python create_desc.py
"
${
app_name
}
"
"
${
cus_email
}
"
"
${
hot_line
}
"
"
${
cus_adress
}
"
"
${
corp_id
}
"
"
${
home
}
/privacy.html"
"
${
home
}
"
${
code
}
echo
" "
echo
" "
file_name
=
"
${
corp_id
}
_
${
app_name
}
"
file_name
=
"
${
corp_id
}
_
${
app_name
}
"
mv /Users/connor/Documents/apks/
"
${
file_name
}
.apk"
/Users/connor/Documents/apks/
"
${
file_name
}
/app.apk"
mv /Users/connor/Documents/apks/
"
${
file_name
}
.apk"
/Users/connor/Documents/apks/
"
${
file_name
}
/app.apk"
...
@@ -281,4 +287,4 @@ then
...
@@ -281,4 +287,4 @@ then
else
else
echo
"找不到编号"
echo
"找不到编号"
fi
fi
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment