I'm using replace.py to create wikilinks. Usually I want to select only the
first occurrence of the search string, and my command works fine for this.
But sometimes, the first hit is not suitable (e.g. it's part of a book or
course title, so I don't want to add the wikilink). If I choose n for no,
the bot goes to the next page.
Is there a way I can skip to the next occurrence in the same page? I'm
guessing it will need a modified version of replace.py, so that it gives an
extra option besides ([y]es, [N]o, [e]dit, open in [b]rowser, [a]ll,
[q]uit)
The actual command I'm using is:
python replace.py -regex "(?si)\b((?:FOO1|FOO2))\b(.*$)
" "[[\\1]]\\2" -exceptinsidetag:link -exceptinsidetag:hyperlink
-exceptinsidetag:header -exceptinsidetag:nowiki -exceptinsidetag:ref
-excepttext:"(?si)\[\[((?:FOO1|FOO2)[\|\]])" -namespace:0 -namespace:102
-namespace:4 -summary:"[[Appropedia:Wikilink bot]] adding double square
brackets to: FOO1|FOO2." -log -xml:currentdump.xml
Many thanks!
--
Chris Watkins
Appropedia.org - Sharing knowledge to build rich, sustainable lives.
blogs.appropedia.org
identi.ca/appropedia
twitter.com/appropedia
Hello!
Please add Polish translations to fixing_redirects.py :) It will be a
gift for Polish community.
Strings in Polish:
msg = { (...)
'pl': u'Bot: naprawa przekierowań',
featured_articles = { (...)
'pl': u'Wikipedia:Artykuły_na_medal',
Thanks in advance and Merry Christmas!
patrol
I have used pywikipedia at pl.wikipedia with my bot account.
Everything was ok till today I updated my pywiki and during use of
pywiki I got something like this:
WARNING: Your account on wikipedia:pl is blocked. Editing using this
account will stop the run.
Traceback (most recent call last):
File "replace.py", line 719, in <module>
main()
File "replace.py", line 714, in main
bot.run()
File "replace.py", line 438, in run
page.put(new_text, self.editSummary)
File "/usr/home/patrol110/pywikipedia/wikipedia.py", line 1599, in put
self.site().checkBlocks(sysop = sysop)
File "/usr/home/patrol110/pywikipedia/wikipedia.py", line 5467, in checkBlocks
raise UserBlocked('User is blocked in site %s' % self)
wikipedia.UserBlocked: User is blocked in site wikipedia:pl
And this is not true information because my bot is not blocked.
Please help me solve this problem. Thanks in advance.
Regards,
Patrol110
I have recently begun using pywikipediabot again and for some reason it
is appallingly slow.
Logging into my wiki take upwards of a minute and each and ever single
action, e.g. pages moves, takes about this length of time as well. My
wiki is otherwise quite quick and previously pywikipediabot was
reasonably fast.
Has anyone else encountered issues like this? What could be causing
these huge delays?
Hi everyone,
I'm getting so freaking tired of these untested sloppy commits which
keep breaking the bots.
alexsh(a)svn.wikimedia.org schreef:
> Revision: 7591
> Author: alexsh
> Date: 2009-11-04 13:22:17 +0000 (Wed, 04 Nov 2009)
>
> Log Message:
> -----------
> * site().getUrl(): change all HTTP process to use urllib2.
> * handle and combine Site Authentication, proxy handle and Proxy Authentication in the bottom.
>
> Modified Paths:
> --------------
> trunk/pywikipedia/wikipedia.py
>
>
>
<knip>
>
> -class MyURLopener(urllib.FancyURLopener):
> - version="PythonWikipediaBot/1.0"/pywikipedia-svn
>
How the hell is upload.py supposed to work now?
Traceback (most recent call last):
File "D:\Wikipedia\pywikipedia\flickrripper_wlanl.py", line 562, in
<module>
main()
File "D:\Wikipedia\pywikipedia\flickrripper_wlanl.py", line 551, in main
uploadedPhotos += processPhoto(flickr, photo_id, flickrreview,
reviewer, ove
rride, addCategory, removeCategories, autonomous)
File "D:\Wikipedia\pywikipedia\flickrripper_wlanl.py", line 252, in
processPho
to
bot.upload_image(debug=False)
File "D:\Wikipedia\pywikipedia\upload.py", line 227, in upload_image
self.read_file_content()
File "D:\Wikipedia\pywikipedia\upload.py", line 108, in read_file_content
uo = wikipedia.MyURLopener()
AttributeError: OpenerDirector instance has no __call__ method
Please test your stuff decently before you commit it! About every time I
do an svn update I have to get rid of dozens of bugs
Maarten
Hi, I wish to use pywikipediabot in translatewiki.net to fix some common
spelling problems in Malayalam Language.
But I dont know what I need to change to run pywikipediabot on
translatewiki.net. Please help
Hi,
I have modified the get.py modul of the pywikibot. The purpose is to display
the date of creation of the article. I guessed from wikipedia.py that I need
either page.getVersionHistory(), which is a list, or
page.getVersionHistoryTable(), which gives the history as a wikitable.
Now it seems to work, but sometimes it gives back a shorter page history,
than the real one, and, unfortunately, sometimes both methods give an empty
page history, and thus en error in the program flow.
Here are some concerned pages:
[[hu:Ehrenfeld Samu]] (http://hu.wikipedia.org/wiki/Ehrenfeld_Saul) and
[[hu:TCSEC]] (http://hu.wikipedia.org/wiki/TCSEC) seems to have a completely
empty page history, which is not true and results in an error.
(Theoretically, no article could exist with an empty history.)
[[hu:Mark VII]] (http://hu.wikipedia.org/wiki/Mark_VII) displays only one
line, just as it had a single-edit history.
Where is the mistake?
I attach proba.py which is the modified version of get.py. I hope you will
not take my head for that, it's very small. :-) The Hungarian comments are
not relevant, the essence is written here. An article can be given as a
command line parameter.
Thanks!
--
Bináris
That bug is fixed in r7723.
-Alex S.H. Lin
※ 引述《"Hannes Röst" <hannesroest(a)gmx.ch>》之郵件內容:
>you should change
>
>Page(self,site(),
>
>to
>
>Page(self.site(),
>
>try and see if it works. But I agree that it can be very annoying for
>users if something like that breaks the whole workflow.
>
>Hannes
>
>
>2009/11/30 Marcin Cieslak <saper(a)saper.info>:
>> Hello!
>>
>> This on wikipedia.py:
>>
>> @@ -2591,6 +2600,7 @@
>>
>> sysop = self._getActionUser(action = 'move', restriction = self.moveRestriction, sysop = False)
>> if deleteAndMove:
>> sysop = self._getActionUser(action = 'delete', restriction = '', sysop = True)
>> + Page(self,site(), newtitle).delete(self.site().mediawiki_message('delete_and_move_reason'), False, False)
>>
>> # Check blocks
>> self.site().checkBlocks(sysop = sysop)
>>
>> Causes this:
>>
>> Traceback (most recent call last):
>> File "kalendariumwp.py", line 26, in <module>
>> p.move("Wikipedysta:Joymaster/%s" % t, reason=action, sysop=True, deleteAndMove=True)
>> File "/home/admini/saper/wikipedia/pywikipedia/wikipedia.py", line 2646, in move
>> Page(self,site(), newtitle).delete(self.site().mediawiki_message('delete_and_move_reason'), False, False)
>> NameError: global name 'site' is not defined
>>
>> Could you please *stop* committing things *COMPLETELY* untested?
>>
>> Who can revoke committer bit?
>>
>> --
>> << Marcin Cieslak // saper(a)saper.info >>
>>
>>
>> _______________________________________________
>> Pywikipedia-l mailing list
>> Pywikipedia-l(a)lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>>
>
>_______________________________________________
>Pywikipedia-l mailing list
>Pywikipedia-l(a)lists.wikimedia.org
>https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>