yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #10205
[Branch ~yade-pkg/yade/git-trunk] Rev 3748: Modified error message if not yade.runtime.hasDisplay (bug #1241817)
------------------------------------------------------------
revno: 3748
committer: Jan Stransky <jan.stransky@xxxxxxxxxxx>
timestamp: Wed 2013-11-06 15:47:35 +0100
message:
Modified error message if not yade.runtime.hasDisplay (bug #1241817)
modified:
gui/qt4/__init__.py
--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'gui/qt4/__init__.py'
--- gui/qt4/__init__.py 2012-08-23 12:04:26 +0000
+++ gui/qt4/__init__.py 2013-11-06 14:47:35 +0000
@@ -1,6 +1,11 @@
# encoding: utf-8
import yade.runtime
-if not yade.runtime.hasDisplay: raise ImportError("Connecting to DISPLAY at Yade startup failed, unable to activate the qt4 interface.")
+if not yade.runtime.hasDisplay:
+ msg = "Connecting to DISPLAY at Yade startup failed, unable to activate the qt4 interface."
+ import os
+ 'YADE_BATCH' in os.environ:
+ msg += "\nDo not import qt when running in batch mode."
+ raise ImportError(msg)
from PyQt4.QtGui import *
from PyQt4 import QtCore