-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert_main.py
48 lines (38 loc) · 1.08 KB
/
convert_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
36
37
38
39
40
41
42
43
44
45
46
47
48
# coding: utf-8
import appinfo
from os import path
import sys
from xls2expressionmap import constants
from xls2expressionmap import convert
from xls2expressionmap.expressionmap import template
from xls2expressionmap.xlsx import xlsutil
def usage():
print(
"""
XLS2ExpressionMap {version}
2017 (c) {author}
{url}
usage:
XLS2ExpressionMap <input file> [<input file>] ...
[parameter]
<input file>: xlsx file path
""".format( version=appinfo.VERSION, author=appinfo.AUTHOR, url=appinfo.URL )
)
def main():
if( len( sys.argv ) < 2 ):
usage()
return
# Checking: xlsx files exist
for i in sys.argv[1:]:
if( path.exists( i ) == False ):
usage()
return
for i in sys.argv[1:]:
print( "#------------------------------------------" )
print( "# {i}".format( i = i ) )
print( "#------------------------------------------" )
outputDir = path.dirname( i )
p = convert.XLS2ExpressionMap( xlsxFileName = i, outputDir = outputDir )
p.convert()
if __name__ == '__main__':
main()