[Pywikipedia-l] Two minor problems in replace.py (attn xqt)

Bináris wikiposta at gmail.com
Fri Feb 25 14:16:33 UTC 2011


In replace.py, current version 8920, line 444:
if not page.canBeEdited():
should change to
if not self.articles and not page.canBeEdited():
The reason is that with the new -save/-savenew options (introduced in rev
8700) we may use replace.py for gathering titles, and that's what I am doing
in the minute. I want to collect titles from* fr, es, de* Wikipedias rather
than my home wiki, but they seem not to allow edits without botflag. I don't
need a flag and I won't change anything there, only save titles from those
wikis, but the current line 444 prevents me of doing that. self.articles is
not None iff -save or -savenew option is used, which means we don't edit the

Another issue is with line 843,
            titlefile = codecs.open(filename, encoding='utf-8',
                                    mode=(lambda x: x and 'a' or
I tested my original version which had an IF here as far as I remember, and
you turned it to lambda function. But somehow the -save option behaves now
just as -savenew does, i.e. overwrites the old file instead of appending.
Could you please help?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wikimedia.org/pipermail/pywikipedia-l/attachments/20110225/bfb8d32c/attachment.htm 

More information about the Pywikipedia-l mailing list