Bugs item #3080070, was opened at 2010-10-02 14:37 Message generated for change (Tracker Item Submitted) made by nakor-wikipedia You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3080070...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: rewrite Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nakor Wikipedia (nakor-wikipedia) Assigned to: Russell Blau (russblau) Summary: templatesWithParam return params in wrong order
Initial Comment: When there are more than 9 parameters in a template, templatesWithParam does not retuen them in the correct order. Below is a patch that fixes the problem:
### Eclipse Workspace Patch 1.0 #P pywikibot Index: pywikibot/page.py =================================================================== --- pywikibot/page.py (revision 8601) +++ pywikibot/page.py (working copy) @@ -930,13 +930,16 @@ args = template[1] positional = [] named = {} + intkeys = {} for key in sorted(args): try: int(key) except ValueError: named[key] = args[key] else: - positional.append(args[key]) + intkeys[int(key)]=args[key] + for key in sorted(intkeys, key=int): + positional.append(intkeys[key]) for name in named: positional.append("%s=%s" % (name, named[name])) result.append((pywikibot.Page(link, self.site), positional))
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3080070...
pywikipedia-bugs@lists.wikimedia.org