예제 #1
0
파일: shared.py 프로젝트: wiltonsr/kcc
def dependencyCheck(level):
    missing = []
    if level > 2:
        try:
            from PyQt5.QtCore import qVersion as qtVersion
            if StrictVersion('5.6.0') > StrictVersion(qtVersion()):
                missing.append('PyQt 5.6.0+')
        except ImportError:
            missing.append('PyQt 5.6.0+')
        try:
            import raven
        except ImportError:
            missing.append('raven 6.0.0+')
    if level > 1:
        try:
            from psutil import __version__ as psutilVersion
            if StrictVersion('5.0.0') > StrictVersion(psutilVersion):
                missing.append('psutil 5.0.0+')
        except ImportError:
            missing.append('psutil 5.0.0+')
        try:
            from slugify import __version__ as slugifyVersion
            if StrictVersion('1.2.1') > StrictVersion(slugifyVersion):
                missing.append('python-slugify 1.2.1+')
        except ImportError:
            missing.append('python-slugify 1.2.1+')
    try:
        from PIL import __version__ as pillowVersion
        if StrictVersion('5.2.0') > StrictVersion(pillowVersion):
            missing.append('Pillow 5.2.0+')
    except ImportError:
        missing.append('Pillow 5.2.0+')
    if len(missing) > 0:
        print('ERROR: ' + ', '.join(missing) + ' is not installed!')
        exit(1)
예제 #2
0
파일: shared.py 프로젝트: ciromattia/kcc
def dependencyCheck(level):
    missing = []
    if level > 2:
        try:
            from PyQt5.QtCore import qVersion as qtVersion
            if StrictVersion('5.6.0') > StrictVersion(qtVersion()):
                missing.append('PyQt 5.6.0+')
        except ImportError:
            missing.append('PyQt 5.6.0+')
        try:
            import raven
        except ImportError:
            missing.append('raven 6.0.0+')
    if level > 1:
        try:
            from psutil import __version__ as psutilVersion
            if StrictVersion('5.0.0') > StrictVersion(psutilVersion):
                missing.append('psutil 5.0.0+')
        except ImportError:
            missing.append('psutil 5.0.0+')
        try:
            from slugify import __version__ as slugifyVersion
            if StrictVersion('1.2.1') > StrictVersion(slugifyVersion):
                missing.append('python-slugify 1.2.1+')
        except ImportError:
            missing.append('python-slugify 1.2.1+')
    try:
        from PIL import __version__ as pillowVersion
        if StrictVersion('5.2.0') > StrictVersion(pillowVersion):
            missing.append('Pillow 5.2.0+')
    except ImportError:
        missing.append('Pillow 5.2.0+')
    if len(missing) > 0:
        print('ERROR: ' + ', '.join(missing) + ' is not installed!')
        exit(1)
예제 #3
0
파일: shared.py 프로젝트: ftanaka/kcc
def dependencyCheck(level):
    missing = []
    if level > 2:
        try:
            from PyQt5.QtCore import qVersion as qtVersion

            if StrictVersion("5.2.1") > StrictVersion(qtVersion()):
                missing.append("PyQt 5.2.1+")
        except ImportError:
            missing.append("PyQt 5.2.1+")
    if level > 1:
        try:
            from psutil import __version__ as psutilVersion

            if StrictVersion("3.2.2") > StrictVersion(psutilVersion):
                missing.append("psutil 3.2.2+")
        except ImportError:
            missing.append("psutil 3.2.2+")
        try:
            from slugify import __version__ as slugifyVersion

            if StrictVersion("1.1.4") > StrictVersion(slugifyVersion):
                missing.append("python-slugify 1.1.4+")
        except ImportError:
            missing.append("python-slugify 1.1.4+")
    try:
        from PIL import PILLOW_VERSION as pillowVersion

        if StrictVersion("3.0.0") > StrictVersion(pillowVersion):
            missing.append("Pillow 3.0.0+")
    except ImportError:
        missing.append("Pillow 3.0.0+")
    if version_info[1] < 5:
        try:
            from scandir import __version__ as scandirVersion

            if StrictVersion("1.1") > StrictVersion(scandirVersion):
                missing.append("scandir 1.1+")
        except ImportError:
            missing.append("scandir 1.1+")
    if len(missing) > 0:
        print("ERROR: " + ", ".join(missing) + " is not installed!")
        exit(1)
