From d372728784f465dcd451fe9b690f8574f7ec77c2 Mon Sep 17 00:00:00 2001 From: hack Date: Mon, 7 Nov 2011 15:36:24 +0000 Subject: This revision fixes a number of bugs; including: - added a check to 'output' par value in TEAL interface to 'write_headerlet' - implemented use of 'parseinput' in TEAL interface for 'write_headerlet' - moved 'output' and 'clobber' parameters closer to top of par list in TEAL interface for 'write_headerlet' - implemented use of 'parseinput' to interpret input filename(s) for 'write_headerlet' and 'extract_headerlet' providing support for additional input modes - fixed logic problems with defining output filename in 'write_headerlet' and 'extract_headerlet' git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13964 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/gui/write_headerlet.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/stwcs/gui/write_headerlet.py') diff --git a/lib/stwcs/gui/write_headerlet.py b/lib/stwcs/gui/write_headerlet.py index 2072d2e..1debcf6 100644 --- a/lib/stwcs/gui/write_headerlet.py +++ b/lib/stwcs/gui/write_headerlet.py @@ -2,6 +2,7 @@ import os import pyfits from stsci.tools import teal +from stsci.tools import parseinput import stwcs from stwcs.wcsutil import headerlet @@ -32,7 +33,8 @@ def getHelpAsString(docstring=False): return helpString def run(configObj=None): - if not os.path.exists(configObj['filename']): + flist,oname = parseinput.parseinput(configObj['filename']) + if len(flist) == 0: print '='*60 print 'ERROR:' print ' No valid "filename" parameter value provided!' @@ -47,7 +49,16 @@ def run(configObj=None): print ' Please restart this task and provide a value for this parameter.' print '='*60 return - + + if configObj['output'] in ['',' ','INDEF']: + print '='*60 + print 'ERROR:' + print ' No valid "output" parameter value provided!' + print ' Please restart this task and provide a value for this parameter.' + print '='*60 + return + + str_kw = ['wcsname','destim','sipname','npolfile','d2imfile', 'descrip','history','author','output'] @@ -71,5 +82,5 @@ def run(configObj=None): # sipname=None, npolfile=None, d2imfile=None, # author=None, descrip=None, history=None, # attach=True, clobber=False) - headerlet.write_headerlet(configObj['filename'], configObj['hdrname'], + headerlet.write_headerlet(flist, configObj['hdrname'], **cdict) \ No newline at end of file -- cgit