eric6/Utilities/PySideImporter.py

Sat, 11 Apr 2020 14:13:25 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 11 Apr 2020 14:13:25 +0200
changeset 7522
e0e05a1b576f
parent 7360
9190402e4505
child 7635
0cdead130a81
permissions
-rw-r--r--

Styles: added some Qt style sheets and some highlighter styles.

# -*- coding: utf-8 -*-

# Copyright (c) 2011 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module to check for the presence of PySide/PySide2 by importing it.
"""

import sys

if __name__ == "__main__":
    pySideVariant = "2"
    if len(sys.argv) == 2:
        pySideVariant = sys.argv[1].replace("-", "")
    
    if pySideVariant == "1":
        try:
            import PySide       # __IGNORE_EXCEPTION__ __IGNORE_WARNING__
            ret = 0
        except ImportError:
            ret = 1
    
    elif pySideVariant == "2":
        try:
            import PySide2       # __IGNORE_EXCEPTION__ __IGNORE_WARNING__
            ret = 0
        except ImportError:
            ret = 1
    
    else:
        ret = 1
    
    sys.exit(ret)
    
#
# eflag: noqa = M702

eric ide

mercurial