diff options
author | bsimon <bsimon@stsci.edu> | 2015-05-04 14:30:51 -0400 |
---|---|---|
committer | bsimon <bsimon@stsci.edu> | 2015-05-04 14:30:51 -0400 |
commit | 354c99daa69a8cc4eff3b081ec2c0cdce9df102c (patch) | |
tree | 16cd6d316dc1892952726e6aa5eb5abbad94ce5d /lib/stwcs/gui | |
parent | a750294506fb6270c44b791928ab8d5630a22ca2 (diff) | |
download | stwcs_hcf-354c99daa69a8cc4eff3b081ec2c0cdce9df102c.tar.gz |
Updated files to run under python 2 and 3
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@39775 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/gui')
-rw-r--r-- | lib/stwcs/gui/__init__.py | 20 | ||||
-rw-r--r-- | lib/stwcs/gui/archive_headerlet.py | 11 | ||||
-rw-r--r-- | lib/stwcs/gui/delete_headerlet.py | 11 | ||||
-rw-r--r-- | lib/stwcs/gui/extract_headerlet.py | 11 | ||||
-rw-r--r-- | lib/stwcs/gui/updatewcs.py | 3 | ||||
-rw-r--r-- | lib/stwcs/gui/write_headerlet.py | 21 |
6 files changed, 41 insertions, 36 deletions
diff --git a/lib/stwcs/gui/__init__.py b/lib/stwcs/gui/__init__.py index 559d361..cd21bf6 100644 --- a/lib/stwcs/gui/__init__.py +++ b/lib/stwcs/gui/__init__.py @@ -4,16 +4,16 @@ This package defines the TEAL interfaces for public, file-based operations provided by the STWCS package. """ -from __future__ import division # confidence high +from __future__ import absolute_import # confidence high __docformat__ = 'restructuredtext' # import modules which define the TEAL interfaces -import write_headerlet -import extract_headerlet -import attach_headerlet -import delete_headerlet -import headerlet_summary -import archive_headerlet -import restore_headerlet -import apply_headerlet -import updatewcs +from . import write_headerlet +from . import extract_headerlet +from . import attach_headerlet +from . import delete_headerlet +from . import headerlet_summary +from . import archive_headerlet +from . import restore_headerlet +from . import apply_headerlet +from . import updatewcs diff --git a/lib/stwcs/gui/archive_headerlet.py b/lib/stwcs/gui/archive_headerlet.py index 70dbc89..3cc29e3 100644 --- a/lib/stwcs/gui/archive_headerlet.py +++ b/lib/stwcs/gui/archive_headerlet.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os import string @@ -35,11 +36,11 @@ def getHelpAsString(docstring=False): def run(configObj=None): if configObj['hdrname'] in ['',' ','INDEF']: - print '='*60 - print 'ERROR:' - print ' No valid "hdrname" parameter value provided!' - print ' Please restart this task and provide a value for this parameter.' - print '='*60 + print('='*60) + print('ERROR:') + print(' No valid "hdrname" 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', diff --git a/lib/stwcs/gui/delete_headerlet.py b/lib/stwcs/gui/delete_headerlet.py index 96d3ed1..b3df5a7 100644 --- a/lib/stwcs/gui/delete_headerlet.py +++ b/lib/stwcs/gui/delete_headerlet.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os from stsci.tools import teal @@ -34,11 +35,11 @@ def run(configObj=None): if configObj['hdrname'] == '' and configObj['hdrext'] is None and \ configObj['distname'] == '': - print '='*60 - print 'ERROR:' - print ' No valid "hdrname", "hdrext" or "distname" parameter value provided!' - print ' Please restart this task and provide a value for one of these parameters.' - print '='*60 + print('='*60) + print('ERROR:') + print(' No valid "hdrname", "hdrext" or "distname" parameter value provided!') + print(' Please restart this task and provide a value for one of these parameters.') + print('='*60) return filename = parseinput.parseinput(configObj['filename'])[0] # Call function with properly interpreted input parameters diff --git a/lib/stwcs/gui/extract_headerlet.py b/lib/stwcs/gui/extract_headerlet.py index 972f5c7..02ecd7a 100644 --- a/lib/stwcs/gui/extract_headerlet.py +++ b/lib/stwcs/gui/extract_headerlet.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os from stsci.tools import teal @@ -33,11 +34,11 @@ def getHelpAsString(docstring=False): def run(configObj=None): if configObj['output'] in ['',' ',None]: - 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 + 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 # create dictionary of remaining parameters, deleting extraneous ones diff --git a/lib/stwcs/gui/updatewcs.py b/lib/stwcs/gui/updatewcs.py index f8f10d7..3dacb67 100644 --- a/lib/stwcs/gui/updatewcs.py +++ b/lib/stwcs/gui/updatewcs.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os from astropy.io import fits @@ -68,7 +69,7 @@ def run(configObj=None): # Check to insure that there is a valid reference file to be used idctab = fits.getval(file, 'idctab') if not os.path.exists(fileutil.osfn(idctab)): - print 'No valid distortion reference file ',idctab,' found in ',file,'!' + print('No valid distortion reference file ',idctab,' found in ',file,'!') raise ValueError # Re-define 'cdict' to only have switches for steps supported by that instrument diff --git a/lib/stwcs/gui/write_headerlet.py b/lib/stwcs/gui/write_headerlet.py index 353e32b..e18bed8 100644 --- a/lib/stwcs/gui/write_headerlet.py +++ b/lib/stwcs/gui/write_headerlet.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os from stsci.tools import teal @@ -34,19 +35,19 @@ def getHelpAsString(docstring=False): def run(configObj=None): flist,oname = parseinput.parseinput(configObj['filename']) if len(flist) == 0: - print '='*60 - print 'ERROR:' - print ' No valid "filename" parameter value provided!' - print ' Please check the working directory and restart this task.' - print '='*60 + print('='*60) + print('ERROR:') + print(' No valid "filename" parameter value provided!') + print(' Please check the working directory and restart this task.') + print('='*60) return if configObj['hdrname'] in ['',' ','INDEF']: - print '='*60 - print 'ERROR:' - print ' No valid "hdrname" parameter value provided!' - print ' Please restart this task and provide a value for this parameter.' - print '='*60 + print('='*60) + print('ERROR:') + print(' No valid "hdrname" parameter value provided!') + print(' Please restart this task and provide a value for this parameter.') + print('='*60) return if configObj['output'] in ['',' ','INDEF']: |