Ejemplo n.º 1
0
def main():
    # Debug info
    print 'Python version: '+str(sys.version_info)
    print '%s version: %s' % (qt4_backend,qt4_backend_version)
    print 'Qt version: '+QtCore.qVersion()
    print 'xml version: '+xml.__version__

    # Create the application and enter the main message loop.
    createQApp = QtGui.QApplication.startingUp()
    if createQApp:
        app = QtGui.QApplication([" "])
    else:
        app = QtGui.qApp

    import xmlplot.gui_qt4

    # Create wizard dialog
    wiz = commonqt.Wizard(headerlogo='./logo.png')
    wiz.setWindowTitle('Scenario builder')
    wiz.resize(800, 600)

    seq = commonqt.WizardSequence([PageOpen,SequenceEditScenario(),PageFinal])
    wiz.setSequence(seq)

    wiz.show()

    ret = app.exec_()
    
    scenario = wiz.getProperty('scenario')
    if scenario is not None: scenario.addref()

    wiz.destroy()

    return scenario
Ejemplo n.º 2
0
def main():
    # Debug info
    print 'Python version: '+str(sys.version_info)
    print '%s version: %s' % (qt4_backend,qt4_backend_version)
    print 'Qt version: '+QtCore.qVersion()
    print 'xml version: '+xml.__version__

    # Create the application and enter the main message loop.
    createQApp = QtGui.QApplication.startingUp()
    if createQApp:
        app = QtGui.QApplication([' '])
    else:
        app = QtGui.qApp

    # Create wizard dialog
    wiz = commonqt.Wizard()
    wiz.setWindowTitle('Result visualizer')
    wiz.resize(800, 600)

    seq = [PageOpen,PageChooseAction,PageVisualize,PageReportGenerator,PageSave,PageFinal]

    # Get NetCDF file to open from command line or from FileOpen dialog.
    if len(sys.argv)>1:
        res = None
        try:
            res = loadResult(sys.argv[1])
        except Exception,e:
            QtGui.QMessageBox.critical(self, 'Unable to load result', unicode(e), QtGui.QMessageBox.Ok, QtGui.QMessageBox.NoButton)
        if res is not None:
            seq.pop(0)
            wiz.setProperty('result',res)
            wiz.setProperty('scenario',res.scenario.addref())
Ejemplo n.º 3
0
def getVersions():
    yield ('Python','%i.%i.%i %s %i' % tuple(sys.version_info))
    yield ('Qt4',QtCore.qVersion())
    yield (qt4_backend,qt4_backend_version)
    
    import numpy
    yield ('numpy',numpy.__version__)

    import matplotlib
    yield ('matplotlib',matplotlib.__version__)
    
    import xmlplot.data
    if xmlplot.data.netcdf.selectednetcdfmodule is None: xmlplot.data.chooseNetCDFModule()
    yield xmlplot.data.netcdf.netcdfmodules[xmlplot.data.netcdf.selectednetcdfmodule]

    import gotm
    yield ('gotm',gotm.gui_util.getversion().rstrip())