Utilities/__init__.py

changeset 1142
01ae8e2946d3
parent 1127
b1802ebe0066
child 1166
a94b0a2fafd7
diff -r 8d1aa04a8f62 -r 01ae8e2946d3 Utilities/__init__.py
--- a/Utilities/__init__.py	Tue Jun 28 19:23:57 2011 +0200
+++ b/Utilities/__init__.py	Tue Jun 28 20:03:20 2011 +0200
@@ -1287,6 +1287,31 @@
     global configDir
     configDir = os.path.expanduser(d)
 
+
+def checkPyside():
+    """
+    Module function to check the presence of PySide.
+    
+    @return flag indicating the presence of PySide (boolean)
+    """
+    interpreter = Preferences.getDebugger("PythonInterpreter")
+    if interpreter == "" or not isinpath(interpreter):
+        return False
+    
+    checker = os.path.join(getConfig('ericDir'),
+                           "UtilitiesPython2", "PySideImporter.py")
+    args = [checker]
+    proc = QProcess()
+    proc.setProcessChannelMode(QProcess.MergedChannels)
+    proc.start(interpreter, args)
+    finished = proc.waitForFinished(30000)
+    if finished:
+        if proc.exitCode() == 0:
+            return True
+    
+    return False
+
+
 ################################################################################
 # functions for environment handling
 ################################################################################

eric ide

mercurial