jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] upload: Scan directory non-recursively
......................................................................
[FEAT] upload: Scan directory non-recursively
Adds an `-recursive` option to scan a directory recursively (the current
default state) and otherwise it just scans the files in a directory.
Change-Id: I5127196ac2554cebd56286bb18b182b4999625b6
---
M scripts/upload.py
1 file changed, 8 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/upload.py b/scripts/upload.py
index 29eaf4a..fbf4c10 100755
--- a/scripts/upload.py
+++ b/scripts/upload.py
@@ -27,6 +27,8 @@
is defined for all. It will also require a valid file name and
description. It'll only overwrite files if -ignorewarn includes
the 'exists' warning.
+ -recursive When the filename is a directory it also uploads the files from
+ the subdirectories.
It is possible to combine -abortonwarn and -ignorewarn so that if the specific
warning is given it won't apply the general one but more specific one. So if it
@@ -513,6 +515,7 @@
chunk_size = 0
chunk_size_regex = r'^-chunked(?::(\d+(?:\.\d+)?)[ \t]*(k|ki|m|mi)?b?)?$'
chunk_size_regex = re.compile(chunk_size_regex, re.I)
+ recursive = False
# process all global bot args
# returns a list of non-global args, i.e. args for upload.py
@@ -522,6 +525,8 @@
keepFilename = True
always = True
verifyDescription = False
+ elif arg == '-recursive':
+ recursive = True
elif arg.startswith('-keep'):
keepFilename = True
elif arg.startswith('-filename:'):
@@ -598,6 +603,9 @@
if os.path.isdir(url):
file_list = []
for directory_info in os.walk(url):
+ if not recursive:
+ # Do not visit any subdirectories
+ directory_info[1][:] = []
for dir_file in directory_info[2]:
file_list.append(os.path.join(directory_info[0], dir_file))
url = file_list
--
To view, visit https://gerrit.wikimedia.org/r/235248
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5127196ac2554cebd56286bb18b182b4999625b6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2788
Status: Fixed
Duration: 25 minutes and 6 seconds
Commit: 9ce4a86 (master)
Author: Fabian Neundorf
Message: [IMPROV] site_tests: Simplify messages test
The test in 21a67b2f was doing three different assertions and the last
assertion required the first two anyway. And the last assertion actually will
produce the most comprehensible output when it fails.
This is now also testing that no deprecation occurs when the special `*` key is
not used.
Change-Id: I1757d3bdad9ac229b838ce6ab35b30bc7520305c
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/89fc4c263231...9ce4a86c…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/79046122
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] site_tests: Simplify messages test
......................................................................
[IMPROV] site_tests: Simplify messages test
The test in 21a67b2f was doing three different assertions and the last
assertion required the first two anyway. And the last assertion actually will
produce the most comprehensible output when it fails.
This is now also testing that no deprecation occurs when the special `*` key is
not used.
Change-Id: I1757d3bdad9ac229b838ce6ab35b30bc7520305c
---
M tests/site_tests.py
M tests/utils.py
2 files changed, 6 insertions(+), 8 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index ca22832..9f304fd 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -160,15 +160,13 @@
def test_messages_star(self):
"""Test that fetching all messages is deprecated."""
# Load all messages and check that '*' is not a valid key.
- mysite = self.site
- self.assertIsInstance(mysite.mediawiki_messages('*'), dict)
+ self.assertEqual(self.site.mediawiki_messages('*'),
+ {'*': 'dummy entry'})
self.assertOneDeprecationParts('mediawiki_messages("*")',
'specific messages')
-
- self.assertEqual(len(mysite.mediawiki_messages(['*'])), 1)
- self.assertOneDeprecation()
- self.assertEqual(mysite.mediawiki_messages('*'), {'*': 'dummy entry'})
- self.assertOneDeprecation()
+ self.assertEqual(self.site.mediawiki_messages(['hello']),
+ {'hello': 'world'})
+ self.assertNoDeprecation()
class TestBaseSiteProperties(TestCase):
diff --git a/tests/utils.py b/tests/utils.py
index 54731af..8fe7315 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -348,7 +348,7 @@
if self.family.name == 'wikisource':
extensions.append({'name': 'ProofreadPage'})
self._siteinfo._cache['extensions'] = (extensions, True)
- self._msgcache = {'*': 'dummy entry'}
+ self._msgcache = {'*': 'dummy entry', 'hello': 'world'}
def _build_namespaces(self):
return Namespace.builtin_namespaces(case=self.siteinfo['case'])
--
To view, visit https://gerrit.wikimedia.org/r/236488
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1757d3bdad9ac229b838ce6ab35b30bc7520305c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Update WOW subdomains
......................................................................
Update WOW subdomains
Several WOW subdomain overrides are not necessary
en: www.wowwiki.com and en.wow.wikia.com redirect to wowwiki.wikia.com
da: da.wowwiki.com and da.wow.wikia.com redirect to da.wowwiki.wikia.com
fr: fr.wowwiki.com and fr.wow.wikia.com redirect to fr.wowwiki.wikia.com
no: no.wowwiki.com and no.wow.wikia.com redirect to no.wowwiki.wikia.com
Use the default <lang>.wow.wikia.com for all of them.
Add some information about the remaining override for 'sv'.
Change-Id: I2511dc1487518dc364e50af7597471fb2f5f763b
---
M pywikibot/families/wowwiki_family.py
1 file changed, 3 insertions(+), 7 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py
index f9e4dba..75d2117 100644
--- a/pywikibot/families/wowwiki_family.py
+++ b/pywikibot/families/wowwiki_family.py
@@ -26,13 +26,9 @@
def __init__(self):
"""Constructor."""
super(Family, self).__init__()
- self.langs.update({
- 'en': 'www.wowwiki.com',
- 'da': 'da.wowwiki.com',
- 'fr': 'fr.wowwiki.com',
- 'no': 'no.wowwiki.com',
- 'sv': 'sv.warcraft.wikia.com',
- })
+ # Override 'sv'. http://sv.wow.wikia.com is an empty wiki.
+ # The interwikimap in this family map 'sv' to this empty wiki.
+ self.langs['sv'] = 'sv.warcraft.wikia.com'
self.disambiguationTemplates['en'] = ['disambig', 'disambig/quest',
'disambig/quest2',
--
To view, visit https://gerrit.wikimedia.org/r/236395
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2511dc1487518dc364e50af7597471fb2f5f763b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>