EnkiPmw

De OpenESubWiki.

Voilà un patch pour pmw et python > 2.5.4

Il règle un souci avec l'éditeur.

Le fichier à patcher est /usr/lib64/python2.6/site-packages/Pmw/Pmw_1_3/lib/PmwOptionMenu.py

--- PmwOptionMenu.py      2009-09-28 22:36:03.000000000 +0200
+++ PmwOptionMenu.py    2009-09-28 22:39:29.000000000 +0200
@@ -1,6 +1,7 @@
 import types
 import Tkinter
 import Pmw
+import sys
 
 class OptionMenu(Pmw.MegaWidget):
 
@@ -59,11 +60,12 @@
 
     def setitems(self, items, index = None):
 
-        # Clean up old items and callback commands.
-        for oldIndex in range(len(self._itemList)):
-            tclCommandName = str(self._menu.entrycget(oldIndex, 'command'))
-            if tclCommandName != '':
-                self._menu.deletecommand(tclCommandName)
+        if sys.version_info[0] * 100 + sys.version_info[1] * 10 + sys.version_info[2] < 254:
+            # Clean up old items and callback commands.
+            for oldIndex in range(len(self._itemList)):
+                tclCommandName = str(self._menu.entrycget(oldIndex, 'command'))
+                if tclCommandName != '':
+                    self._menu.deletecommand(tclCommandName)
         self._menu.delete(0, 'end')
        self._itemList = list(items)
Outils personnels