Beispiel #1
0
def test():
    """ Function to execute unitest
    """
    suite = unittest.TestLoader().loadTestsFromTestCase(
        TestDoubleSwitchPipeline)
    runtime = unittest.TextTestRunner(verbosity=2).run(suite)
    return runtime.wasSuccessful()


if __name__ == "__main__":
    print("RETURNCODE: ", test())

    if 0:
        import sys
        from soma.qt_gui import qt_backend
        qt_backend.set_qt_backend('PyQt4')
        from soma.qt_gui.qt_backend import QtGui
        from capsul.qt_gui.widgets import PipelineDevelopperView

        app = QtGui.QApplication(sys.argv)
        pipeline = DoubleSwitchPipeline1()
        pipeline.switch1 = "one"
        pipeline.switch2 = "one"
        view1 = PipelineDevelopperView(pipeline, show_sub_pipelines=True,
                                       allow_open_controller=True)
        view1.show()

        app.exec_()
        del view1

Beispiel #2
0
    suite = unittest.TestLoader().loadTestsFromTestCase(TestTemporary)
    runtime = unittest.TextTestRunner(verbosity=2).run(suite)
    return runtime.wasSuccessful()


if __name__ == "__main__":
    verbose = False
    if len(sys.argv) >= 2 and sys.argv[1] in ('-v', '--verbose'):
        verbose = True

    print("RETURNCODE: ", test())

    if verbose:
        import sys
        from soma.qt_gui import qt_backend
        qt_backend.set_qt_backend('PyQt4')
        from soma.qt_gui.qt_backend import QtGui
        from capsul.qt_gui.widgets import PipelineDevelopperView

        app = QtGui.QApplication(sys.argv)
        pipeline = DummyPipeline()
        pipeline.input = '/tmp/file_in.nii'
        pipeline.output = '/tmp/file_out3.nii'
        pipeline.nb_outputs = 3
        view1 = PipelineDevelopperView(pipeline,
                                       show_sub_pipelines=True,
                                       allow_open_controller=True)
        view1.show()
        app.exec_()
        del view1
Beispiel #3
0
from __future__ import print_function

# select Qt backend matching the one used by anatomist
import anatomist.direct.api
from soma.qt_gui import qt_backend

qt_backend.set_qt_backend(compatible_qt5=True)
print("qt backend:", qt_backend.get_qt_backend())

from soma.qt_gui.qt_backend import QtCore, QtGui, QtTest, Qt, QtWebKit
from soma.qt_gui.qt_backend import loadUi, loadUiType

# import sip
# API_VERSION = 2
# qt_api = ["QDate", "QDateTime", "QString", "QTextStream", "QTime", "QUrl", "QVariant"]
# for qt_module in qt_api:
# sip.setapi(qt_module, API_VERSION)

# try:
# import PyQt4
# except ImportError:
# raise Exception("error: missing PyQt dependency.")
# else:
# from PyQt4 import QtCore, QtGui, QtTest, Qt, QtWebKit

# import PyQt4.QtCore
# PyQt4.QtCore.Slot = PyQt4.QtCore.pyqtSlot
# PyQt4.QtCore.Signal = PyQt4.QtCore.pyqtSignal


# def loadUi(uifile, baseinstance=None):
Beispiel #4
0
    suite = unittest.TestLoader().loadTestsFromTestCase(TestTemporary)
    runtime = unittest.TextTestRunner(verbosity=2).run(suite)
    return runtime.wasSuccessful()


if __name__ == "__main__":
    verbose = False
    if len(sys.argv) >= 2 and sys.argv[1] in ('-v', '--verbose'):
        verbose = True

    print("RETURNCODE: ", test())

    if verbose:
        import sys
        from soma.qt_gui import qt_backend
        qt_backend.set_qt_backend(compatible_qt5=True)
        from soma.qt_gui.qt_backend import QtGui
        from capsul.qt_gui.widgets import PipelineDeveloperView

        app = QtGui.QApplication(sys.argv)
        pipeline = DummyPipeline()
        pipeline.input = '/tmp/file_in.nii'
        pipeline.output = '/tmp/file_out3.nii'
        pipeline.nb_outputs = 3
        view1 = PipelineDeveloperView(pipeline,
                                      show_sub_pipelines=True,
                                      allow_open_controller=True)
        view1.show()
        app.exec_()
        del view1
Beispiel #5
0
 def test_qtgui(self):
     from soma.qt_gui import qt_backend
     qt_backend.set_qt_backend(compatible_qt5=True)
     self.assertTrue(qt_backend.get_qt_backend() in ('PyQt4', 'PyQt5',
                                                     'PySide'))