Has anyone updated bundlepwm.py to get it working with python2.5?
The version packaged with 1.3.2 depends on regsub.gsub() which no
The fix to this is fairly simple. In bundlepmw.py change "import regsub" to "import re" and change each of the five occurrences of "regsub.gsub" to "re.sub".
Hopefully this will make it into the next release...
I must be missing something -- I actually did before asking here, but
the resulting Pmw.py file still contains "import Pmw" commands and
"Pmw.XXX" references. The resulting file works fine if I go in and
manually delete all the Pmw references -- looks like the "import
Pmw\>" and "\<Pmw\." re's don't work.
Did anything about regexp syntax change between regsub.gsub and
re.sub? I can't find anything in the docs that leads me to believe
there's a difference, but it's been a while since I used re's for
Woops! You are right. Instead of "\<" and "\>" in regsub (which mean beginning and end of word), re uses "\b" for both. Also, since "\b" is special in a string, the "\" has to be escaped like this: "\\". So the two changed lines are:
text = re.sub('import Pmw\\b', '', text)
text = re.sub('\\bPmw\.', '', text)
Hate to followup my own post, but if I change:
text = regsub.gsub('import Pmw\>', '', text)
text = regsub.gsub('INITOPT = Pmw.INITOPT', '', text)
text = regsub.gsub('\<Pmw\.', '', text)
text = re.sub('import Pmw', '', text)
text = re.sub('INITOPT = Pmw.INITOPT', '', text)
text = re.sub('Pmw\\.', '', text)
in mungeFile(). It looks like it works (no exhaustive testing,
but it's importable). I'm not sure why the angle brackets
were there in the first place.. and with the \'s, it seems
like they're literals to boot, which seems wrong...
This problem is now fixed in my fork git repository, here:
See also my announcement of the fork:
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.