Commit e8c06788 authored by bonnell's avatar bonnell
Browse files

Update pyside2 version. Update visit_utils tests to import PySide2, and to...

Update pyside2 version. Update visit_utils tests to import PySide2, and to ensure _output dir exists.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@31452 18c085ea-50e0-402c-830e-de6fd14e8384
parent e280f96f
...@@ -46,11 +46,11 @@ function bv_pyside_initialize_vars ...@@ -46,11 +46,11 @@ function bv_pyside_initialize_vars
unset PYSIDE_FILE unset PYSIDE_FILE
unset PYSIDE_BUILD_DIR unset PYSIDE_BUILD_DIR
unset PYSIDE_MD5_CHECKSUM unset PYSIDE_MD5_CHECKSUM
export PYSIDE_VERSION=${PYSIDE_VERSION:-"2.0.0-2017.02.14"} export PYSIDE_VERSION=${PYSIDE_VERSION:-"2.0.0-2017.08.30"}
export PYSIDE_FILE=${PYSIDE_FILE:-"pyside2-combined.2017.02.14.tar.gz"} export PYSIDE_FILE=${PYSIDE_FILE:-"pyside2-combined.2017.08.30.tar.gz"}
export PYSIDE_BUILD_DIR=${PYSIDE_BUILD_DIR:-"pyside2-combined"} export PYSIDE_BUILD_DIR=${PYSIDE_BUILD_DIR:-"pyside2-combined"}
export PYSIDE_MD5_CHECKSUM="" export PYSIDE_MD5_CHECKSUM=""
elif [[ "$IS_QT5" == "no" && "$PYSIDE_VERSION" == "2.0.0-2017.02.14" ]]; then elif [[ "$IS_QT5" == "no" && "$PYSIDE_VERSION" == "2.0.0-2017.08.30" ]]; then
unset PYSIDE_VERSION unset PYSIDE_VERSION
unset PYSIDE_FILE unset PYSIDE_FILE
unset PYSIDE_BUILD_DIR unset PYSIDE_BUILD_DIR
...@@ -65,8 +65,8 @@ function bv_pyside_initialize_vars ...@@ -65,8 +65,8 @@ function bv_pyside_initialize_vars
function bv_pyside_info function bv_pyside_info
{ {
if [[ "$IS_QT5" == "yes" ]]; then if [[ "$IS_QT5" == "yes" ]]; then
export PYSIDE_VERSION=${PYSIDE_VERSION:-"2.0.0-2017.02.14"} export PYSIDE_VERSION=${PYSIDE_VERSION:-"2.0.0-2017.08.30"}
export PYSIDE_FILE=${PYSIDE_FILE:-"pyside2-combined.2017.02.14.tar.gz"} export PYSIDE_FILE=${PYSIDE_FILE:-"pyside2-combined.2017.08.30.tar.gz"}
export PYSIDE_BUILD_DIR=${PYSIDE_BUILD_DIR:-"pyside2-combined"} export PYSIDE_BUILD_DIR=${PYSIDE_BUILD_DIR:-"pyside2-combined"}
export PYSIDE_MD5_CHECKSUM="" export PYSIDE_MD5_CHECKSUM=""
export PYSIDE_SHA256_CHECKSUM="" export PYSIDE_SHA256_CHECKSUM=""
......
...@@ -48,6 +48,7 @@ if(VISIT_QT5) ...@@ -48,6 +48,7 @@ if(VISIT_QT5)
set(pyside_qt_includes set(pyside_qt_includes
${Qt5Core_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5OpenGL_INCLUDE_DIRS}) ${Qt5OpenGL_INCLUDE_DIRS})
else() else()
set(pyside_qt_includes set(pyside_qt_includes
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<typesystem package="pyside_gui"> <typesystem package="pyside_gui">
<load-typesystem name="typesystem_core.xml" generate="no"/> <load-typesystem name="typesystem_core.xml" generate="no"/>
<load-typesystem name="typesystem_gui.xml" generate="no"/> <load-typesystem name="typesystem_gui.xml" generate="no"/>
<load-typesystem name="typesystem_widgets.xml" generate="no"/>
<load-typesystem name="typesystem_opengl.xml" generate="no"/> <load-typesystem name="typesystem_opengl.xml" generate="no"/>
<!-- <!--
......
...@@ -61,7 +61,7 @@ except: ...@@ -61,7 +61,7 @@ except:
try: try:
import PySide.QtCore import PySide2.QtCore
__pyside_imported = True __pyside_imported = True
except: except:
__pyside_imported = False __pyside_imported = False
......
...@@ -50,8 +50,9 @@ import xinit ...@@ -50,8 +50,9 @@ import xinit
try: try:
from PySide.QtCore import * from PySide2.QtCore import *
from PySide.QtGui import * from PySide2.QtGui import *
from PySide2.QtWidgets import *
except: except:
QWidget = object QWidget = object
......
...@@ -48,8 +48,8 @@ import time ...@@ -48,8 +48,8 @@ import time
from math import * from math import *
try: try:
from PySide.QtCore import * from PySide2.QtCore import *
from PySide.QtGui import * from PySide2.QtGui import *
except: except:
pass pass
......
...@@ -49,7 +49,7 @@ from visit_test import * ...@@ -49,7 +49,7 @@ from visit_test import *
from visit_utils.qannote import * from visit_utils.qannote import *
try: try:
import PySide.QtCore import PySide2.QtCore
except: except:
pass pass
...@@ -57,6 +57,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output") ...@@ -57,6 +57,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output")
data_dir = pjoin(os.path.split(__file__)[0],"_data") data_dir = pjoin(os.path.split(__file__)[0],"_data")
def out_path(fname): def out_path(fname):
if not os.path.isdir(output_dir):
os.mkdir(output_dir)
odir = pjoin(output_dir,"qannote") odir = pjoin(output_dir,"qannote")
if not os.path.isdir(odir): if not os.path.isdir(odir):
os.mkdir(odir) os.mkdir(odir)
......
...@@ -50,7 +50,7 @@ from visit_test import * ...@@ -50,7 +50,7 @@ from visit_test import *
from visit_utils.qannote import * from visit_utils.qannote import *
try: try:
import PySide.QtCore import PySide2.QtCore
except: except:
pass pass
...@@ -59,6 +59,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output") ...@@ -59,6 +59,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output")
data_dir = pjoin(os.path.split(__file__)[0],"_data") data_dir = pjoin(os.path.split(__file__)[0],"_data")
def out_path(fname): def out_path(fname):
if not os.path.isdir(output_dir):
os.mkdir(output_dir)
odir = pjoin(output_dir,"qannote") odir = pjoin(output_dir,"qannote")
if not os.path.isdir(odir): if not os.path.isdir(odir):
os.mkdir(odir) os.mkdir(odir)
......
...@@ -50,7 +50,7 @@ from visit_test import * ...@@ -50,7 +50,7 @@ from visit_test import *
from visit_utils.qannote import * from visit_utils.qannote import *
try: try:
import PySide.QtCore import PySide2.QtCore
except: except:
pass pass
...@@ -59,6 +59,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output") ...@@ -59,6 +59,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output")
data_dir = pjoin(os.path.split(__file__)[0],"_data") data_dir = pjoin(os.path.split(__file__)[0],"_data")
def out_path(fname): def out_path(fname):
if not os.path.isdir(output_dir):
os.mkdir(output_dir)
odir = pjoin(output_dir,"qannote") odir = pjoin(output_dir,"qannote")
if not os.path.isdir(odir): if not os.path.isdir(odir):
os.mkdir(odir) os.mkdir(odir)
......
...@@ -49,7 +49,7 @@ from visit_test import * ...@@ -49,7 +49,7 @@ from visit_test import *
from visit_utils.qannote import * from visit_utils.qannote import *
try: try:
import PySide.QtCore import PySide2.QtCore
except: except:
pass pass
...@@ -58,6 +58,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output") ...@@ -58,6 +58,8 @@ output_dir = pjoin(os.path.split(__file__)[0],"_output")
data_dir = pjoin(os.path.split(__file__)[0],"_data") data_dir = pjoin(os.path.split(__file__)[0],"_data")
def out_path(fname): def out_path(fname):
if not os.path.isdir(output_dir):
os.mkdir(output_dir)
odir = pjoin(output_dir,"qannote") odir = pjoin(output_dir,"qannote")
if not os.path.isdir(odir): if not os.path.isdir(odir):
os.mkdir(odir) os.mkdir(odir)
......
...@@ -18,7 +18,7 @@ from visit_test import * ...@@ -18,7 +18,7 @@ from visit_test import *
from visit_utils.qplot import * from visit_utils.qplot import *
try: try:
import PySide.QtCore import PySide2.QtCore
except: except:
pass pass
...@@ -39,6 +39,8 @@ def patch_scene_input(in_fname,ult_fname): ...@@ -39,6 +39,8 @@ def patch_scene_input(in_fname,ult_fname):
class TestScene(unittest.TestCase): class TestScene(unittest.TestCase):
def setUp(self): def setUp(self):
if not os.path.isdir(output_dir):
os.mkdir(output_dir)
self.curves = ult.Curve.load(pjoin(data_dir,"sine.ult")) self.curves = ult.Curve.load(pjoin(data_dir,"sine.ult"))
def test_01_basic(self): def test_01_basic(self):
crv = ult.Curve.load(pjoin(data_dir,"pattern.ult"))[0] crv = ult.Curve.load(pjoin(data_dir,"pattern.ult"))[0]
......
...@@ -66,7 +66,7 @@ def pyside_test(fn): ...@@ -66,7 +66,7 @@ def pyside_test(fn):
we aren't running in the cli. we aren't running in the cli.
""" """
def run_fn(*args): def run_fn(*args):
if "PySide.QtCore" in sys.modules.keys(): if "PySide2.QtCore" in sys.modules.keys():
return fn(*args) return fn(*args)
else: else:
print "[PySide not found, skipping test that requires PySide]" print "[PySide not found, skipping test that requires PySide]"
......
...@@ -63,32 +63,32 @@ from evalfuncs import * ...@@ -63,32 +63,32 @@ from evalfuncs import *
from writescript import * from writescript import *
try: try:
import PySide import PySide2
import pyside_hook import pyside_hook
import pyside_gui import pyside_gui
import pyside_support import pyside_support
class KeyPressEater(PySide.QtCore.QObject): class KeyPressEater(PySide2.QtCore.QObject):
def eventFilter(self, obj, event): def eventFilter(self, obj, event):
if event.type() == PySide.QtCore.QEvent.KeyPress: if event.type() == PySide2.QtCore.QEvent.KeyPress:
return True return True
elif event.type() == PySide.QtCore.QEvent.MouseButtonPress: elif event.type() == PySide2.QtCore.QEvent.MouseButtonPress:
return True return True
elif event.type() == PySide.QtCore.QEvent.MouseButtonRelease: elif event.type() == PySide2.QtCore.QEvent.MouseButtonRelease:
return True return True
elif event.type() == PySide.QtCore.QEvent.MouseButtonDblClick: elif event.type() == PySide2.QtCore.QEvent.MouseButtonDblClick:
return True return True
elif event.type() == PySide.QtCore.QEvent.MouseMove: elif event.type() == PySide2.QtCore.QEvent.MouseMove:
return True return True
else: else:
return PySide.QtCore.QObject.eventFilter(self, obj, event) return PySide2.QtCore.QObject.eventFilter(self, obj, event)
def __VisIt_PySide_Idle_Hook__(): def __VisIt_PySide_Idle_Hook__():
a = KeyPressEater() a = KeyPressEater()
app = PySide.QtCore.QEventLoop(); app = PySide2.QtCore.QEventLoop();
PySide.QtCore.QCoreApplication.instance().installEventFilter(a) PySide2.QtCore.QCoreApplication.instance().installEventFilter(a)
app.processEvents(PySide.QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents); app.processEvents(PySide2.QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents);
PySide.QtCore.QCoreApplication.instance().removeEventFilter(a) PySide2.QtCore.QCoreApplication.instance().removeEventFilter(a)
def IsPySideViewerEnabled(): return True def IsPySideViewerEnabled(): return True
except ImportError: except ImportError:
......
...@@ -54,7 +54,7 @@ from threading import Event, Thread ...@@ -54,7 +54,7 @@ from threading import Event, Thread
using_pyside = False using_pyside = False
try: try:
from PySide.QtGui import QApplication from PySide2.QtWidgets import QApplication
import pyside_hook import pyside_hook
import pyside_gui import pyside_gui
using_pyside = True using_pyside = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment