Re: [Pywikipedia-l] debugging a replace.py command

2012-03-19 Thread info
dia-l] debugging a replace.py command > On Mon, Mar 19, 2012 at 18:06, Bináris wrote: > > > > > > > 2012/3/19 Chris Watkins > > > >> > >> > >> I've been playing around with this idea, but I can't see why (.*$) would > >>

Re: [Pywikipedia-l] debugging a replace.py command

2012-03-19 Thread Chris Watkins
On Mon, Mar 19, 2012 at 18:06, Bináris wrote: > > > 2012/3/19 Chris Watkins > >> >> >> I've been playing around with this idea, but I can't see why (.*$) would >> match an empty part. >> > It does, because '*' means zero or more occurances. > >>> import re > >>> re.search('ku.*$', 'ku') > <_sre.

Re: [Pywikipedia-l] debugging a replace.py command

2012-03-19 Thread Bináris
2012/3/19 Chris Watkins > > > I've been playing around with this idea, but I can't see why (.*$) would > match an empty part. > It does, because '*' means zero or more occurances. >>> import re >>> re.search('ku.*$', 'ku') <_sre.SRE_Match object at 0x02ED6510> That means it matched. Anywa

Re: [Pywikipedia-l] debugging a replace.py command

2012-03-18 Thread Chris Watkins
Bináris, >> IndexError: no such group >> no such group >> > > This occurs when you use a condtional group and it does not exist and you > refer to it. > In this case (.*$) will match an empty part and in that case \2 refers to > nothing. > I've been playing around with this idea, but I can't s

Re: [Pywikipedia-l] debugging a replace.py command

2012-03-18 Thread Chris Watkins
On Sat, Mar 17, 2012 at 05:30, Merlijn van Deen wrote: > On a more generic note; for debugging such issues, using pdb (the > python debugger) can be useful. It does require being able to > understand written python code. > Merlijn, thanks for the suggestion to use pdb. We have an intern who kn

Re: [Pywikipedia-l] debugging a replace.py command

2012-03-16 Thread Merlijn van Deen
On 15 March 2012 12:53, Chris Watkins wrote: >   File "/home/cwg23/pwb/pywikibot/textlib.py", line 175, in replaceExcept >     match.group(groupID) + \ > IndexError: no such group > no such group > 0 pages were changed. On a more generic note; for debugging such issues, using pdb (the python debu

Re: [Pywikipedia-l] debugging a replace.py command

2012-03-15 Thread Bináris
2012/3/15 Chris Watkins > > IndexError: no such group > no such group > This occurs when you use a condtional group and it does not exist and you refer to it. In this case (.*$) will match an empty part and in that case \2 refers to nothing. -- Bináris

[Pywikipedia-l] debugging a replace.py command

2012-03-15 Thread Chris Watkins
I'm having trouble with this script, which I'm running on Appropedia.org... it's not a huge deal if it doesn't work, but I'd appreciate if anyone has the patience to help me understand how to debug this, or *why* it doesn't work. I've narrowed it down to the \2 in the replace term, as the problem