The attached patch enables the bot to look at Special:RecentChanges in much
the same way that it looks at Special:NewPages. It is currently
intentionally the smallest thing that might work for my needs. If others
would find it useful, I will be happy to polish it up to something suitable
for wider use.
--
--
Mike Cariaso
http://www.cariaso.com
liangent@oiweb:~/wiki/bot/archiver$ ./archiver.py
Found 1 wikipedia:zh processes running, including this one.
Traceback (most recent call last):
File "./archiver.py", line 7, in <module>
now = Site().getcurrenttime() # or from link's site?
File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 794, in
getcurrenttime
ts = self.getcurrenttimestamp()
File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 789, in
getcurrenttimestamp
result = r.submit()
File "/usr/lib/python2.5/site-packages/pywikibot/data/api.py", line 184,
in submit
self.site.throttle(write=write)
File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 176, in
__getattr__
return self.__class__.attr
AttributeError: type object 'APISite' has no attribute 'attr'
liangent@oiweb:~/wiki/bot/archiver$
this problem doesn't occur frequently, and i don't know when it will occur.
the script archiver.py's first lines are:
#!/usr/bin/env python
# -*- coding: utf_8 -*-
import re
import pywikibot
from pywikibot import Link, Site, Page
import datetime
now = Site().getcurrenttime() # or from link's site?
we need this method, and the following bad behavior goes against python's
design:
>>> from pywikibot import *
>>> Link.__hash__
<slot wrapper '__hash__' of 'object' objects>
>>> Link.__eq__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'Link' has no attribute '__eq__'
>>> Link.__cmp__
<unbound method Link.__cmp__>
>>> hash(Link('1'))
26872464
>>> hash(Link('1'))
26872400
>>> hash(Link('1'))
26872464
>>> Link('1')==Link('1')
Found 1 wikipedia:zh processes running, including this one.
True
>>> hash(Link('1'))==hash(Link('1'))
False
>>>
I have created a table at
http://www.botwiki.sno.cc/wiki/Rewrite/Porting_status to keep track of
progress in porting files from the existing framework to the rewrite branch.
So far it is quite incomplete (the first column is complete), but I intend
to keep adding to it and encourage other developers to contribute. This can
serve as a useful to-do list for those working on the project.
Russ
Hello!
(Apologies for cross-posting)
Following [1] the traffic of pywikipedia-l mailing-list has been split.
Instead of a single mailing-list, we now have 4 different lists:
=== pywikipedia-announce [2] ===
This list will have a minimal traffic.
It will only be used for important announcements, e.g. breaking changes.
One mail a month, at most.
We would like every pywikipedia user to subscribe to this list.
=== pywikipedia-l [3] ===
Human discussion on pywikipedia topic.
This includes support, follow-ups to announcements, follow-ups to svn
commits, and developer discussions.
Moderate traffic, usually no more than a couple of mails a week in average.
=== pywikipedia-bugs [4] ===
Automated mails sent by bug trackers on each bug state change.
Until now, these mails were sent to pywikipedia-l with the "[
pywikipediabot-*-* ]" title prefix.
High traffic.
Only users interested in pywikipedia development should subscribe.
Sourceforge trackers have already been updated.
=== pywikipedia-svn [6] ===
One automated mail is sent to that list after each pywikipedia SVN commit.
Until now, these mails were sent to pywikipedia-l with the "SVN:
[xxxx]" title prefix.
High traffic.
Only users interested in pywikipedia development should subscribe.
SVN commit hooks have already been updated.
=== In short ===
Splitting pywikipedia-l traffic, make sure to subscribe to
pywikipedia-announce to receive important announcements.
Follow-ups to pywikipedia-l please.
Thanks =)
--
Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]
[1] http://lists.wikimedia.org/pipermail/pywikipedia-l/2009-January/005111.html
[2] https://lists.wikimedia.org/mailman/listinfo/pywikipedia-announce
[3] https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
[4] https://lists.wikimedia.org/mailman/listinfo/pywikipedia-bugs
[5] https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn
cosoleto(a)svn.wikimedia.org ha scritto:
> Log Message:
> -----------
> Simplified Page.aslink(). 7% faster with forceInterwiki = True and Python 2.5.2
7.5%. So much mistakes... It would nice to get the SVN
pre-revprop-change hook enabled.
--
Francesco Cosoleto
Anyone can make mistakes, but only an idiot persists in his error. (Cicero)
Patches item #2762697, was opened at 2009-04-14 20:14
Message generated for change (Comment added) made by cosoleto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=2762697&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dr. Trigon (drtrigon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Stability in wikipedia.py
Initial Comment:
Recently I've had some problems with the stability of 'wikipedia.put(...)' sometimes this method had some issues and that killed my bot.
I was able to track the problem down to 'wikipedia._getEditPage(...)' and following code (in 'wikipedia.py' around line 725):
********************************
while not textareaFound:
text = self.site().getUrl(path, sysop = sysop)
if text.find("<title>Wiki does not exist</title>") != -1:
raise NoSuchSite(u'Wiki %s does not exist yet' % self.site())
********************************
and I have changed it that way, to hold my bot/script running:
********************************
while not textareaFound:
try:
text = self.site().getUrl(path, sysop = sysop)
except:
time.sleep(1)
continue
if text.find("<title>Wiki does not exist</title>") != -1:
raise NoSuchSite(u'Wiki %s does not exist yet' % self.site())
********************************
and I am "pretty" sure that this solved my problem. :)
Probably you are also intressted in this solution?! I would assume that the delay of 1sec is neither critical nor needed.
Greetings
DrTrigon
----------------------------------------------------------------------
>Comment By: Francesco Cosoleto (cosoleto)
Date: 2009-04-18 00:29
Message:
Please, next time you report a crash, include full traceback. The message
error you have reported helps, but uncut backtraces permit to recognize and
fix the problem more quickly.
The problem should be in Page.geturl(). A new patch is welcome.
----------------------------------------------------------------------
Comment By: Dr. Trigon (drtrigon)
Date: 2009-04-16 20:46
Message:
here is the error:
(<class 'socket.error'>, error(104, 'Connection reset by peer'),
<traceback object at 0x3595248>)
hope this helps you...?!
greetings
----------------------------------------------------------------------
Comment By: Dr. Trigon (drtrigon)
Date: 2009-04-15 11:21
Message:
...I could add some code to print the exception the next time, my bot is
down...?!
----------------------------------------------------------------------
Comment By: Dr. Trigon (drtrigon)
Date: 2009-04-15 11:19
Message:
Hello back!
I have to apologize because I don't have the error message anymore (I had
it once...) and the error is a bit hard to reproduce, since it is not
thrown very often... :(
You are right; my solution is a kind of "brute-force"... :) Yesterday,
after my first postings, I had a look into 'getUrl', since I was
remembering that it should catch (and did this in the past accordingly)
such kind of problems. What was strange; the error I had occurred
instantaneously after calling 'getUrl', without any time delay... And it
was (most of the time) on the toolserver, which might have another kind of
internet connection and therefore another failure behaviour (and throw
other exceptions)...?!
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2009-04-14 20:17
Message:
Hello !
Are you able to elaborate on what error was raised? There is probably a
nicer way to catch the error, at a lower level, instead of bluntly retrying
on error =)
----------------------------------------------------------------------
Comment By: Dr. Trigon (drtrigon)
Date: 2009-04-14 20:15
Message:
Sorry was NOT 'wikipedia.put(...)' was 'wikipedia.get(...)' !
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=2762697&group_…
Support Requests item #2768412, was opened at 2009-04-16 13:49
Message generated for change (Comment added) made by cosoleto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603139&aid=2768412&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Priority: 5
Private: No
Submitted By: xqt (xqt)
Assigned to: Nobody/Anonymous (nobody)
Summary: SaxParsBugs
Initial Comment:
I got a lot of SaxParsBug_wikipedia_<..>.dump files but I don't know, what to do with this stuff.
----------------------------------------------------------------------
>Comment By: Francesco Cosoleto (cosoleto)
Date: 2009-04-18 00:05
Message:
Delete or report them here. Probably the same your problem is already
reported in the bug #2771272 created today
(http://sourceforge.net/tracker/?func=detail&aid=2771272&group_id=93107&atid…).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603139&aid=2768412&group_…