jenkins-bot has submitted this change and it was merged.
Change subject: Add default config for flickrripper
......................................................................
Add default config for flickrripper
Copied the config options from compat.
Moved handle_args to beginning of main(), so arguments are
parsed before missing flickr api key check can cause script
to fail. This allows -help to display even if the flickr
api key is not present.
Bug: 68606
Change-Id: I5320fc6df63fe9cdf233f63544119d339a4a3f8d
---
M pywikibot/config2.py
M scripts/flickrripper.py
M tests/script_tests.py
3 files changed, 14 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 18ea59c..4d74265 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -537,6 +537,16 @@
#
http://www.bing.com/dev/en-us/dev-center
msn_appid = ''
+# ############# FLICKR RIPPER SETTINGS ##############
+
+# Using the Flickr api
+flickr = {
+ 'api_key': u'', # Provide your key!
+ 'api_secret': u'', # Api secret of your key (optional)
+ 'review': False, # Do we use automatically make our uploads reviewed?
+ 'reviewer': u'', # If so, under what reviewer name?
+}
+
# ############# COPYRIGHT SETTINGS ##############
# Enable/disable search engine in copyright.py script
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 514a15b..d1faf67 100644
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -492,6 +492,8 @@
@param args: command line arguments
@type args: list of unicode
"""
+ local_args = pywikibot.handle_args(args)
+
# Get the api key
if not config.flickr['api_key']:
pywikibot.output('Flickr api key not found! Get yourself an api key')
@@ -541,7 +543,7 @@
# Should be renamed to overrideLicense or something like that
override = u''
- for arg in pywikibot.handle_args(args):
+ for arg in local_args:
if arg.startswith('-group_id'):
if len(arg) == 9:
group_id = pywikibot.input(u'What is the group_id of the pool?')
diff --git a/tests/script_tests.py b/tests/script_tests.py
index b46e647..7605708 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -345,7 +345,6 @@
dct[test_name] = test_execution(script_name, ['-help'])
if script_name in ['shell', 'version',
'data_ingestion', # bug 68611
- 'flickrripper', # bug 68606 (and others)
'replicate_wiki', # bug 68664
'script_wui', # Failing on travis-ci
]:
@@ -372,7 +371,7 @@
if script_name in ['catall', # stdout user interaction
'checkimages', # bug 68613
'data_ingestion', # bug 68611
- 'flickrripper', # bug 68606 (and deps)
+ 'flickrripper', # Requires a flickr api key
'lonelypages', # custom return codes
'nowcommons', # deprecation warning
'replicate_wiki', # custom return codes
--
To view, visit
https://gerrit.wikimedia.org/r/170646
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5320fc6df63fe9cdf233f63544119d339a4a3f8d
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>