Mercurial > repos > greg > icqsol_compose_shapes
comparison icqsol_utils.py @ 5:ba13195a3e24 draft
Uploaded
| author | greg |
|---|---|
| date | Sat, 05 Dec 2015 10:27:48 -0500 |
| parents | d35e68ba13b4 |
| children | b509c887aea8 |
comparison
equal
deleted
inserted
replaced
| 4:d35e68ba13b4 | 5:ba13195a3e24 |
|---|---|
| 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 |
