Mercurial > repos > greg > icqsol_create_shape
changeset 6:cda30ae2e9d7 draft
Uploaded
author | greg |
---|---|
date | Wed, 09 Dec 2015 11:01:10 -0500 |
parents | cb3e79d1e85e |
children | 8df65e37d12a |
files | icqsol_utils.py |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/icqsol_utils.py Sat Dec 05 10:28:42 2015 -0500 +++ b/icqsol_utils.py Wed Dec 09 11:01:10 2015 -0500 @@ -2,7 +2,9 @@ import sys import tempfile +PLY = 'ply' POLYDATA = 'POLYDATA' +VTK = 'vtk' def asbool(val): @@ -14,9 +16,9 @@ format = None datatype = None if galaxy_ext in ['vtkascii', 'vtkbinary']: - format = 'vtk' + format = VTK elif galaxy_ext in ['plyascii', 'plybinary']: - format = 'ply' + format = PLY if galaxy_ext in ['vtkascii', 'plyascii']: datatype = 'ascii' elif galaxy_ext in ['vtkbinary', 'plybinary']: @@ -48,7 +50,13 @@ """ Return a temporary file name. """ - fd, name = tempfile.mkstemp(suffix=suffix, dir=dir) + if suffix is None: + s = None + elif suffix.startswith('.'): + s = suffix + else: + s = '.%s' % suffix + fd, name = tempfile.mkstemp(suffix=s, dir=dir) os.close(fd) return name