From cf3df581e1f1e9277eac1507b2fefeef304b038d Mon Sep 17 00:00:00 2001 From: Paweł Jastrzębski Date: Wed, 15 Jan 2014 14:58:45 +0100 Subject: Moved dependiences check out of module --- kcc-c2p.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'kcc-c2p.py') diff --git a/kcc-c2p.py b/kcc-c2p.py index d112569..a8463d4 100644 --- a/kcc-c2p.py +++ b/kcc-c2p.py @@ -23,6 +23,24 @@ __license__ = 'ISC' __copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski ' __docformat__ = 'restructuredtext en' +# Dependiences check +missing = [] +try: + # noinspection PyUnresolvedReferences + from PIL import Image, ImageOps, ImageStat, ImageChops + if tuple(map(int, ('2.3.0'.split(".")))) > tuple(map(int, (Image.PILLOW_VERSION.split(".")))): + missing.append('Pillow 2.3.0+') +except ImportError: + missing.append('Pillow 2.3.0+') +if len(missing) > 0: + print('ERROR: ' + ', '.join(missing) + ' is not installed!') + import tkinter + import tkinter.messagebox + importRoot = tkinter.Tk() + importRoot.withdraw() + tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!') + exit(1) + import sys from multiprocessing import freeze_support from kcc.comic2panel import main, Copyright -- cgit 1.4.1