Fixed in r9360. Thanks.
xqt
----- Ursprüngliche Nachricht -----
Von: Chris Watkins
Gesendet: Mittwoch, 13. Juli 2011 08:12
An: Pywikipedia discussion list
Betreff: Re: [Pywikipedia-l] "edit" option error: 'module' object has no attribute 'ui'
I've solved my problem, and I might have found a bug...
On Sat, Jul 2, 2011 at 01:10, Chris Watkins <chriswaterguy(a)appropedia.org> wrote:
With my current installation of Pywikipediabot, whenever I run replace.py and choose edit, it aborts with an error. I'm running on Debian (Linux) and I have python-tk installed. (I had it working on a previous computer. From memory, it also had python-tk installed, and it was either running Debian or Ubuntu - can't recall).
Ok, so I did some troubleshooting myself. I was able to get it working for an old version of Pywikipediabot (I had to install the package "idle" first in Debian). Then by changing files and lines of code one at a time, I narrowed down the bug in the new version to lines 31-32 of editarticle.py:
import pywikibot
from pywikibot import i18n
I replaced these two lines with the equivalent section, a single line, from an older version (I think about 16 Sep 2010):
import wikipedia as pywikibot
I don't know if I'm missing out on something by not having that new code referring to i18n, but so far it's working well.
Cheers,
Chris
At the message:
Do you want to accept these changes? ([y]es, [N]o, [e]dit, open in [b]rowser, [a]ll, [q]uit)
I enter: e
And I get this output:
Traceback (most recent call last):
File "replace.py", line 808, in <module>
main()
File "replace.py", line 799, in main
bot.run()
File "replace.py", line 428, in run
as_edited = editor.edit(original_text)
File "/home/PATH/editarticle.py", line 121, in edit
pywikibot.ui.editText(text, jumpIndex=jumpIndex,
AttributeError: 'module' object has no attribute 'ui'
The relevant line in editarticle.py is
120 return self.restoreLinebreaks(
121 pywikibot.ui.editText(text, jumpIndex=jumpIndex,
122 highlight=highlight))
Any suggestions? Thanks.
--
Chris Watkins
Appropedia.org - Sharing knowledge to build rich, sustainable lives.
--
Chris Watkins
Appropedia.org - Sharing knowledge to build rich, sustainable lives.
Fixed in r9360. Thanks.
xqt
----- Ursprüngliche Nachricht -----
Von: Chris Watkins
Gesendet: Mittwoch, 13. Juli 2011 08:12
An: Pywikipedia discussion list
Betreff: Re: [Pywikipedia-l] "edit" option error: 'module' object has no attribute 'ui'
I've solved my problem, and I might have found a bug...
On Sat, Jul 2, 2011 at 01:10, Chris Watkins <chriswaterguy(a)appropedia.org> wrote:
With my current installation of Pywikipediabot, whenever I run replace.py and choose edit, it aborts with an error. I'm running on Debian (Linux) and I have python-tk installed. (I had it working on a previous computer. From memory, it also had python-tk installed, and it was either running Debian or Ubuntu - can't recall).
Ok, so I did some troubleshooting myself. I was able to get it working for an old version of Pywikipediabot (I had to install the package "idle" first in Debian). Then by changing files and lines of code one at a time, I narrowed down the bug in the new version to lines 31-32 of editarticle.py:
import pywikibot
from pywikibot import i18n
I replaced these two lines with the equivalent section, a single line, from an older version (I think about 16 Sep 2010):
import wikipedia as pywikibot
I don't know if I'm missing out on something by not having that new code referring to i18n, but so far it's working well.
Cheers,
Chris
At the message:
Do you want to accept these changes? ([y]es, [N]o, [e]dit, open in [b]rowser, [a]ll, [q]uit)
I enter: e
And I get this output:
Traceback (most recent call last):
File "replace.py", line 808, in <module>
main()
File "replace.py", line 799, in main
bot.run()
File "replace.py", line 428, in run
as_edited = editor.edit(original_text)
File "/home/PATH/editarticle.py", line 121, in edit
pywikibot.ui.editText(text, jumpIndex=jumpIndex,
AttributeError: 'module' object has no attribute 'ui'
The relevant line in editarticle.py is
120 return self.restoreLinebreaks(
121 pywikibot.ui.editText(text, jumpIndex=jumpIndex,
122 highlight=highlight))
Any suggestions? Thanks.
--
Chris Watkins
Appropedia.org - Sharing knowledge to build rich, sustainable lives.
--
Chris Watkins
Appropedia.org - Sharing knowledge to build rich, sustainable lives.
With my current installation of Pywikipediabot, whenever I run replace.py
and choose edit, it aborts with an error. I'm running on Debian (Linux) and
I have python-tk installed. (I had it working on a previous computer. From
memory, it also had python-tk installed, and it was either running Debian or
Ubuntu - can't recall).
At the message:
*Do you want to accept these changes? ([y]es, [N]o, [e]dit, open in
[b]rowser, [a]ll, [q]uit) *
I enter: *e*
And I get this output:
Traceback (most recent call last):
File "replace.py", line 808, in <module>
main()
File "replace.py", line 799, in main
bot.run()
File "replace.py", line 428, in run
as_edited = editor.edit(original_text)
File "/home/PATH/editarticle.py", line 121, in edit
pywikibot.ui.editText(text, jumpIndex=jumpIndex,
AttributeError: 'module' object has no attribute 'ui'
The relevant line in editarticle.py is
120 return self.restoreLinebreaks(
121 pywikibot.ui.editText(text, jumpIndex=jumpIndex,
122 highlight=highlight))
Any suggestions? Thanks.
--
Chris Watkins
Appropedia.org - Sharing knowledge to build rich, sustainable lives.
Maybe. But I am not familar with the processes behind that module. I just use it.
xqt
----- Ursprüngliche Nachricht -----
Von: Bináris
Gesendet: Freitag, 8. Juli 2011 09:41
An: Pywikipedia discussion list
Betreff: Re: [Pywikipedia-l] A strange warning message
2011/7/7 <info(a)gno.de>
This is from wikipedia.postData() which ensures that all sent data is received otherwise it calls itself recursively
Does it mean a network error during the saving of the page?
--
Bináris
Hi guys,
The Commons messages are now a big mess. Everything gets imported from
other bots, duplication etc etc. I was thinking about just making a lib
(commons_lib.py?) to store the messages and moving the translations to
the i18n later on. Good plan? Or should it be in the family file?
Comments please :-)
Affected files:
nowcommons.py
imagecopy.py
imagecopy_self.py
imagetransfer.py
tag_nowcommons.py
(maybe more)
Maarten
2011/6/28 Morten Wang <nettrom(a)gmail.com>
> 2: Using functions instead of strings as the replacement in sub(). If
> you're looking to do a fair amount of conditional logic in your replacement,
> it might be more easily written by having a function do it, rather than
> attempt to do it all with a regex.
>
> My $.02.
>
Thank you for this great idea that is worth much more than $.02. :-)
I can tell that my problem is completely solved now, much better than I had
hoped previously.
I am glad to announce this small guide to functions which is the result of
my last two day's work:
http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bin%C3%A1ris/Fixes_and_functio…
This shows not only an example of a complicated replacement, but also the
way to compare the match to the whole article (removing redundant links), or
generating a long fix by means of a function. Another example is how to
choose between two options for replacement during runtime (when you cannot
decide it in coding time without a text environment).
--
Bináris
Hi,
I ran an own script (not published yet), and suddenly I got a strange
message (see bolded "Warning" line):
Wikipédia:Kocsmafal (műszaki)/Archív56 56
Wikipédia:Kocsmafal (műszaki)/Archív57 57
*Warning! len(text) does not match content-length: 6952 != 39337*
Saving Wikipédia:Kocsmafal (műszaki)/Tartalomjegyzék
Updating page [[Wikipédia:Kocsmafal (műszaki)/Tartalomjegyzék]] via API
This is NOT my code, there are no such words in my program!
Last line is from wikipedia.py, the others from my script, but where does
this bold text come?
No module name or line number appeared.
Imports are:
import re
import date
import wikipedia as pywikibot
import archivebot
--
Bináris
Hi,
Python 2.7.2 has been released at Sun, 12 June 2011. This release does no longer trigger unicode bug 3081100, which happened for characters with multiple accents (for example on hak-, hi-, cdo- and sa-wiki). I guess it is highly recommended to migrate to this new release if the local version has this bug.
Greetings
xqt
Hi,
I've noticed botMayEdit() doesn't check for a whitelist if the template used
is {{nobots}}, instead it always returns False. Is that a bug or a feature?
From reading the documentation on en:Template:Bots, it seems that
{{nobots|allow=FooBot}} isn't actually a supported way of using the template
(instead it should be {{bots|allow=FooBot}}) so pywikibot is doing it right.
Still, I just wanted to check before I go fiddling with the template on
somebody's talk page (again) :)
Cheers,
Morten