jenkins-bot has submitted this change and it was merged.
Change subject: Move import pywikibot after third-party libraries
......................................................................
Move import pywikibot after third-party libraries
Change-Id: Ie3885f5be1706a356bc598e8e2be1c8aa5d71c17
---
M scripts/flickrripper.py
1 file changed, 15 insertions(+), 15 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 7a372b0..f1bdf28 100644
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -45,11 +45,6 @@
else:
from urllib import urlencode, urlopen
-import pywikibot
-
-from pywikibot import config, textlib
-from scripts import upload
-
try:
if sys.version_info[0] > 2:
from tkinter import (
@@ -61,31 +56,36 @@
Tk, Label, Entry, Scrollbar, Text, Button,
END, VERTICAL, NORMAL, WORD
)
-except ImportError:
- pywikibot.error(
+except ImportError as e:
+ print(
'This script requires Tkinter, which is typically part of Python,\n'
'but may be packaged separately on your platform.\n'
'See:
https://www.mediawiki.org/wiki/Manual:Pywikibot/flickrripper.py')
- pywikibot.exception()
+ print(e)
sys.exit()
try:
from PIL import Image, ImageTk
-except ImportError:
- pywikibot.error(
+except ImportError as e:
+ print(
'This script requires ImageTk from the Python Imaging Library (PIL).\n'
'See:
https://www.mediawiki.org/wiki/Manual:Pywikibot/flickrripper.py')
- pywikibot.exception()
+ print(e)
sys.exit()
try:
import flickrapi # see:
http://stuvel.eu/projects/flickrapi
-except ImportError:
- pywikibot.error('This script requires the python flickrapi module')
- pywikibot.error('See:
http://stuvel.eu/projects/flickrapi')
- pywikibot.exception()
+except ImportError as e:
+ print('This script requires the python flickrapi module. \n'
+ 'See:
http://stuvel.eu/projects/flickrapi')
+ print(e)
sys.exit()
+import pywikibot
+
+from pywikibot import config, textlib
+from scripts import upload
+
flickr_allowed_license = {
0: False, # All Rights Reserved
1: False, # Creative Commons Attribution-NonCommercial-ShareAlike License
--
To view, visit
https://gerrit.wikimedia.org/r/171167
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3885f5be1706a356bc598e8e2be1c8aa5d71c17
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: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>