about summary refs log tree commit diff
path: root/kcc-c2e.py
diff options
context:
space:
mode:
authorPaweł Jastrzębski <pawelj@iosphe.re>2015-01-03 09:41:07 +0100
committerPaweł Jastrzębski <pawelj@iosphe.re>2015-01-04 09:09:33 +0100
commit147d815057a5d0dfbeab2de54e7f9730f72dce13 (patch)
tree9924ca399d1cdb611aaad0b11f33cfee5fa61c54 /kcc-c2e.py
parentImproved 7zip detection (diff)
downloadkcc-147d815057a5d0dfbeab2de54e7f9730f72dce13.tar.gz
kcc-147d815057a5d0dfbeab2de54e7f9730f72dce13.tar.bz2
kcc-147d815057a5d0dfbeab2de54e7f9730f72dce13.zip
Code cleanup
Diffstat (limited to 'kcc-c2e.py')
-rwxr-xr-xkcc-c2e.py39
1 files changed, 4 insertions, 35 deletions
diff --git a/kcc-c2e.py b/kcc-c2e.py
index bbc22b2..5bc3680 100755
--- a/kcc-c2e.py
+++ b/kcc-c2e.py
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 #
 # Copyright (c) 2012-2014 Ciro Mattia Gonano <ciromattia@gmail.com>
-# Copyright (c) 2013-2014 Pawel Jastrzebski <pawelj@iosphe.re>
+# Copyright (c) 2013-2015 Pawel Jastrzebski <pawelj@iosphe.re>
 #
 # Permission to use, copy, modify, and/or distribute this software for
 # any purpose with or without fee is hereby granted, provided that the
@@ -20,7 +20,7 @@
 
 __version__ = '4.3.1'
 __license__ = 'ISC'
-__copyright__ = '2012-2014, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>'
+__copyright__ = '2012-2015, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>'
 __docformat__ = 'restructuredtext en'
 
 import sys
@@ -28,39 +28,8 @@ if sys.version_info[0] != 3:
     print('ERROR: This is Python 3 script!')
     exit(1)
 
-# Dependency check
-missing = []
-try:
-    # noinspection PyUnresolvedReferences
-    import psutil
-    if tuple(map(int, ('2.0.0'.split(".")))) > tuple(map(int, psutil.version_info)):
-        missing.append('psutil 2.0.0+')
-except ImportError:
-    missing.append('psutil 2.0.0+')
-try:
-    # noinspection PyUnresolvedReferences
-    import PIL
-    if tuple(map(int, ('2.7.0'.split(".")))) > tuple(map(int, (PIL.PILLOW_VERSION.split(".")))):
-        missing.append('Pillow 2.7.0+')
-except ImportError:
-    missing.append('Pillow 2.7.0+')
-try:
-    # noinspection PyUnresolvedReferences
-    import slugify
-except ImportError:
-    missing.append('python-slugify')
-if len(missing) > 0:
-    try:
-        # noinspection PyUnresolvedReferences
-        import tkinter
-        # noinspection PyUnresolvedReferences
-        import tkinter.messagebox
-        importRoot = tkinter.Tk()
-        importRoot.withdraw()
-        tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!')
-    except ImportError:
-        print('ERROR: ' + ', '.join(missing) + ' is not installed!')
-    exit(1)
+from kcc.shared import dependencyCheck
+dependencyCheck(2)
 
 from multiprocessing import freeze_support
 from kcc.comic2ebook import main