summaryrefslogtreecommitdiff
path: root/stwcs/gui/extract_headerlet.py
diff options
context:
space:
mode:
Diffstat (limited to 'stwcs/gui/extract_headerlet.py')
-rw-r--r--stwcs/gui/extract_headerlet.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/stwcs/gui/extract_headerlet.py b/stwcs/gui/extract_headerlet.py
index 02ecd7a..1e88221 100644
--- a/stwcs/gui/extract_headerlet.py
+++ b/stwcs/gui/extract_headerlet.py
@@ -1,14 +1,14 @@
-from __future__ import print_function
+from __future__ import absolute_import, division, print_function
+
import os
from stsci.tools import teal
-
-import stwcs
-from stwcs.wcsutil import headerlet
+from .. import __version__
+from ..wcsutil import headerlet
__taskname__ = __name__.split('.')[-1] # needed for help string
__package__ = headerlet.__name__
-__version__ = stwcs.__version__
+# __version__ = stwcs.__version__
#
#### Interfaces used by TEAL
#
@@ -17,28 +17,29 @@ def getHelpAsString(docstring=False):
return useful help from a file in the script directory called __taskname__.help
"""
install_dir = os.path.dirname(__file__)
- htmlfile = os.path.join(install_dir,'htmlhelp',__taskname__+'.html')
- helpfile = os.path.join(install_dir,__taskname__+'.help')
+ htmlfile = os.path.join(install_dir, 'htmlhelp', __taskname__ + '.html')
+ helpfile = os.path.join(install_dir, __taskname__ + '.help')
if docstring or (not docstring and not os.path.exists(htmlfile)):
- helpString = __taskname__+' Version '+__version__+'\n\n'
+ helpString = __taskname__ + ' Version ' + __version__ + '\n\n'
if os.path.exists(helpfile):
- helpString += teal.getHelpFileAsString(__taskname__,__file__)
+ helpString += teal.getHelpFileAsString(__taskname__, __file__)
else:
- helpString += eval('.'.join([__package__,__taskname__,'__doc__']))
+ helpString += eval('.'.join([__package__, __taskname__, '__doc__']))
else:
- helpString = 'file://'+htmlfile
+ helpString = 'file://' + htmlfile
return helpString
+
def run(configObj=None):
- if configObj['output'] in ['',' ',None]:
- print('='*60)
+ 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)
return
# create dictionary of remaining parameters, deleting extraneous ones
@@ -55,4 +56,3 @@ def run(configObj=None):
# clobber=False, verbose=100)
headerlet.extract_headerlet(configObj['filename'], configObj['output'],
**cdict)
-