----- Original Nachricht ----
Von: Bináris <[email protected]>
An: Pywikipedia discussion list <[email protected]>
Datum: 25.02.2011 15:16
Betreff: [Pywikipedia-l] Two minor problems in replace.py (attn xqt)
> Hi!
>
> In replace.py, current version 8920, line 444:
> if not page.canBeEdited():
> should change to
> if not self.articles and not page.canBeEdited():
OK
> wiki.
>
> Another issue is with line 843,
> titlefile = codecs.open(filename, encoding='utf-8',
> mode=(lambda x: x and 'a' or
> 'w')(append))
> 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?
I tried it in idle:
>>> append = True
>>> (lambda x: x and 'a' or 'w')(append)
'a'
>>> append = False
>>> (lambda x: x and 'a' or 'w')(append)
'w'
>>>
Greetings
xqt
_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l