diff options
author | Paweł Jastrzębski <pawelj@vulturis.eu> | 2014-01-15 14:58:45 +0100 |
---|---|---|
committer | Paweł Jastrzębski <pawelj@vulturis.eu> | 2014-01-15 14:58:45 +0100 |
commit | cf3df581e1f1e9277eac1507b2fefeef304b038d (patch) | |
tree | 8f63509181ab355cbf6b38fb0cc5e0ef6118b820 /kcc-c2e.py | |
parent | Preliminary QT5 update (diff) | |
download | kcc-cf3df581e1f1e9277eac1507b2fefeef304b038d.tar.gz kcc-cf3df581e1f1e9277eac1507b2fefeef304b038d.tar.bz2 kcc-cf3df581e1f1e9277eac1507b2fefeef304b038d.zip |
Moved dependiences check out of module
Diffstat (limited to 'kcc-c2e.py')
-rw-r--r-- | kcc-c2e.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/kcc-c2e.py b/kcc-c2e.py index cfd6766..76dcf81 100644 --- a/kcc-c2e.py +++ b/kcc-c2e.py @@ -23,6 +23,34 @@ __license__ = 'ISC' __copyright__ = '2012-2013, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@vulturis.eu>' __docformat__ = 'restructuredtext en' +# Dependiences check +missing = [] +try: + # noinspection PyUnresolvedReferences + from psutil import TOTAL_PHYMEM, Popen +except ImportError: + missing.append('psutil') +try: + # noinspection PyUnresolvedReferences + from slugify import slugify +except ImportError: + missing.append('python-slugify') +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.comic2ebook import main, Copyright |