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
6: I rewrote my code to use the page.save() method, and then noticed during my subsequent test run that the 'watch' parameter is deprecated: WARNING: API warning (edit): The watch parameter has been deprecated.
Tried to dig around in the source code to see if there was any other way of editing the watchlist, but couldn't find any. Is there any?
Cheers, Morten
From: pywikipedia-l-bounces@lists.wikimedia.org [mailto:pywikipedia-l-bounces@lists.wikimedia.org] On Behalf Of Morten Wang
I finally had some time available to start moving my code over to the rewrite branch, and made some notes along the way.
Thanks very much for the comments. I'll try to address them next week, but I wanted to acknowledge that I have seen them and will be looking into them.
Russ
"Morten Wang" nettrom@gmail.com wrote on Wednesday, May 05, 2010 5:36 PM:
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?
Fixed in r8154. You should be able to save your configuration files anywhere you want, as long as you set PYWIKIBOT2_DIR to point to that location.
Russ
"Morten Wang" nettrom@gmail.com wrote on Wednesday, May 05, 2010 5:36 PM:
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.
Fixed in r8156
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.
Also fixed in r8156
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? ;)
There's really never any need to access the LoginManager in bot code. Simply instantiating a Site object logs you in automatically. Note that you can use the -user:XXX command line option to change the default account, or you can do it in code by instantiating pywikibot.Site(user="XXX").
Russ
Every now and then bot fails to log (as it has forgotten the password) and ask me to enter it again. Is this normal?.
Matias.
On Tue, May 11, 2010 at 5:13 PM, Russell Blau russblau@imapmail.org wrote:
"Morten Wang" nettrom@gmail.com wrote on Wednesday, May 05, 2010 5:36 PM:
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.
Fixed in r8156
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.
Also fixed in r8156
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? ;)
There's really never any need to access the LoginManager in bot code. Simply instantiating a Site object logs you in automatically. Note that you can use the -user:XXX command line option to change the default account, or you can do it in code by instantiating pywikibot.Site(user="XXX").
Russ
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
"Matias" plinbox@gmail.com wrote in message news:AANLkTik66ZPoSrjNiN7fCzGtBRnEGGeJ3JFHS6FtGOd-@mail.gmail.com...
Every now and then bot fails to log (as it has forgotten the password) and ask me to enter it again. Is this normal?.
Cookies expire after 30 days (just as you have to log on to the Web interface again after 30 days); if this is happening much more often than every 30 days, then you should file a bug report with more details.
Russ
On Tue, May 11, 2010 at 3:13 PM, Russell Blau russblau@imapmail.org wrote:
"Morten Wang" nettrom@gmail.com wrote on Wednesday, May 05, 2010 5:36 PM: There's really never any need to access the LoginManager in bot code. Simply instantiating a Site object logs you in automatically. Note that you can use the -user:XXX command line option to change the default account, or you can do it in code by instantiating pywikibot.Site(user="XXX").
I figured there would be some automagic way of doing it, thanks! I'll work that pattern into my code.
And also, thanks for looking into the things I reported, appreciate it!
Cheers, Morten
pywikipedia-l@lists.wikimedia.org