Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#43 Pmw 2.0.0-rc1 incompatible with pymol svn r4042

None
closed-invalid
Adrian
None
5
2013-09-26
2013-09-24
Jack Howarth
No

The current Pmw2-2.0.0-rc1 release breaks pymol svn at r4042 as reported in https://sourceforge.net/p/pymol/bugs/140/ when both are built against python 2.7. While appending...

import sys, Tkinter
sys.modules['tkinter'] = Tkinter

to pymol's /sw/lib/python2.7/site-packages/pmg_tk/PMGApp.py eliminates the error...

Traceback (most recent call last):
File "/sw/lib/python2.7/site-packages/pymol/init.py", line 447, in launch_gui
import(self.invocation.options.gui)
File "/sw/lib/python2.7/site-packages/pmg_tk/init.py", line 22, in
from PMGApp import *
File "/sw/lib/python2.7/site-packages/pmg_tk/PMGApp.py", line 33, in
class PMGApp(Pmw.MegaWidget):
File "/sw/lib/python2.7/site-packages/Pmw/Pmw_2_0_0/lib/PmwLoader.py", line 131, in getattr
self._initialise()
File "/sw/lib/python2.7/site-packages/Pmw/Pmw_2_0_0/lib/PmwLoader.py", line 89, in _initialise
raise ImportError(msg)
ImportError: No module named tinter

this failure is converted to...

Traceback (most recent call last):
File "/sw/lib/python2.7/site-packages/pmg_tk/init.py", line 35, in run
PMGApp(pymol_instance,skin).run(poll)
File "/sw/lib/python2.7/site-packages/pmg_tk/PMGApp.py", line 328, in init
self.runSkin()
File "/sw/lib/python2.7/site-packages/pmg_tk/PMGApp.py", line 254, in runSkin
self.skin.setup()
File "/sw/lib/python2.7/site-packages/pmg_tk/skins/normal/init.py", line 3629, in setup
self.createInterface()
File "/sw/lib/python2.7/site-packages/pmg_tk/skins/normal/init.py", line 3602, in createInterface
self.balloon = Pmw.Balloon(self.root)
File "/sw/lib/python2.7/site-packages/Pmw/Pmw_2_0_0/lib/PmwBalloon.py", line 28, in init
Pmw.MegaToplevel.init(self, parent)
File "/sw/lib/python2.7/site-packages/Pmw/Pmw_2_0_0/lib/PmwBase.py", line 982, in init
super().init(parent, tkinter.Toplevel)
TypeError: super() takes at least 1 argument (0 given)

which seems to be an error within Pmw2's /PmwBase.py.

Discussion

  • Adrian
    Adrian
    2013-09-24

    Jack,

    Thanks for the update. PMW 2.0 is the Python 3.0 port of Pmw 1.3.3 so a lot of the syntax is not Python 2 compatible; you should try the Pmw 1.3.3b version for Python 2. Please tell me if that works.

     
  • Jack Howarth
    Jack Howarth
    2013-09-24

    There are no issues using pymol svn with Pmw 1.3.3b. However https://fuhm.net/super-harmful/ seems to suggest the calling super without arguments can be problematic.

     
  • Adrian
    Adrian
    2013-09-24

    Jack,

    I'm glad to hear 1.3.3b is working. I gave the article a look but it seems to be aimed at Python2 and regards some special cases. Pmw 1.3.3b uses super() in the same way it has always been - so far it worked correctly.

    The new argument-less super() works in the Python 3 version and has been implemented after a PEP: http://www.python.org/dev/peps/pep-3135/ recommending the implementation of such syntactic sugar.

    I'll keep monitoring for bug reports. One thing I forgot to do is to add a check for the python version - I've placed it on my to do list for the upcoming release.

    Thanks for the feedback. If 1.3.3b works well, I'll consider this problem solved.

     
  • Adrian
    Adrian
    2013-09-26

    • status: open --> closed-invalid
    • assigned_to: Adrian
    • Group: -->