jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606172 )
Change subject: [IMPR] Always close files finally in throttle.py
......................................................................
[IMPR] Always close files finally in throttle.py
- move close() statement to finally section in checkMultiplicity()
- use with statement in drop()
Change-Id: I4dbb78efa546067dc9916476c9f576b92fb8d921
---
M pywikibot/throttle.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index 91b3318..047e67c 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -121,6 +121,7 @@
'site': this_site})
if not pid and this_pid >= my_pid:
my_pid = this_pid + 1 # next unused process id
+ finally:
f.close()
if not pid:
@@ -131,13 +132,12 @@
'site': mysite})
processes.sort(key=lambda p: (p['pid'], p['site']))
try:
- f = open(self.ctrlfilename, 'w')
- for p in processes:
- f.write('%(pid)s %(time)s %(site)s\n' % p)
+ with open(self.ctrlfilename, 'w') as f:
+ for p in processes:
+ f.write('{pid} {time} {site}\n'.format(**p))
except IOError:
pass
- else:
- f.close()
+
self.process_multiplicity = count
pywikibot.log(
'Found {0} {1} processes running, including this one.'.format(
--
To view, visit https://gerrit.wikimedia.org/r/606172
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4dbb78efa546067dc9916476c9f576b92fb8d921
Gerrit-Change-Number: 606172
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606657 )
Change subject: [bugfix] Fix regression introduced in 9fa2deee
......................................................................
[bugfix] Fix regression introduced in 9fa2deee
After the patch, wikiquotes fallback to wikipedia has started to
be broken. This should be solved more generally, but until then
this quick fix should do. We could also copy the whole wikipedia
into wikiquotes, but I don't like that solution much.
Change-Id: I8a6f751edd1cd3067c35fa56b3a7be631bb942b6
---
M scripts/welcome.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/welcome.py b/scripts/welcome.py
index 4d4ba2d..a0d8440 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -272,6 +272,7 @@
'zh': '{{subst:welcome}} %s',
},
'wikiquote': {
+ 'ar': '{{subst:ترحيب}} %s',
'ml': '{{subst:സ്വാഗതം}}',
},
'wikisource': {
--
To view, visit https://gerrit.wikimedia.org/r/606657
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8a6f751edd1cd3067c35fa56b3a7be631bb942b6
Gerrit-Change-Number: 606657
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/605965 )
Change subject: [cleanup] remove dontTouchRegexes
......................................................................
[cleanup] remove dontTouchRegexes
dontTouchRegexes points to result. The code is more ugly keeping
this double access to result than having a single line from 2008
unchanged.
Change-Id: Ib95131a2b09140a5b5870803b2da3e4cd7061e03
---
M pywikibot/textlib.py
1 file changed, 2 insertions(+), 4 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 9054917..b4e7f36 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -310,8 +310,6 @@
_create_default_regexes()
result = []
- # 'dontTouchRegexes' exist to reduce git blame only.
- dontTouchRegexes = result
for exc in keys:
if isinstance(exc, UnicodeType):
@@ -342,10 +340,10 @@
result.append(_regex_cache[exc])
# handle alias
if exc == 'source':
- dontTouchRegexes.append(_tag_regex('syntaxhighlight'))
+ result.append(_tag_regex('syntaxhighlight'))
else:
# assume it's a regular expression
- dontTouchRegexes.append(exc)
+ result.append(exc)
return result
--
To view, visit https://gerrit.wikimedia.org/r/605965
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib95131a2b09140a5b5870803b2da3e4cd7061e03
Gerrit-Change-Number: 605965
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)