wrong code...

Index: pywikibot/site.py
===================================================================
--- pywikibot/site.py   (revision 6639)
+++ pywikibot/site.py   (working copy)
@@ -173,7 +173,7 @@
         """Calls to methods not defined in this object are passed to
Family."""

         if hasattr(self.__class__, attr):
-            return self.__class__.attr
+            return getattr(self.__class__, attr)
         try:
             method = getattr(self.family, attr)
             f = lambda *args, **kwargs: \

On Mon, Apr 20, 2009 at 6:35 PM, Liangent <[email protected]> wrote:

> liang...@oiweb:~/wiki/bot/archiver$<liang...@oiweb:%7E/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'
> liang...@oiweb:~/wiki/bot/archiver$<liang...@oiweb:%7E/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?
>
>
_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to