I notice the warnings from the API module that the 'watch' parameter
is deprecated. This happens even though I switched from using
Page.put() to Page.save(), for the latter the watch parameter is not
deprecated.
Last time I looked I couldn't find an alternate way to add/remove
pages to the bot's watchlist, thus I kept the watch parameter in my
save() calls. Is there one? Or should I just ignore the API warnings?
Cheers,
Morten
Hi Tim,
Op 12-5-2010 11:09, Tim Starling schreef:
> <knip>
> * Amir Sarabadani (amir): pywikipediabot
>
Aka Ladsgroup? How come?
I'm wondering because my experience in the past with him wasn't that
good. He tried to run bots on Commons and failed. Very hard to
communicate with him.
I can only find 2 posts by him on pywikipedia-l, did he suddenly become
very active somewhere where I didn't notice?
Maarten
> -- Tim Starling
>
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l(a)lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
I finally had some time available to start moving my code over to the
rewrite branch, and made some notes along the way.
1: generate_user_files.py fails if the families directory is missing
from PYWIKIBOT2_DIR. Which of course is the case by default if the
environment variable points to an empty directory created somewhere.
It's the call in line 130-131 that fails. As I prefer to have my
configuration files somewhere outside of my SVN copy of pywikibot, I
solved the problem by creating a symlink. Could I suggest that
something about this is documented in the INSTALL file or somewhere
else that's easily accessible?
2: As I was instantiating the LoginManager directly, I noticed that
they keyword argument had changed from username to user. Not mentioned
in the conversion docs, although it's an easy fix.
3: Login completely failed (but I figured out why), but also noticed
that it failed with a NameError, there's a reference to _logger in
login.py. I think it's line 153.
4: Once I figured out that the api is the right LoginManager now
(because login.py no longer has a getCookie() method), things were
working again. Or maybe I'm not supposed to login that way anyway? ;)
5: I still get a couple of warnings when threadedhttp.py is importing
pkg_resources. I find those annoying and would really like them to go
away.
Cheers,
Morten
This:
import wikipedia
s = wikipedia.getSite("pl", "wikipedia")
for i in s.search(u"Lech Wałęsa"):
print i
results in:
Traceback (most recent call last):
File "search.py", line 5, in <module>
for i in s.search(u"Lech Wałęsa"):
File "/home/admini/saper/wikipedia/pywikipedia/wikipedia.py", line 5698, in search
'srsearch': q,
NameError: global name 'q' is not defined
Fix:
Index: wikipedia.py
===================================================================
--- wikipedia.py (revision 8147)
+++ wikipedia.py (working copy)
@@ -5684,7 +5684,7 @@
self._getUserDataOld(text, sysop = sysop, force = force)
- def search(self, query, number = 10, namespaces = None):
+ def search(self, q, number = 10, namespaces = None):
"""
Yield search results for query.
Use API when enabled use_api and version >= 1.11,
Can I have a commit bit to fix all those funny things from
time to time?
--
<< Marcin Cieslak // saper(a)saper.info >>