Revision: 6805 Author: nicdumz Date: 2009-05-03 11:53:49 +0000 (Sun, 03 May 2009)
Log Message: ----------- Link.langlinkUnsafe : A colon doesnt necessarily means a namespace.
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2009-05-03 11:52:21 UTC (rev 6804) +++ branches/rewrite/pywikibot/page.py 2009-05-03 11:53:49 UTC (rev 6805) @@ -1983,13 +1983,15 @@ link._section = None link._source = source
+ link._namespace = 0 + if ':' in title: ns, t = title.split(':', 1) - link._namespace = link._site.ns_index(ns.lower()) - link._title = t - else: - link._title = title - link._namespace = 0 + ns = link._site.ns_index(ns.lower()) + if ns: + link._namespace = ns + title = t + link._title = title
return link
pywikipedia-svn@lists.wikimedia.org