-
Notifications
You must be signed in to change notification settings - Fork 2
/
init_config_prop.py
executable file
·51 lines (39 loc) · 1.63 KB
/
init_config_prop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 *-*
import os
import argparse
def main(args):
with open(args.config_prop_file) as rf:
config_prop_lines = [line.strip() for line in rf.readlines()]
# Line 9
config_prop_lines[8] = config_prop_lines[8].split('=')[0] + '=' + os.path.join(args.dst, '2019AB', 'META')
# Line 17
config_prop_lines[16] = config_prop_lines[16].split('=')[0] + '=' + os.path.join(args.dst, '2019AB', 'META')
# Line 19
config_prop_lines[18] = config_prop_lines[18].split('=')[0] + '=' + os.path.join(args.src, 'config', '2019AB', 'user.c.prop')
# Line 25
config_prop_lines[24] = config_prop_lines[24].split('=')[0] + '=' + args.src
# Line 32
config_prop_lines[31] = config_prop_lines[31].split('=')[0] + '=' + args.dst
# Line 38
config_prop_lines[37] = config_prop_lines[37].split('=')[0] + '=' + args.src
with open(args.config_prop_file, 'w') as wf:
for line in config_prop_lines:
wf.write(line + '\n')
if __name__=="__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--config_prop_file", action="store", required=True, type=str,
help="Path to config.prop file."
)
parser.add_argument(
"--src", action="store", required=True, type=str,
help="Metamorphosys installation source path."
)
parser.add_argument(
"--dst", action="store", required=True, type=str,
help="Metamorphosys installation destination path."
)
args = parser.parse_args()
import pprint
pprint.pprint(vars(args))
main(args)