From: <fwi...@us...> - 2009-07-25 14:37:51
|
Revision: 6581 http://jython.svn.sourceforge.net/jython/?rev=6581&view=rev Author: fwierzbicki Date: 2009-07-25 14:37:44 +0000 (Sat, 25 Jul 2009) Log Message: ----------- Remove the goofy imports since we no longer support JDK 1.1, but keep the API around for backwards compatibility. Modified Paths: -------------- trunk/jython/Lib/pawt/swing.py Modified: trunk/jython/Lib/pawt/swing.py =================================================================== --- trunk/jython/Lib/pawt/swing.py 2009-07-25 02:34:28 UTC (rev 6580) +++ trunk/jython/Lib/pawt/swing.py 2009-07-25 14:37:44 UTC (rev 6581) @@ -1,23 +1,11 @@ """ -A hack to make pawt.swing point to the java swing library. -This allows code which imports pawt.swing to work on both JDK1.1 and 1.2 +No longer needed, but keeping for backwards compatibility. """ -swing = None - -try: - import javax.swing.Icon - from javax import swing -except (ImportError, AttributeError): - try: - import java.awt.swing.Icon - from java.awt import swing - except (ImportError, AttributeError): - try: - import com.sun.java.swing.Icon - from com.sun.java import swing - except (ImportError, AttributeError): - raise ImportError, 'swing not defined in javax.swing or java.awt.swing or com.sun.java.swing' +from javax import swing import sys + +print "testing" + def test(panel, size=None, name='Swing Tester'): f = swing.JFrame(name, windowClosing=lambda event: sys.exit(0)) if hasattr(panel, 'init'): @@ -36,7 +24,3 @@ pawt.swing = swing sys.modules['pawt.swing'] = swing swing.__dict__['test'] = test - - #These two lines help out jythonc to figure out this very strange module - swing.__dict__['__file__'] = __file__ - swing.__dict__['__jpythonc_name__'] = 'pawt.swing' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |