Revision: 7698 Author: alexsh Date: 2009-11-26 09:36:47 +0000 (Thu, 26 Nov 2009)
Log Message: ----------- change get Page() by namespace, and use Page().titleWithoutNamespace() to fix input quoted template name.
Modified Paths: -------------- trunk/pywikipedia/template.py
Modified: trunk/pywikipedia/template.py =================================================================== --- trunk/pywikipedia/template.py 2009-11-26 09:33:45 UTC (rev 7697) +++ trunk/pywikipedia/template.py 2009-11-26 09:36:47 UTC (rev 7698) @@ -387,7 +387,7 @@ acceptAll = True else: if not genFactory.handleArg(arg): - templateNames.append(arg) + templateNames.append(pywikibot.Page(pywikibot.getSite(), arg, defaultNamespace=10).titleWithoutNamespace())
if subst or remove: for templateName in templateNames: @@ -403,7 +403,7 @@ oldTemplates = [] ns = pywikibot.getSite().template_namespace() for templateName in templates.keys(): - oldTemplate = pywikibot.Page(pywikibot.getSite(), ns + ':' + templateName) + oldTemplate = pywikibot.Page(pywikibot.getSite(), templateName, defaultNamespace=10) oldTemplates.append(oldTemplate)
if xmlfilename:
pywikipedia-svn@lists.wikimedia.org