-
Notifications
You must be signed in to change notification settings - Fork 11
/
r1_gen_mapfile.py
44 lines (32 loc) · 1.04 KB
/
r1_gen_mapfile.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
# -*- coding: utf-8 -*-
'''
Running with python3, with markdown module.
'''
import os
import subprocess
from pathlib import Path
# if os.path.exists('./owg/ms_tmp'):
# pass
# else:
# os.makedirs('./owg/ms_tmp')
############################################################
def run_it(src_ws):
for wfile in src_ws.rglob('*'):
if wfile.name == 'script_mapfile_pub.sh':
print(wfile)
# os.chdir(wfile.parent)
subprocess.run('sh script_mapfile_pub.sh', shell=True, cwd = wfile.parent)
for wfile in src_ws.rglob('*'):
if wfile.name == 'script_gen_diff.py':
print(wfile)
# os.chdir(wfile.parent)
subprocess.run('python3 script_gen_diff.py', shell=True, cwd = wfile.parent)
if __name__ == '__main__':
# pwd = os.path.abspath(os.path.split(__file__)[0])
# src_ws = Path(os.path.join(pwd, 'templates'))
# run_it(src_ws)
src_ws = Path( 'webgis-src')
if src_ws.exists():
run_it(src_ws)
else:
print('The directory not exists.')