jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/358040 )
Change subject: [IMPR] Improve maintenance/wikimedia_sites.py ......................................................................
[IMPR] Improve maintenance/wikimedia_sites.py
Change-Id: Id660b7bffd1381f4884507b9fb097b0701736257 --- M scripts/maintenance/wikimedia_sites.py 1 file changed, 2 insertions(+), 3 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py index a9df474..3a0a8e6 100755 --- a/scripts/maintenance/wikimedia_sites.py +++ b/scripts/maintenance/wikimedia_sites.py @@ -86,9 +86,8 @@ family_file_name = 'pywikibot/families/%s_family.py' % family family_file = codecs.open(family_file_name, 'r', 'utf8') family_text = family_file.read() - old = re.findall(r'(?msu)^ {8}self.languages_by_size.+?]', - family_text)[0] - family_text = family_text.replace(old, text) + family_text = re.sub(r'(?msu)^ {8}self.languages_by_size.+?]', + text, family_text) with codecs.open(family_file_name, 'w', 'utf8') as family_file: family_file.write(family_text)
pywikibot-commits@lists.wikimedia.org