jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/318273 )
Change subject: Remove comments etc. when parsing template ......................................................................
Remove comments etc. when parsing template
Bug: T127691 Change-Id: I63a621d149582732af23e701f85e527e9c4bfba2 --- M scripts/harvest_template.py 1 file changed, 2 insertions(+), 3 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py index a431bfd..71c2145 100755 --- a/scripts/harvest_template.py +++ b/scripts/harvest_template.py @@ -53,7 +53,7 @@ signal.signal(signal.SIGINT, _signal_handler)
import pywikibot -from pywikibot import pagegenerators as pg, textlib, WikidataBot +from pywikibot import pagegenerators as pg, WikidataBot
docuReplacements = {'¶ms;': pywikibot.pagegenerators.parameterHelp}
@@ -140,8 +140,7 @@ 'Skipping.' % (page, item.title())) return
- pagetext = page.get() - templates = textlib.extract_templates_and_params(pagetext) + templates = page.raw_extracted_templates for (template, fielddict) in templates: # Clean up template try: