Mercurial > repos > greg > icqsol_rotate_shape
comparison icqsol_utils.py @ 1:41bc84dbe8ae draft
Uploaded
| author | greg |
|---|---|
| date | Sat, 05 Dec 2015 10:29:57 -0500 |
| parents | e778cabd999c |
| children | 7598b7336e58 |
comparison
equal
deleted
inserted
replaced
| 0:e778cabd999c | 1:41bc84dbe8ae |
|---|---|
| 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 |