예제 #4
0
파일: shared.py 프로젝트: Napear/kcc
def dependencyCheck(level):
    missing = []
    if level > 2:
        try:
            from PyQt5.QtCore import qVersion as qtVersion
            if StrictVersion('5.6.0') > StrictVersion(qtVersion()):
                missing.append('PyQt 5.6.0+')
        except ImportError:
            missing.append('PyQt 5.6.0+')
        try:
            import raven
        except ImportError:
            missing.append('raven 5.13.0+')
    if level > 1:
        try:
            from psutil import __version__ as psutilVersion
            if StrictVersion('4.1.0') > StrictVersion(psutilVersion):
                missing.append('psutil 4.1.0+')
        except ImportError:
            missing.append('psutil 4.1.0+')
        try:
            from slugify import __version__ as slugifyVersion
            if StrictVersion('1.2.0') > StrictVersion(slugifyVersion):
                missing.append('python-slugify 1.2.0+')
        except ImportError:
            missing.append('python-slugify 1.2.0+')
    try:
        from PIL import PILLOW_VERSION as pillowVersion
        if StrictVersion('3.2.0') > StrictVersion(pillowVersion):
            missing.append('Pillow 3.2.0+')
    except ImportError:
        missing.append('Pillow 3.2.0+')
    if version_info[1] < 5:
        try:
            from scandir import __version__ as scandirVersion
            if StrictVersion('1.2') > StrictVersion(scandirVersion):
                missing.append('scandir 1.2+')
        except ImportError:
            missing.append('scandir 1.2+')
    if len(missing) > 0:
        print('ERROR: ' + ', '.join(missing) + ' is not installed!')
        exit(1)
예제 #5
0
파일: shared.py 프로젝트: houcheng/kcc
def dependencyCheck(level):
    missing = []
    if level > 2:
        try:
            from PyQt5.QtCore import qVersion as qtVersion
            if StrictVersion('5.6.0') > StrictVersion(qtVersion()):
                missing.append('PyQt 5.6.0+')
        except ImportError:
            missing.append('PyQt 5.6.0+')
        try:
            import raven
        except ImportError:
            missing.append('raven 5.13.0+')
    if level > 1:
        try:
            from psutil import __version__ as psutilVersion
            if StrictVersion('4.1.0') > StrictVersion(psutilVersion):
                missing.append('psutil 4.1.0+')
        except ImportError:
            missing.append('psutil 4.1.0+')
        try:
            from slugify import __version__ as slugifyVersion
            if StrictVersion('1.2.0') > StrictVersion(slugifyVersion):
                missing.append('python-slugify 1.2.0+')
        except ImportError:
            missing.append('python-slugify 1.2.0+')
    try:
        from PIL import PILLOW_VERSION as pillowVersion
        if StrictVersion('3.2.0') > StrictVersion(pillowVersion):
            missing.append('Pillow 3.2.0+')
    except ImportError:
        missing.append('Pillow 3.2.0+')
    if version_info[1] < 5:
        try:
            from scandir import __version__ as scandirVersion
            if StrictVersion('1.2') > StrictVersion(scandirVersion):
                missing.append('scandir 1.2+')
        except ImportError:
            missing.append('scandir 1.2+')
    if len(missing) > 0:
        print('ERROR: ' + ', '.join(missing) + ' is not installed!')
        exit(1)
예제 #6
0
파일: shared.py 프로젝트: OpenNingia/kcc
def dependencyCheck(level):
    missing = []
    if level > 2:
        try:
            from PyQt5.QtCore import qVersion as qtVersion
            if StrictVersion('5.2.0') > StrictVersion(qtVersion()):
                missing.append('PyQt 5.2.0+')
        except ImportError:
            missing.append('PyQt 5.2.0+')
    if level > 1:
        try:
            from psutil import __version__ as psutilVersion
            if StrictVersion('2.0.0') > StrictVersion(psutilVersion):
                missing.append('psutil 2.0.0+')
        except ImportError:
            missing.append('psutil 2.0.0+')
        try:
            from slugify import __version__ as slugifyVersion
            if StrictVersion('0.1.0') > StrictVersion(slugifyVersion):
                missing.append('python-slugify 0.1.0+')
        except ImportError:
            missing.append('python-slugify 0.1.0+')
    try:
        from PIL import PILLOW_VERSION as pillowVersion
        if StrictVersion('2.7.0') > StrictVersion(pillowVersion):
            missing.append('Pillow 2.7.0+')
    except ImportError:
        missing.append('Pillow 2.7.0+')
    if len(missing) > 0:
        try:
            import tkinter
            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)