Commit 27d6ad80 authored by Ole Streicher's avatar Ole Streicher

New upstream version 2.1.14

parent eef79e3c
Metadata-Version: 1.1
Name: pyraf
Version: 2.1.11
Version: 2.1.14
Summary: Provides a Pythonic interface to IRAF that can be used in place of the existing IRAF CL
Home-page: http://www.stsci.edu/resources/software_hardware/pyraf
Author: Rick White, Perry Greenfield, Chris Sontag
......
Metadata-Version: 1.1
Name: pyraf
Version: 2.1.11
Version: 2.1.14
Summary: Provides a Pythonic interface to IRAF that can be used in place of the existing IRAF CL
Home-page: http://www.stsci.edu/resources/software_hardware/pyraf
Author: Rick White, Perry Greenfield, Chris Sontag
......
......@@ -877,8 +877,8 @@ required_pkgs/stsci.tools/.git/info/exclude
required_pkgs/stsci.tools/.git/logs/HEAD
required_pkgs/stsci.tools/.git/logs/refs/heads/master
required_pkgs/stsci.tools/.git/logs/refs/remotes/origin/HEAD
required_pkgs/stsci.tools/.git/objects/pack/pack-f16c85e988faf4e46fed9152d17fa03613bd4092.idx
required_pkgs/stsci.tools/.git/objects/pack/pack-f16c85e988faf4e46fed9152d17fa03613bd4092.pack
required_pkgs/stsci.tools/.git/objects/pack/pack-1e95cbf712e2ce2d21907be57218df52eafb174c.idx
required_pkgs/stsci.tools/.git/objects/pack/pack-1e95cbf712e2ce2d21907be57218df52eafb174c.pack
required_pkgs/stsci.tools/.git/refs/heads/master
required_pkgs/stsci.tools/.git/refs/remotes/origin/HEAD
required_pkgs/stsci.tools/doc/Makefile
......
......@@ -7,7 +7,7 @@ $Id$
from __future__ import division # confidence high
import math, sys, numpy, os
import Tkinter as Tki
import Tkinter as TKNTR
import matplotlib
# (done in mca file) matplotlib.use('TkAgg') # set backend
from matplotlib.lines import Line2D
......@@ -63,8 +63,8 @@ class GkiMplKernel(gkitkbase.GkiInteractiveTkBase):
def makeGWidget(self, width=600, height=420):
"""Make the graphics widget. Also perform some self init."""
self.__pf = Tki.Frame(self.top)
self.__pf.pack(side=Tki.TOP, fill=Tki.BOTH, expand=1)
self.__pf = TKNTR.Frame(self.top)
self.__pf.pack(side=TKNTR.TOP, fill=TKNTR.BOTH, expand=1)
self.__xsz = width
self.__ysz = height
......@@ -74,7 +74,7 @@ class GkiMplKernel(gkitkbase.GkiInteractiveTkBase):
self.__fig.set_facecolor('k') # default to black
self.__mca = mca.MplCanvasAdapter(self, self.__fig, master=self.__pf)
self.__mca.pack(side=Tki.TOP, fill=Tki.BOTH, expand=1)
self.__mca.pack(side=TKNTR.TOP, fill=TKNTR.BOTH, expand=1)
self.__mca.gwidgetize(width, height) # Add attrs to the gwidget
self.gwidget = self.__mca.get_tk_widget()
......@@ -727,7 +727,7 @@ class tkColorManager:
def setDrawingColor(self, irafColorIndex):
"""Return the specified iraf color usable by Tkinter"""
"""Return the specified iraf color usable by tkinter"""
color = self.config.defaultColors[irafColorIndex]
red = int(255*color[0])
green = int(255*color[1])
......
......@@ -7,7 +7,6 @@ $Id$
from __future__ import division # confidence high
import os, matplotlib
import Tkinter as Tki
matplotlib.use('TkAgg') # set backend
import matplotlib.backends.backend_tkagg as tkagg
from Ptkplot import hideTkCursor
......
......@@ -8,7 +8,7 @@ $Id$
from __future__ import division # confidence high
import os
from Tkinter import _default_root
from Tkinter import _default_root # requires 2to3
from Tkinter import *
import wutil
import sys, time
......@@ -26,17 +26,8 @@ del dirname
_TK_HAS_NONE_CURSOR = True # assume True until we learn otherwise
if _default_root is None:
# create the initial Tk window and immediately withdraw it
import Tkinter
if not Tkinter._default_root:
_default_root = Tkinter.Tk()
else:
_default_root = Tkinter._default_root
_default_root.withdraw()
try:
del Tkinter
except NameError: # for PY3K situation, in case the 2to3 tool
del tkinter # didn't rename it correctly 2 lines above this one
from stsci.tools import irafutils
_default_root = irafutils.init_tk_default_root()
# This code is needed to avoid faults on sys.exit()
# [DAA, Jan 1998]
......@@ -44,13 +35,13 @@ if _default_root is None:
def cleanup():
try:
from Tkinter import _default_root, TclError
import Tkinter
from Tkinter import _default_root, TclError # requires 2to3
import Tkinter as TKNTR
try:
if _default_root: _default_root.destroy()
except TclError:
pass
Tkinter._default_root = None
TKNTR._default_root = None
except SystemError:
# If cleanup() is called before pyraf fully loads, we will
# see: "SystemError: Parent module 'pyraf' not loaded". In that case,
......@@ -254,7 +245,7 @@ class PyrafCanvas(Canvas):
class FullWindowCursor:
"""This implements a full window crosshair cursor. This class can
operate in the xutil-wrapping mode or in a Tkinter-only mode. """
operate in the xutil-wrapping mode or in a tkinter-only mode. """
# Perhaps this should inherit from an abstract Cursor class eventually
def __init__(self, x, y, window):
......
""" Contains Python routines to do special Aqua (OSX) window manipulations
not possible in Tkinter. In general, an attempt is made to use the Pyobjc
not possible in tkinter. In general, an attempt is made to use the Pyobjc
bridging package so that compiling another C extension is not needed.
$Id$
......@@ -7,7 +7,7 @@ $Id$
from __future__ import division # confidence high
import os, struct, time, Tkinter
import os, struct, time
import objc
import AppKit
from stsci.tools.for2to3 import tobytes
......@@ -181,7 +181,7 @@ def __doPyobjcWinInit():
CGErr = objc._C_INT
INPSN = tobytes('n^{ProcessSerialNumber=LL}')
OUTPSN = tobytes('o^{ProcessSerialNumber=LL}')
OUTPID = tobytes('o^_C_ULNG')
# OUTPID = tobytes('o^_C_ULNG') # invalid as of objc v3.2
WARPSIG = tobytes('v{CGPoint=ff}')
if struct.calcsize("l") > 4: # is 64-bit python
WARPSIG = tobytes('v{CGPoint=dd}')
......@@ -191,14 +191,14 @@ def __doPyobjcWinInit():
# These are public API
( u'GetCurrentProcess', OSErr+OUTPSN),
( u'GetFrontProcess', OSErr+OUTPSN),
( u'GetProcessPID', OSStat+INPSN+OUTPID),
# ( u'GetProcessPID', OSStat+INPSN+OUTPID), # see OUTPID note
( u'SetFrontProcess', OSErr+INPSN),
( u'CGWarpMouseCursorPosition', WARPSIG),
( u'CGMainDisplayID', objc._C_PTR+objc._C_VOID),
( u'CGDisplayPixelsHigh', objc._C_ULNG+objc._C_ULNG),
( u'CGDisplayHideCursor', CGErr+objc._C_ULNG),
( u'CGDisplayShowCursor', CGErr+objc._C_ULNG),
# This is undocumented SPI
# This is undocumented API
( u'CPSSetProcessName', OSErr+INPSN+objc._C_CHARPTR),
( u'CPSEnableForegroundOperation', OSErr+INPSN),
]
......@@ -240,9 +240,9 @@ def __doPyobjcWinInit():
raise Exception("CPSEnableForegroundOperation: "+str(err))
# Get the display's absolute height (pixels).
# The next line assumes the Tkinter root window has already been created
# The next line assumes the tkinter root window has already been created
# (and withdrawn), but it may have not yet been.
# __screenHeight = Tkinter._default_root.winfo_screenheight()
# __screenHeight = tkinter._default_root.winfo_screenheight()
# So, we will use the less-simple but just as viable CoreGraphics funcs.
dispIdPtr = CGMainDisplayID() # no need to keep around?
__screenHeight = CGDisplayPixelsHigh(dispIdPtr)
......
......@@ -8,7 +8,7 @@ from __future__ import division # confidence high
from stsci.tools import capable
if capable.OF_GRAPHICS:
from Tkinter import *
from Tkinter import * # requires 2to3
from tkMessageBox import askokcancel, showwarning, showerror
import os, sys, cStringIO
from stsci.tools import listdlg, eparoption, editpar, irafutils
......
......@@ -5,15 +5,16 @@ $Id$
"""
from __future__ import division # confidence high
import string, os, sys, numpy, Tkinter
import string, os, sys, numpy
import Tkinter as TKNTR
from stsci.tools import irafutils
import wutil
# The following class attempts to emulate the standard IRAF gcursor
# mode of operation. That is to say, it is basically a keyboard driven
# system that uses the same keys that IRAF does for the same purposes.
# The keyboard I/O will use Tkinter event handling instead of terminal
# I/O primarily because it is simpler and it is necessary to use Tkinter
# The keyboard I/O will use tkinter event handling instead of terminal
# I/O primarily because it is simpler and it is necessary to use tkinter
# anyway.
class Gcursor:
......@@ -54,7 +55,7 @@ class Gcursor:
self.active = 0
self.unbind()
self.cursorOff()
except Tkinter.TclError:
except TKNTR.TclError:
pass
# EOF flag can get set by window-close event or 'I' keystroke
# It should be set to string message
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ $Id$
from __future__ import division # confidence high
import numpy, sys, string
import Tkinter
import Tkinter as TKNTR # requires 2to3
from stsci.tools.for2to3 import ndarr2str
import wutil, Ptkplot
import gki, gkitkbase, gkigcur, tkplottext, textattrib, irafgwcs
......@@ -154,7 +154,7 @@ class GkiTkplotKernel(gkitkbase.GkiInteractiveTkBase):
self.clear()
# This is needed to clear all the previously plotted objects
# within tkinter (it has its own buffer it uses to replot)
#self.gwidget.delete(Tkinter.ALL)
#self.gwidget.delete(TKNTR.ALL)
def gki_cancel(self, arg):
......@@ -276,7 +276,7 @@ class GkiTkplotKernel(gkitkbase.GkiInteractiveTkBase):
# finally ready to do the drawing
self.activate()
# Have Tk remove all previously plotted objects
self.gwidget.delete(Tkinter.ALL)
self.gwidget.delete(TKNTR.ALL)
# Clear the screen
self.tkplot_faset(0,0)
self.tkplot_fillarea(numpy.array([0.,0.,1.,0.,1.,1.,0.,1.]))
......@@ -438,7 +438,7 @@ class tkColorManager:
def setDrawingColor(self, irafColorIndex):
"""Return the specified iraf color usable by Tkinter"""
"""Return the specified iraf color usable by TKNTR"""
color = self.config.defaultColors[irafColorIndex]
red = int(255*color[0])
green = int(255*color[1])
......
......@@ -9,7 +9,7 @@ from __future__ import division # confidence high
import os, string
from stsci.tools import capable
if capable.OF_GRAPHICS:
import Tkinter
import Tkinter as TKNTR # requires 2to3
import wutil, gki
class GWMError(Exception):
......@@ -66,7 +66,7 @@ class GraphicsWindowManager(gki.GkiProxy):
self.createList.append(windowName)
if self.windowVar is None:
# create Tk string variable with active window name
self.windowVar = Tkinter.StringVar()
self.windowVar = TKNTR.StringVar()
self.windowVar.trace('w', self._setWindowVar)
self.windowVar.set(windowName)
......
......@@ -189,7 +189,7 @@ class ImageDisplay:
def _read(self, n):
"""Read n bytes from image display and return as string
Raises IOError on failure. If a Tkinter widget exists, runs
Raises IOError on failure. If a tkinter widget exists, runs
a Tk mainloop while waiting for data so that the Tk widgets
remain responsive.
"""
......
......@@ -47,7 +47,7 @@ def getSingleTTYChar(): # return type str in all Python versions
c = irafutils.tkread(fd, 1)
else:
c = os.read(fd, 1)
if for2to3.PY3K: c = c.decode('ascii')
if for2to3.PY3K: c = c.decode('ascii', 'replace')
finally:
termios.tcsetattr(fd, TERMIOS.TCSAFLUSH, old)
return c
......
......@@ -9,7 +9,7 @@ $Id$
from __future__ import division # confidence high
# System level modules
from Tkinter import *
from Tkinter import * # requires 2to3
import string
class MsgIOBuffer(Frame):
......
This diff is collapsed.
......@@ -7,11 +7,9 @@ code: the dialog is created, but it is withdrawn just like the
root window (!) so there is nothing to interact with and the system
hangs.
import Tkinter
tk = Tkinter.Tk()
import Tkinter as TKNTR
tk = TKNTR.Tk()
tk.withdraw()
import tkSimpleDialog
tkSimpleDialog.askstring("window title", "question?")
......@@ -20,7 +18,7 @@ $Id$
from __future__ import division # confidence high
import tkSimpleDialog
from Tkinter import *
from Tkinter import * # requires 2to3
def __init__(self, parent, title = None):
'''Initialize a dialog.
......@@ -76,11 +74,11 @@ Here are some more notes from my "investigation":
http://mail.python.org/pipermail/python-list/2005-April/275761.html
Tkinter "withdraw" and "askstring" problem
tkinter "withdraw" and "askstring" problem
Jeff Epler jepler at unpythonic.net
Tue Apr 12 15:58:22 CEST 2005
* Previous message: Tkinter "withdraw" and "askstring" problem
* Previous message: tkinter "withdraw" and "askstring" problem
* Next message: os.open() i flaga lock
* Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
......
"""pyrafTk.py: modify Tkinter root to print short PyRAF tracebacks
"""pyrafTk.py: modify tkinter root to print short PyRAF tracebacks
$Id$
......@@ -6,19 +6,20 @@ R. L. White, 2000 November 17
"""
from __future__ import division # confidence high
import sys, Tkinter
import sys
import Tkinter as TKNTR # requires 2to3
import wutil
class _PyrafTk(Tkinter.Tk):
class _PyrafTk(TKNTR.Tk):
"""Modified Tk class that prints short pyraf tracebacks"""
def __init__(self, function):
self._pyraf_showtraceback = function
Tkinter.Tk.__init__(self)
TKNTR.Tk.__init__(self)
def report_callback_exception(self, exc, val, tb):
sys.stderr.write("Exception in Tkinter callback\n")
sys.stderr.write("Exception in tkinter callback\n")
sys.last_type = exc
sys.last_value = val
sys.last_traceback = tb
......@@ -30,9 +31,9 @@ def setTkErrorHandler(function):
If Tk root already exists, this function has no effect.
"""
if Tkinter._default_root is None and wutil.hasGraphics:
if TKNTR._default_root is None and wutil.hasGraphics:
try:
root = _PyrafTk(function)
root.withdraw()
except Tkinter.TclError:
except TKNTR.TclError:
pass
......@@ -7,13 +7,14 @@ R. White, 2001 Dec 15
from __future__ import division # confidence high
import os, sys, Tkinter
import os, sys
import Tkinter as TKNTR # requires 2to3
from stsci.tools.irafglobals import IrafPkg
import wutil
logo = "pyraflogo_rgb_web.gif"
class SplashScreen(Tkinter.Toplevel):
class SplashScreen(TKNTR.Toplevel):
"""Base class for splash screen
......@@ -26,8 +27,8 @@ class SplashScreen(Tkinter.Toplevel):
Based closely on news posting by Alexander Schliep, 07 Apr 1999
"""
def __init__(self, master=None, borderwidth=4, relief=Tkinter.RAISED, **kw):
Tkinter.Toplevel.__init__(self, master, relief=relief,
def __init__(self, master=None, borderwidth=4, relief=TKNTR.RAISED, **kw):
TKNTR.Toplevel.__init__(self, master, relief=relief,
borderwidth=borderwidth, **kw)
if self.master.master != None: # Why?
self.master.master.withdraw()
......@@ -96,11 +97,11 @@ class PyrafSplash(SplashScreen):
def createWidgets(self):
"""Create pyraf splash image"""
self.img = Tkinter.PhotoImage(file=self.filename)
self.img = TKNTR.PhotoImage(file=self.filename)
width = self.img.width()+20
iheight = self.img.height()
height = iheight+10+15*self.nlines
self.canvas = Tkinter.Canvas(self, width=width, height=height,
self.canvas = TKNTR.Canvas(self, width=width, height=height,
background=self["background"])
self.image = self.canvas.create_image(width//2, 5+iheight//2, image=self.img)
self.text = self.nlines*[None]
......@@ -141,7 +142,7 @@ class PyrafSplash(SplashScreen):
def Destroy(self, event=None):
if event:
# make sure button release occurred in window
# Tkinter should take care of this but doesn't
# tkinter should take care of this but doesn't
if event.x<0 or event.x>=self.winfo_width() or \
event.y<0 or event.y>=self.winfo_height():
self['cursor'] = self.defaultCursor
......@@ -202,12 +203,12 @@ class IrafMonitorSplash(PyrafSplash):
def splash(label="PyRAF Execution Monitor", background="LightYellow", **kw):
"""Display the PyRAF splash screen
Silently does nothing if Tkinter is not usable.
Silently does nothing if tkinter is not usable.
"""
if wutil.hasGraphics:
try:
return IrafMonitorSplash(label, background=background, **kw)
except Tkinter.TclError:
except TKNTR.TclError:
pass
return None
......
......@@ -863,7 +863,7 @@ class RedirProcess(Subprocess):
def test(fout = sys.stdout):
fout.write("Starting test ...\n")
assert hasattr(fout, 'write'), "Input not a file object: "+str(fout)
print "\tOpening subprocess (git 22 jul):"
print "\tOpening subprocess (4 Jan 2017):"
p = Subprocess('cat', expire_noisily=1) # set to expire noisily...
print p
print "\tOpening bogus subprocess, should fail:"
......
......@@ -7,11 +7,11 @@ __all__ = ['__version__', '__vdate__', '__svn_revision__', '__svn_full_info__',
import datetime
__version__ = '2.1.11'
__version__ = '2.1.14'
__vdate__ = 'unspecified'
__svn_revision__ = 'exported'
__svn_full_info__ = 'unknown'
__setup_datetime__ = datetime.datetime(2016, 7, 22, 15, 19, 17, 846349)
__setup_datetime__ = datetime.datetime(2017, 1, 5, 14, 18, 17, 617135)
# what version of stsci.distutils created this version.py
stsci_distutils_version = '0.3.8.dev'
......
"This is automatically generated at package time. Do not edit"
__vcs_revision__ = '837a8509'
__vcs_revision__ = '06c482ad'
"""Contains python routines to do special Window manipulations not
possible in Tkinter.
possible in tkinter.
These are python stubs that are overloaded by a c version implementations.
If the c versions do not exist, then these routines will do nothing
......@@ -525,12 +525,12 @@ def dumpspecs(outstream = None, skip_volatiles = False):
if not capable.OF_GRAPHICS:
if hasattr(capable, 'TKINTER_IMPORT_FAILED'):
out += "\nTkinter import failed."
out += "\ntkinter import failed."
else:
out += "\nTkinter use unattempted."
out += "\ntkinter use unattempted."
else:
out += "\nTclVersion = "+str(capable.Tkinter.TclVersion)
out += "\nTkVersion = "+str(capable.Tkinter.TkVersion)
out += "\nTclVersion = "+str(capable.TKNTR.TclVersion)
out += "\nTkVersion = "+str(capable.TKNTR.TkVersion)
out += "\nWUTIL_ON_MAC = "+str(WUTIL_ON_MAC)
out += "\nWUTIL_ON_WIN = "+str(WUTIL_ON_WIN)
out += "\nWUTIL_USING_X = "+str(WUTIL_USING_X)
......@@ -601,7 +601,7 @@ if _skipDisplay:
else:
print "No graphics/display possible for this session."
if hasattr(capable, 'TKINTER_IMPORT_FAILED'):
print "Tkinter import failed."
print "tkinter import failed."
else:
if _has_xutil or _has_aqutil:
hasGraphics = focusController.hasGraphics
......
No preview for this file type
stsci.tools @ 93d03d19
Subproject commit a2f7f4618e3975a857c8c65a6fa1d49d8c66d482
Subproject commit 93d03d19735358dbba1543c168ebe6ff5eb8a32e
[metadata]
name = pyraf
version = 2.1.11
version = 2.1.14
author = Rick White, Perry Greenfield, Chris Sontag
author-email = help@stsci.edu
home-page = http://www.stsci.edu/resources/software_hardware/pyraf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment