Commit 49f33c3b authored by xuezj's avatar xuezj

支持python2.7.5

parent e30d723b
# 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()
......
......@@ -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
......
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