-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.py
35 lines (32 loc) · 1.19 KB
/
main.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
from modules import promethee_sort, promethee_calculate
import sys, os
def main():
if '-sort' in sys.argv:
promethee_sort.sort(sys.argv[1:])
elif '-reverse' in sys.argv:
promethee_sort.unsort(sys.argv[1:])
elif '-fp' in sys.argv:
promethee_sort.sort(sys.argv[1:])
promethee_calculate.calculate(sys.argv[1:])
param = []
param.append('-reverse')
os.system('mv out.* result_' + sys.argv[2])
param.append('result_' + sys.argv[2])
param.append('positions.tif')
for i in xrange(3, len(sys.argv)):
param.append(sys.argv[i])
promethee_sort.unsort(param)
os.system("rm *values*.tif")
os.system("rm *positions*.tif")
elif '-merge' in sys.argv:
exists = os.path.isfile('caja/playground/src/merge')
if not exists:
os.system("g++ caja/playground/src/merge.cpp -o caja/playground/src/merge -std=c++14 -ltiff")
os.system(' '.join(['./caja/playground/src/merge'] + list(sys.argv[2:])))
else:
promethee_calculate.calculate(sys.argv[1:])
if __name__ == '__main__':
exists = os.path.isfile('run')
if not exists:
os.system("make")
main()