-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuiToXbase.py
More file actions
29 lines (28 loc) · 1.12 KB
/
Copy pathuiToXbase.py
File metadata and controls
29 lines (28 loc) · 1.12 KB
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
"""The inteface script for parsing."""
__author__ = "Martin Lacayo-Emery <popanalyst@gmail.com>"
import sys
if __name__=="__main__":
inName=sys.argv[1]
conversionType=sys.argv[2]
outName=sys.argv[3]
if sys.argv[4]=="true":
dynamicSpecs=True
else:
dynamicSpecs=False
if conversionType=="Tab Separated Values (TSV)":
#add absolute path for shapefile library (relative to file import)
sys.path.append(sys.argv[0][:sys.argv[0].rfind("\\")+1]+"\\lib\\shp")
import databasefile
dbf=databasefile.DatabaseFile([],[],[])
dbf.readTSV(inName)
if dynamicSpecs:
dbf.dynamicSpecs()
dbf.writeFile(outName)
elif conversionType=="Tobii TSV with Header":
import lib.pop.tobiiDBF
lib.pop.tobiiDBF.tobiiParseFile(inName,outName,dynamicSpecs)
elif conversionType=="SMI TSV with Multiple Areas of Interest":
import lib.pop.animeyeDBF
lib.pop.animeyeDBF.animeyeParse(inName,outName,dynamicSpecs,multipleAOIs)
else:
raise ValueError, conversionType + " is not a defined format."