[Pywikipedia-l] [Pywikipedia-svn] SVN: [6917] trunk/pywikipedia
Francesco Cosoleto
cosoleto at gmail.com
Sun May 24 16:02:49 UTC 2009
alexsh at svn.wikimedia.org ha scritto:
> Revision: 6917
> Author: alexsh
> Date: 2009-05-24 13:19:09 +0000 (Sun, 24 May 2009)
>
> Log Message:
> -----------
> *optimize wikiversity url when using SSL connection
> *Fix secure url faild in oldwikisource and SSL connection
> *Add progress shortcut for redirect.py (double->do, broken->br)
> *Other syntax fix and comments in watchlist.py and login.py
Please, separate your commits as possible: diffent feature
implentations, bug fixes, cosmetic changs, documentation changes, etc...
worth separated commits.
> Modified: trunk/pywikipedia/families/wikisource_family.py
> ===================================================================
> --- trunk/pywikipedia/families/wikisource_family.py 2009-05-24 10:37:36 UTC (rev 6916)
> +++ trunk/pywikipedia/families/wikisource_family.py 2009-05-24 13:19:09 UTC (rev 6917)
> @@ -1,6 +1,6 @@
> # -*- coding: utf-8 -*-
> import urllib
> -import family, config
> +import family, config, wikipedia
Importing the full wikipedia module is probably wrong here.
> ]
>
> - self.langs = {
> - '-': 'wikisource.org',
> - }
> + self.langs['-'] = 'wikisource.org'
> if config.SSL_connection and self.name in config.available_ssl_project:
> for lang in self.languages_by_size:
> self.langs[lang] = 'secure.wikimedia.org'
> + self.langs['-'] = 'secure.wikimedia.org'
> else:
> for lang in self.languages_by_size:
> self.langs[lang] = '%s.wikisource.org' % lang
> + self.langs['-'] = 'wikisource.org'
This last line is surely unneeded.
> + if config.SSL_connection and wikipedia.default_code == '-':
> + def scriptpath(self, code):
> + return '/wikipedia/sources/w'
wikipedia.default_code = config.mylang
> Modified: trunk/pywikipedia/redirect.py
> ===================================================================
> --- trunk/pywikipedia/redirect.py 2009-05-24 10:37:36 UTC (rev 6916)
> +++ trunk/pywikipedia/redirect.py 2009-05-24 13:19:09 UTC (rev 6917)
> @@ -789,9 +789,9 @@
> number = None
> always = False
> for arg in wikipedia.handleArgs(*args):
> - if arg == 'double':
> + if arg == 'double' or arg == 'do':
> action = 'double'
> - elif arg == 'broken':
> + elif arg == 'broken' or arg == 'br':
> action = 'broken'
Doesn't look so nice.
> Modified: trunk/pywikipedia/watchlist.py
> ===================================================================
> --- trunk/pywikipedia/watchlist.py 2009-05-24 10:37:36 UTC (rev 6916)
> +++ trunk/pywikipedia/watchlist.py 2009-05-24 13:19:09 UTC (rev 6917)
> @@ -84,13 +84,11 @@
> import config
> wikipedia.output('Downloading All watchlists for your accounts in user-config.py');
> for family in config.usernames:
> - for lang in config.usernames[family]:
> - site = wikipedia.getSite(code=lang, fam = family)
> - refresh(site)
> + for lang in config.usernames[ family ]:
> + refresh(wikipedia.getSite( code = lang, fam = family ) )
> for family in config.sysopnames:
> - for lang in config.sysopnames[family]:
> - site = wikipedia.getSite(code=lang, fam = family)
> - refresh(site)
> + for lang in config.sysopnames[ family ]:
> + refresh(wikipedia.getSite( code = lang, fam = family ) )
[...]
It's ok removing poorly used variables, but you change coding style too
and doesn't look better for me.
--
Francesco Cosoleto
I have made this letter longer than usual because I lack the time to
make it shorter. (Blaise Pascal)
More information about the Pywikipedia-l
mailing list