currently, some old methods still remain in the rewrite branch, for
backward-compatibility.
but i think as a *rewrite* version, such methods can be removed, or
replaced with new methods and properties,
to make new code cleaner.
also, for convinence, we can provide some simple wrapper classes, which map
old methods to new ones.
and put them in some package such as pywikibot.wrappers.*. for example,
pywikibot.wrappers.Page.
try to make them have the same interfaces as old version (trunk version?).
and this may make porting old scripts easier (just by writing from pywikibot
import wrappers as wikipedia etc.).
siebrand(a)svn.wikimedia.org ha scritto:
> Revision: 6923
> Author: siebrand
> Date: 2009-05-26 14:17:08 +0000 (Tue, 26 May 2009)
>
> Log Message:
> -----------
> Remove stray execute bit and update svn keywords
I don't know what this script is for, but the execute bit doesn't look
as wrong for me.
--
Francesco Cosoleto
"Resteranno però gli altri Achei lunghi capelli,
finché abbatteremo Troia: e se pure questi...
ma sì, sulle navi fuggite verso la patria terra!
Noi due, Stènelo e io, lotteremo, fino a che il termine
fatale d'Ilio troviamo, perché con nume propizio venimmo." (Omero)
alexsh(a)svn.wikimedia.org ha scritto:
> Revision: 6927
> Author: alexsh
> Date: 2009-05-30 02:37:59 +0000 (Sat, 30 May 2009)
>
> Log Message:
> -----------
> Fix UnicodeDecodeError in message print out
>
> Modified Paths:
> --------------
> trunk/pywikipedia/clean_sandbox.py
> trunk/pywikipedia/welcome.py
You don't read the mailing-list.
You should post your patch in mailing-list.
--
Francesco Cosoleto
Anyone can make mistakes, but only an idiot persists in his error. (Cicero)
Hello!
2009/5/30 <alexsh(a)svn.wikimedia.org>:
> Revision: 6927
> Author: alexsh
> Date: 2009-05-30 02:37:59 +0000 (Sat, 30 May 2009)
>
> Log Message:
> -----------
> Fix UnicodeDecodeError in message print out
It would be helpful to see the stacktrace here, because the fixes
you're doing are not... straightforward :)
> Modified: trunk/pywikipedia/clean_sandbox.py
> ===================================================================
> --- trunk/pywikipedia/clean_sandbox.py 2009-05-29 18:56:04 UTC (rev 6926)
> +++ trunk/pywikipedia/clean_sandbox.py 2009-05-30 02:37:59 UTC (rev 6927)
> @@ -122,7 +122,7 @@
> wikipedia.output(u'\nDone.')
> return
> else:
> - wikipedia.output(u'\nSleeping %s hours, now %s' % (self.hours, now))
> + wikipedia.output('\nSleeping %s hours, now %s' % (self.hours, now) )
> time.sleep(self.hours * 60 * 60)
I don't understand how this change can solve a UnicodeDecodeError.
At most, a UnicodeEncodeError could be thrown before? Also, it's
better to use Unicode when possible instead of relying on bytestring:
output() has no way to determine what encoding should be used for
decoding
If this change solves something, there should be a better way to solve
your problem :)
What bug are you fixing exactly?
>
> Modified: trunk/pywikipedia/welcome.py
> ===================================================================
> --- trunk/pywikipedia/welcome.py 2009-05-29 18:56:04 UTC (rev 6926)
> +++ trunk/pywikipedia/welcome.py 2009-05-30 02:37:59 UTC (rev 6927)
> @@ -827,7 +827,7 @@
> if offset_variable != 0:
> URL += "&offset=%d" % offset_variable
> log = wsite.getUrl(URL)
> - wikipedia.output(u'Loading latest %s new users from %s...\n' % (limit, wsite.hostname()))
> + wikipedia.output(u'Loading latest %s new users from %s:%s...\n' % (limit, wikipedia.default_family,wikipedia.default_code))
> # Determine which signature to use
> if random:
> try:
Again, I don't see the point. Are you solving some encoding problem
here, or changing output format? Or both?
* If there's an encoding problem, something has to be fixed in another
place (can you provide the stacktrace maybe?)
* If you're changing output format... I'm fine with it, but please
don't commit unrelated changes without comments... Also, simply using
u'%s' % wsite should work the same, because Site objects have a
__repr__ method
Thank you!
--
Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]
alexsh(a)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)
2009/5/21 <nicdumz(a)svn.wikimedia.org>:
> Revision: 6913
> Author: nicdumz
> Date: 2009-05-21 14:22:53 +0000 (Thu, 21 May 2009)
>
> Log Message:
> -----------
> is disambig: use Disambiguationspage
I'm thinking about using MediaWiki:Disambiguationspage for all
languages. Would you see any inconvenients?
Maintaining by hand the disambiguation templates is a pain, when
simply fetching this special page does the trick.
--
Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]
russblau(a)svn.wikimedia.org ha scritto:
> Revision: 6904
> Author: russblau
> Date: 2009-05-18 00:40:33 +0000 (Mon, 18 May 2009)
>
> Log Message:
> -----------
> .capitalize() is not desirable:
>
>>>> print "Foo Bar".capitalize()
> Foo bar
>
Ok, the change can be accepted, but I don't see any template names with
uppercase characters there (and so probably also in future).
capitalize() hasn't broken nothing.
--
Francesco Cosoleto
«Nessuno, eccetto il teorico stesso, crede nelle sue teorie;
tutti credono ai risultati di laboratorio, eccetto lo
sperimentatore». (Albert Einstein)
nicdumz(a)svn.wikimedia.org ha scritto:
> Revision: 6886
> Author: nicdumz
> Date: 2009-05-14 05:16:03 +0000 (Thu, 14 May 2009)
>
> Log Message:
> -----------
> Patch #2791516 : adding bar: & et: portal namespaces names.
Please report patch author in commit log next time.
--
Francesco Cosoleto
Anyone can make mistakes, but only an idiot persists in his error. (Cicero)