Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qg-dockerfiles
Commits
49f33c3b
Commit
49f33c3b
authored
Nov 15, 2018
by
xuezj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持python2.7.5
parent
e30d723b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
replace.py
templates/lua-ui/replace.py
+5
-4
replace_config.yaml
templates/lua-ui/replace_config.yaml
+1
-1
No files found.
templates/lua-ui/replace.py
View file @
49f33c3b
# coding=UTF-8
from
__future__
import
print_function
import
io
import
yaml
import
fileinput
import
os
...
...
@@ -5,7 +8,7 @@ import os.path
import
re
import
copy
f
=
open
(
'replace_config.yaml
'
,
encoding
=
'utf-8'
)
f
=
io
.
open
(
'replace_config.yaml'
,
'r
'
,
encoding
=
'utf-8'
)
res
=
yaml
.
load
(
f
)
print
(
"全部配置信息:"
,
res
)
...
...
@@ -35,11 +38,9 @@ def findFile (dir):
# 过滤符合要求的文件路径
findFile
(
distPath
)
# print(files)
# 替换文件中的内容
for
file
in
files
:
# print(file)
for
line
in
fileinput
.
input
(
file
,
inplace
=
1
):
for
item
in
config
:
if
not
config
[
item
]:
...
...
@@ -52,7 +53,7 @@ for file in files:
if
rule
[
'reg'
]:
p
=
re
.
compile
(
r''
+
rule
[
'reg'
])
line
=
re
.
sub
(
p
,
rule
[
'to'
],
line
)
print
(
line
,
end
=
''
)
fileinput
.
close
()
...
...
templates/lua-ui/replace_config.yaml
View file @
49f33c3b
...
...
@@ -21,7 +21,7 @@ qgApiRule: &qgApiRule
useNamespace
:
true
# todo: 看哪个项目需要
h5AuthRule
:
@
h5AuthRule
h5AuthRule
:
&
h5AuthRule
reg
:
'
h5.auth.quantgroup.cn'
to
:
'
operator.liangkebang.com'
# todo: quantgroup.cn
...
...
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