Merlijn van Deen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76521
Change subject: Removed commented-out zh templates
......................................................................
Removed commented-out zh templates
There is no reason to have commented-out templates in source control.
Change-Id: Iaf3740fabb0f196748ba7541e1db601bdc804104
---
M scripts/blockpageschecker.py
1 file changed, 0 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/21/76521/1
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index 8d8f23e..1507348 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -85,7 +85,6 @@
r'\{\{(?:[Tt]emplate:|)[Aa]bp(?:|[ _]scad\|(?:.*?))\}\}'],
'fr': [ur'\{\{(?:[Tt]emplate:|[Mm]odèle:|)[Ss]emi[- ]?protection(|[^\}]*)\}\}'],
'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)半保護(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
- #'zh':[ur'\{\{(?:[Tt]emplate:|)Protected|(?:[Ss]|[Ss]emi|半)(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Mini-protected|(?:[Ss]|[Ss]emi|半)(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Protected-logo|(?:[Ss]|[Ss]emi|半)(?:\|.+|)\}\}(\n+?|)'],
}
# Regex to get the total-protection template
templateTotalProtection = {
@@ -95,21 +94,18 @@
'fr':[ur'\{\{(?:[Tt]emplate:|[Mm]odèle:|)[Pp]rotection(|[^\}]*)\}\}',
ur'\{\{(?:[Tt]emplate:|[Mm]odèle:|)(?:[Pp]age|[Aa]rchive|[Mm]odèle) protégée?(|[^\}]*)\}\}'],
'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)保護(?:性急|)(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
- #'zh':[r'\{\{(?:[Tt]emplate:|)Protected|(?:[Nn]|[Nn]ormal)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Mini-protected|(?:[Nn]|[Nn]ormal)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Protected-logo|(?:[Nn]|[Nn]ormal)(?:\|.+|)\}\}(\n+?|)'],
}
# Regex to get the semi-protection move template
templateSemiMoveProtection = {
'en': None,
'it':[r'\{\{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad\|.*?|\|.*?)\}\}'],
'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)移動半保護(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
- #'zh':[r'\{\{(?:[Tt]emplate:|)Protected|(?:MS|ms)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Mini-protected|(?:MS|ms)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Protected-logo|(?:MS|ms)(?:\|.+|)\}\}(\n+?|)'],
}
# Regex to get the total-protection move template
templateTotalMoveProtection = {
'en': None,
'it':[r'\{\{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad\|.*?|\|.*?)\}\}'],
'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)移動保護(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
- #'zh':[ur'\{\{(?:[Tt]emplate:|)Protected|(?:[Mm]|[Mm]ove|移[動动])(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Mini-protected|(?:[Mm]|[Mm]ove|移[動动])(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Protected-logo|(?:[Mm]|[Mm]ove|移[動动])(?:\|.+|)\}\}(\n+?|)'],
}
# If you use only one template for all the type of protection, put it here.
@@ -125,7 +121,6 @@
'it':['{{Avvisobloccoparziale}}', '{{Avvisoblocco}}', None, None, '{{Protetta}}'],
'fr':['{{Semi-protection}}', '{{Protection}}', None, None, None],
'ja':[u'{{半保護}}', u'{{保護}}', u'{{移動半保護}}', u'{{移動保護}}', None],
- #'zh':[u'{{Protected/semi}}',u'{{Protected}}',u'{{Protected/ms}}',u'{{Protected/move}}', None],
}
# Category where the bot will check
--
To view, visit https://gerrit.wikimedia.org/r/76521
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf3740fabb0f196748ba7541e1db601bdc804104
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Merlijn van Deen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76519
Change subject: Add initial .pep8 configuration file
......................................................................
Add initial .pep8 configuration file
Max line length is set to 256 - this is too long, but there are
*a lot* of scripts with very long lines. This allows us to fix the
most important ones first.
distribute_setup.py is externally-delivered and is thus ignored
externals/* should be ignored
user-config.py also should be ignored
all i18n files and date.py are basically databases-in-python-format
and therefore are exempt from pep8 rules
Change-Id: I1bba208a9277dbcacb0e2c2001e2dc3252e4b21b
---
A .pep8
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/19/76519/1
diff --git a/.pep8 b/.pep8
new file mode 100644
index 0000000..4827278
--- /dev/null
+++ b/.pep8
@@ -0,0 +1,3 @@
+[pep8]
+exclude = distribute_setup.py,externals,user-config.py,./scripts/i18n/*,./pywikibot/date.py
+max_line_length = 256
--
To view, visit https://gerrit.wikimedia.org/r/76519
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bba208a9277dbcacb0e2c2001e2dc3252e4b21b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
jenkins-bot has submitted this change and it was merged.
Change subject: RotatingFileHandler: Let the docstring make sense
......................................................................
RotatingFileHandler: Let the docstring make sense
Having files "app.2.log" and "app.2.log" didn't.
Change-Id: If96617cf7026ca33fded34e8a1f19db882f9b54f
---
M pywikibot/bot.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 4424cb9..355dfec 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -55,8 +55,8 @@
"app.log", you would get "app.log", "app.1.log", "app.2.log", ...
through to "app.5.log". The file being written to is always "app.log" -
when it gets filled up, it is closed and renamed to "app.1.log", and if
- files "app.2.log", "app.2.log" etc. exist, then they are renamed to
- "app.2.log", "app.3.log" etc. respectively.
+ files "app.1.log", "app.2.log" etc. already exist, then they are
+ renamed to "app.2.log", "app.3.log" etc. respectively.
If backupCount is >= 1 do not rotate but create new numbered filenames.
The newest file has the highest number except some older numbered files
where deleted and the bot was restarted. In this case the ordering
--
To view, visit https://gerrit.wikimedia.org/r/76488
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If96617cf7026ca33fded34e8a1f19db882f9b54f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mineo <themineo(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot
Mineo has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76488
Change subject: RotatingFileHandler: Let the docstring make sense
......................................................................
RotatingFileHandler: Let the docstring make sense
Having files "app.2.log" and "app.2.log" didn't.
Change-Id: If96617cf7026ca33fded34e8a1f19db882f9b54f
---
M pywikibot/bot.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/88/76488/1
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 4424cb9..355dfec 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -55,8 +55,8 @@
"app.log", you would get "app.log", "app.1.log", "app.2.log", ...
through to "app.5.log". The file being written to is always "app.log" -
when it gets filled up, it is closed and renamed to "app.1.log", and if
- files "app.2.log", "app.2.log" etc. exist, then they are renamed to
- "app.2.log", "app.3.log" etc. respectively.
+ files "app.1.log", "app.2.log" etc. already exist, then they are
+ renamed to "app.2.log", "app.3.log" etc. respectively.
If backupCount is >= 1 do not rotate but create new numbered filenames.
The newest file has the highest number except some older numbered files
where deleted and the bot was restarted. In this case the ordering
--
To view, visit https://gerrit.wikimedia.org/r/76488
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If96617cf7026ca33fded34e8a1f19db882f9b54f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mineo <themineo(a)gmail.com>
Merlijn van Deen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76486
Change subject: Updated pwb.py to better mirror direct script runs
......................................................................
Updated pwb.py to better mirror direct script runs
Before, execfile() ran the script in environment that pwb.py has, which
included os and path imports, and several other variables. Now, only
__file__, __name__ and __builtins__ are passed, which should be all that
is needed.
After this change, the effects of changeset 76484 can be seen using pwb.py
Change-Id: If9458fca50f07f08441dbb6e06f78bdbae2065de
---
M pwb.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/86/76486/1
diff --git a/pwb.py b/pwb.py
index 0327ab1..5f608bc 100644
--- a/pwb.py
+++ b/pwb.py
@@ -47,6 +47,6 @@
else:
raise Exception("%s not found!" % sys.argv[0])
sys.path.append(os.path.split(sys.argv[0])[0])
- execfile(sys.argv[0])
+ execfile(sys.argv[0], {'__name__': '__main__', '__builtins__': __builtins__, '__file__': sys.argv[0]})
else:
sys.argv.append('')
--
To view, visit https://gerrit.wikimedia.org/r/76486
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If9458fca50f07f08441dbb6e06f78bdbae2065de
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>