[Pkg-bitcoin-commits] [python-quamash] 150/269: Allow forcing Qt Implementation with environment variable

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository python-quamash.

commit 7474c3d8e9b86605a376af9b48d1aae2e71e7e23
Author: Mark Harviston <mark.harviston at gmail.com>
Date:   Sun Dec 7 15:07:29 2014 -0800

    Allow forcing Qt Implementation with environment variable
---
 quamash/__init__.py | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/quamash/__init__.py b/quamash/__init__.py
index 226e30c..c2d847b 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -18,15 +18,20 @@ from concurrent.futures import Future
 import logging
 logger = logging.getLogger('quamash')
 
-for QtModuleName in ('PyQt5', 'PyQt4', 'PySide'):
-	try:
-		QtModule = __import__(QtModuleName)
-	except ImportError:
-		continue
+try:
+	QtModuleName = os.environ['QUAMASH_QTIMPL']
+	logger.info('Forcing use of %s as Qt Implementation', QtModuleName)
+	QtModule = __import__(QtModuleName)
+except KeyError:
+	for QtModuleName in ('PyQt5', 'PyQt4', 'PySide'):
+		try:
+			QtModule = __import__(QtModuleName)
+		except ImportError:
+			continue
+		else:
+			break
 	else:
-		break
-else:
-	raise ImportError('No Qt implementations found')
+		raise ImportError('No Qt implementations found')
 
 logger.info('Using Qt Implementation: %s', QtModuleName)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/python-quamash.git



More information about the Pkg-bitcoin-commits mailing list