aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/__init__.py.in
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-05-22 16:44:51 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-05-22 17:49:10 +0200
commit39236c01ae6c9bc99ee3a02d8294679e12d9b734 (patch)
tree7ae55d4e33d5d34109ca7d014db791e73cddbcb5 /sources/pyside2/PySide2/__init__.py.in
parent315a9ce2e7b443fa7485ed8c21189e62fe2e2165 (diff)
move everying into sources/pyside2
in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.
Diffstat (limited to 'sources/pyside2/PySide2/__init__.py.in')
-rw-r--r--sources/pyside2/PySide2/__init__.py.in41
1 files changed, 41 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/__init__.py.in b/sources/pyside2/PySide2/__init__.py.in
new file mode 100644
index 000000000..5dd82ed9f
--- /dev/null
+++ b/sources/pyside2/PySide2/__init__.py.in
@@ -0,0 +1,41 @@
+__all__ = ['QtCore', 'QtGui', 'QtNetwork', 'QtOpenGL', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit', 'QtScript']
+__version__ = "@BINDING_API_VERSION_FULL@"
+__version_info__ = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @BINDING_API_MICRO_VERSION@, "@BINDING_API_RELEASE_LEVEL@", @BINDING_API_SERIAL@)
+
+
+def _setupQtDirectories():
+ import sys
+ import os
+ from . import _utils
+
+ pysideDir = _utils.get_pyside_dir()
+
+ # Register PySide qt.conf to override the built-in
+ # configuration variables, if there is no default qt.conf in
+ # executable folder
+ prefix = pysideDir.replace('\\', '/')
+ _utils.register_qt_conf(prefix=prefix,
+ binaries=prefix,
+ plugins=prefix+"/plugins",
+ imports=prefix+"/imports",
+ translations=prefix+"/translations")
+
+ # On Windows add the PySide\openssl folder (if it exists) to the
+ # PATH so the SSL DLLs can be found when Qt tries to dynamically
+ # load them. Tell Qt to load them and then reset the PATH.
+ if sys.platform == 'win32':
+ opensslDir = os.path.join(pysideDir, 'openssl')
+ if os.path.exists(opensslDir):
+ path = os.environ['PATH']
+ try:
+ os.environ['PATH'] = opensslDir + os.pathsep + path
+ try:
+ from . import QtNetwork
+ except ImportError:
+ pass
+ else:
+ QtNetwork.QSslSocket.supportsSsl()
+ finally:
+ os.environ['PATH'] = path
+
+_setupQtDirectories()