http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9487
Revision: 9487
Author: xqt
Date: 2011-09-03 08:23:27 +0000 (Sat, 03 Sep 2011)
Log Message:
-----------
Format doc sting to PEP8
Modified Paths:
--------------
branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py
===================================================================
--- branches/rewrite/pywikibot/page.py 2011-09-01 14:47:27 UTC (rev 9486)
+++ branches/rewrite/pywikibot/page.py 2011-09-03 08:23:27 UTC (rev 9487)
@@ -2199,11 +2199,11 @@
# Convert URL-encoded characters to unicode
t = url2unicode(t, site=self._source)
- # Normalize unicode string to a NFC (composed) format to allow proper
- # string comparisons. According to
+ # Normalize unicode string to a NFC (composed) format to allow
+ # proper string comparisons. According to
# http://svn.wikimedia.org/viewvc/mediawiki/branches/REL1_6/phase3/includes/n…
- # the mediawiki code normalizes everything to NFC, not NFKC (which
- # might result in information loss).
+ # the mediawiki code normalizes everything to NFC, not NFKC
+ # (which might result in information loss).
t = unicodedata.normalize('NFC', t)
# This code was adapted from Title.php : secureAndSplit()
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9485
Revision: 9485
Author: xqt
Date: 2011-09-01 05:51:41 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
if a site is given instead of a code, use its language; update from trunk r9484
Modified Paths:
--------------
branches/rewrite/pywikibot/i18n.py
Modified: branches/rewrite/pywikibot/i18n.py
===================================================================
--- branches/rewrite/pywikibot/i18n.py 2011-09-01 05:50:47 UTC (rev 9484)
+++ branches/rewrite/pywikibot/i18n.py 2011-09-01 05:51:41 UTC (rev 9485)
@@ -325,6 +325,9 @@
param = None
if type(parameters) == dict:
param = parameters
+ # If a site is given instead of a code, use its language
+ if hasattr(code, 'lang'):
+ code = code.lang
# we send the code via list and get the alternate code back
code = [code]
trans = twtranslate(code, twtitle, None)
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9484
Revision: 9484
Author: xqt
Date: 2011-09-01 05:50:47 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
if a site is given instead of a code, use its language
Modified Paths:
--------------
trunk/pywikipedia/pywikibot/i18n.py
Modified: trunk/pywikipedia/pywikibot/i18n.py
===================================================================
--- trunk/pywikipedia/pywikibot/i18n.py 2011-08-29 19:17:43 UTC (rev 9483)
+++ trunk/pywikipedia/pywikibot/i18n.py 2011-09-01 05:50:47 UTC (rev 9484)
@@ -336,6 +336,9 @@
param = None
if type(parameters) == dict:
param = parameters
+ # If a site is given instead of a code, use its language
+ if hasattr(code, 'lang'):
+ code = code.lang
# we send the code via list and get the alternate code back
code = [code]
trans = twtranslate(code, twtitle, None)