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
a712c90c
Commit
a712c90c
authored
Apr 21, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script
parent
8a6d859d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
script/code/move_buildconfig.py
+15
-2
script/code/update_properties.py
+3
-2
No files found.
script/code/move_buildconfig.py
View file @
a712c90c
...
...
@@ -6,6 +6,12 @@ import glob, os
import
sys
def
getResValue
(
line
):
return
line
.
split
(
","
)[
2
]
.
replace
(
"'"
,
""
)
.
replace
(
" "
,
""
)
.
replace
(
")"
,
""
)
.
replace
(
"'
\n
"
,
""
)
def
addToProperties
(
line
):
os
.
system
(
"./update_properties.py "
+
line
)
def
move_config
(
path
):
# print("processing content: %s..." % path)
with
open
(
path
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
...
...
@@ -21,9 +27,16 @@ def move_config(path):
if
move_finished
>
1
:
break
if
"LANGUAGE"
in
line
:
if
"//"
in
line
:
line
=
""
else
:
addToProperties
(
"language="
+
getResValue
(
line
))
line
=
"
\t\t\t
resValue('color', 'main_color',
\"
${language}
\"
)
\n
"
if
"'color', 'main_color'"
in
line
:
color
=
line
.
split
(
","
)
.
replace
(
"'"
,
""
)
.
replace
(
" "
,
""
)
.
replace
(
")"
,
""
)
.
replace
(
"'
\n
"
,
""
)
line
=
line
.
replace
(
"resValue('color', 'main_color',
\"
${main_color}
\"
)
\n
"
)
addToProperties
(
"main_color="
+
getResValue
(
line
)
)
line
=
"
\t\t\t
resValue('color', 'main_color',
\"
${main_color}
\"
)
\n
"
f_w
.
write
(
line
)
return
...
...
script/code/update_properties.py
View file @
a712c90c
...
...
@@ -14,7 +14,7 @@ with open(path, "r", encoding="utf-8") as f:
with
open
(
path
,
"w"
,
encoding
=
"utf-8"
)
as
f_w
:
for
line
in
lines
:
if
code
in
line
:
line
=
"
"
if
"
org.gradle.jvmargs
"
in
line
:
line
=
"
#"
+
line
if
"
#MARK-END
"
in
line
:
line
=
code
+
"
\n
"
+
line
f_w
.
write
(
line
)
\ 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