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
36e3d3cb
Commit
36e3d3cb
authored
Apr 21, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script
parent
a712c90c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
script/code/move_buildconfig.py
+22
-4
No files found.
script/code/move_buildconfig.py
View file @
36e3d3cb
...
@@ -7,11 +7,20 @@ import sys
...
@@ -7,11 +7,20 @@ import sys
def
getResValue
(
line
):
def
getResValue
(
line
):
return
line
.
split
(
","
)[
2
]
.
replace
(
"'"
,
""
)
.
replace
(
" "
,
""
)
.
replace
(
")"
,
""
)
.
replace
(
"'
\n
"
,
""
)
return
line
.
split
(
","
)[
2
]
.
replace
(
"
\\\"
"
,
""
)
.
replace
(
"
'"
,
""
)
.
replace
(
" "
,
""
)
.
replace
(
")"
,
""
)
.
replace
(
"'
\n
"
,
""
)
def
addToProperties
(
line
):
def
addToProperties
(
line
):
os
.
system
(
"./update_properties.py "
+
line
)
os
.
system
(
"./update_properties.py "
+
line
)
def
getStringFiled
(
key
,
value
):
return
"
\t\t\t
buildConfigField 'String', '"
+
key
+
"', "
+
value
+
"+
\n
"
def
getColorRes
(
key
,
value
):
return
"
\t\t\t
resValue('color', '"
+
key
+
"', "
+
value
+
"
\n
"
def
getStringRes
(
key
,
value
):
return
"
\t\t\t
resValue('string', '"
+
key
+
"', "
+
value
+
"
\n
"
def
move_config
(
path
):
def
move_config
(
path
):
# print("processing content: %s..." % path)
# print("processing content: %s..." % path)
with
open
(
path
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
with
open
(
path
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
...
@@ -27,16 +36,25 @@ def move_config(path):
...
@@ -27,16 +36,25 @@ def move_config(path):
if
move_finished
>
1
:
if
move_finished
>
1
:
break
break
if
"app_name_str"
in
line
:
addToProperties
(
"app_name="
+
getResValue
(
line
))
line
=
getStringRes
(
"app_name_str"
,
"
\"
${app_name}
\"
"
)
if
"LANGUAGE"
in
line
:
if
"LANGUAGE"
in
line
:
if
"//"
in
line
:
if
line
.
startswith
(
"//"
)
:
line
=
""
line
=
""
else
:
else
:
addToProperties
(
"language="
+
getResValue
(
line
))
addToProperties
(
"language="
+
getResValue
(
line
))
line
=
"
\t\t\t
resValue('color', 'main_color',
\"
${language}
\"
)
\n
"
line
=
getStringFiled
(
"LANGUAGE"
,
"
\"
${language}
\"
"
)
if
"'color', 'main_color'"
in
line
:
if
"'color', 'main_color'"
in
line
:
addToProperties
(
"main_color="
+
getResValue
(
line
))
addToProperties
(
"main_color="
+
getResValue
(
line
))
line
=
"
\t\t\t
resValue('color', 'main_color',
\"
${main_color}
\"
)
\n
"
line
=
getColorRes
(
"main_color"
,
"
\"
${main_color}
\"
"
)
if
"'color', 'main_text_color'"
in
line
:
addToProperties
(
"main_text_color="
+
getResValue
(
line
))
line
=
getColorRes
(
"main_text_color"
,
"
\"
${main_text_color}
\"
"
)
f_w
.
write
(
line
)
f_w
.
write
(
line
)
return
return
...
...
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