comparison icqsol_utils.py @ 1:b18f4c1c852d draft

Uploaded
author greg
date Sat, 05 Dec 2015 10:31:03 -0500
parents 0e26a1b31cac
children 5a220d650949
comparison
equal deleted inserted replaced
0:0e26a1b31cac 1:b18f4c1c852d
1 import os 1 import os
2 import sys 2 import sys
3 import tempfile 3 import tempfile
4 4
5 PLY = 'ply'
5 POLYDATA = 'POLYDATA' 6 POLYDATA = 'POLYDATA'
7 VTK = 'vtk'
6 8
7 9
8 def asbool(val): 10 def asbool(val):
9 return str(val).lower() in ['yes', 'true'] 11 return str(val).lower() in ['yes', 'true']
10 12
12 def get_format_and_type(galaxy_ext): 14 def get_format_and_type(galaxy_ext):
13 # Define the output file format and type. 15 # Define the output file format and type.
14 format = None 16 format = None
15 datatype = None 17 datatype = None
16 if galaxy_ext in ['vtkascii', 'vtkbinary']: 18 if galaxy_ext in ['vtkascii', 'vtkbinary']:
17 format = 'vtk' 19 format = VTK
18 elif galaxy_ext in ['plyascii', 'plybinary']: 20 elif galaxy_ext in ['plyascii', 'plybinary']:
19 format = 'ply' 21 format = PLY
20 if galaxy_ext in ['vtkascii', 'plyascii']: 22 if galaxy_ext in ['vtkascii', 'plyascii']:
21 datatype = 'ascii' 23 datatype = 'ascii'
22 elif galaxy_ext in ['vtkbinary', 'plybinary']: 24 elif galaxy_ext in ['vtkbinary', 'plybinary']:
23 datatype = 'binary' 25 datatype = 'binary'
24 return format, datatype 26 return format, datatype