def test_selftTest_2(qtbot):
    assert qt_api.QApplication.instance() is not None

    esp32 = FakeESP32Serial(config)
    qtbot.addWidget(esp32)

    assert config is not None

    window = MainWindow(config, esp32)
    qtbot.addWidget(window)
    window.show()
    qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)

    # Open the Self Test section
    qtbot.mouseClick(window.button_spiro_calib, QtCore.Qt.LeftButton)
    assert window.toppane.currentWidget() == window.spiro_calib

    # Start the calibration
    qtbot.mouseClick(window.spiro_calib.start_calibration,
                     QtCore.Qt.LeftButton)
    qtbot.wait_until(
        lambda: window.spiro_calib.endstatus_label.text() == "Success",
        timeout=20000)

    # Return to the menu window
    qtbot.mouseClick(window.messagebar.button_cancel, QtCore.Qt.LeftButton)
示例#2
0
def mainExec():
    app = QtWidgets.QApplication(sys.argv)

    main = MainWindow()
    main.show()
    sys.exit(app.exec())
    pass
def test_changePSV_RR_2(qtbot):
    '''
    Test the change of the RR
    '''

    assert qt_api.QApplication.instance() is not None

    esp32 = FakeESP32Serial(config)
    qtbot.addWidget(esp32)

    assert config is not None

    window = MainWindow(config, esp32)
    qtbot.addWidget(window)
    window.show()
    qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.button_start_vent, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.toolbar

    # Enter the menu and the PSV Settings tab
    qtbot.mouseClick(window.button_menu, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.menu
    qtbot.mouseClick(window.button_settingsfork, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.settingsfork
    qtbot.mouseClick(window.button_settings, QtCore.Qt.LeftButton)
    assert window.toppane.currentWidget() == window.settings
示例#4
0
def main():
    argv = sys.argv

    ft = FlashTestApplication(argv)
    main_window = MainWindow()
    main_window.show()
    sys.exit(ft.exec_())
示例#5
0
def main():
    app = QtWidgets.QApplication(sys.argv)

    win = MainWindow()
    win.show()

    return app.exec_()
示例#6
0
文件: main.py 项目: info-labs/pyQGPG
def main(argv):
    app = QApplication(argv)

    win = MainWindow()
    win.show()

    return app.exec_()
示例#7
0
def start_simulate(_qtbot, esp32):
    '''
    '''
    assert qt_api.QApplication.instance() is not None

    assert config is not None

    window = MainWindow(config, esp32)
    _qtbot.addWidget(window)
    window.show()
    # press new patient
    _qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)
    # press proceed
    _qtbot.mouseClick(window.button_start_vent, QtCore.Qt.LeftButton)
    # TODO check that the main window has started
    assert True

    #
    def finish():
        window.close()

    # wait for some time
    timer = QTimer
    # MIN_TIME_WITHOUT_CRASHING_MS without crashing
    timer.singleShot(MIN_TIME_WITHOUT_CRASHING_MS, finish)
    # wait until has finished - or fail if crashes
    _qtbot.waitUntil(lambda: not window.isVisible(),
                     timeout=MIN_TIME_WITHOUT_CRASHING_MS + 1000)
示例#8
0
def main():
    app = QtWidgets.QApplication(sys.argv)

    win = MainWindow()
    win.show()

    return app.exec_()
示例#9
0
class PmApp(KUniqueApplication):
    def __init__(self, *args, **kwds):
        super(PmApp, self).__init__(*args)

        # Set system Locale, we may not need it anymore
        # It should set just before MainWindow call
        setSystemLocale()

        # Create MainWindow
        self.manager = MainWindow()

    def newInstance(self):
        args = KCmdLineArgs.parsedArgs()

        component = None
        if args.isSet("select-component"):
            component = str(args.getOption("select-component"))
            self.manager.cw.selectComponent(component)

        # Check if show-mainwindow used in sys.args to show mainWindow
        if args.isSet("show-mainwindow"):
            self.manager.show()

        # If system tray disabled show mainwindow at first
        if not config.PMConfig().systemTray():
            self.manager.show()

        return super(PmApp, self).newInstance()
示例#10
0
def main():
	Maths.generateMathExpressions()
	print("Available operators:")
	for o in Maths.Expressions:
		print(Maths.Expressions[o].getAbbreviation())

	print("-------------------------")
	f = Function("cos(3*x)+6/4*(x+3)", False)
	print("RPN String", f.getRpnString())
	for x in range (2, 11):
		f.compute(x)

	print("-------------------------")

	f = Function("56*((6+2)/(8-x)*2^3", False)
	print("RPN String", f.getRpnString()) #should give 56 6 2 + 8 7 - / 2 3 ^ * *


	mainwindow = MainWindow("Function Drawer", 992, 512)
	fx = f.computeRange(0, 10)
	max_y = max(fx.values())
	min_y = min(fx.values())

	print(min_y, max_y)
	mainwindow.setCoords(-1, min_y, 11, max_y)
	for x in range(0, 11):
		print(fx[x])
		p = Point(x, fx[x])
		p.draw(mainwindow)

	input("Press a key to quit")
示例#11
0
class login(QDialog, Ui_Dialog):
    """
    Class documentation goes here.
    """
    
    def __init__(self, parent=None):
        """
        Constructor
        
        @param parent reference to the parent widget
        @type QWidget
        """
        super(login, self).__init__(parent)
        self.setupUi(self)
        self.mainwindow=MainWindow()
        self.okButton.clicked.connect(self.okButton_clicked)
    @pyqtSlot()
    def okButton_clicked(self):
        
        # 设置验证
        
        name = self.username.text()
        psw= self.password.text()
        if (name == "" or psw == ""):
            QMessageBox.warning(self, "警告", "学号和密码不可为空!", QMessageBox.Yes, QMessageBox.Yes)
            
        if(name=='kenzo'):
            if(psw=='123456'):
                QMessageBox.information(self, "登陆成功", "登陆成功!", QMessageBox.Yes, QMessageBox.Yes)
                self.mainwindow.show()
                self.mainwindow.showName.emit(name)
            else:
                QMessageBox.warning(self, "警告", "密码错误!", QMessageBox.Yes, QMessageBox.Yes)
示例#12
0
def test_changeMode(qtbot):
    assert qt_api.QApplication.instance() is not None

    esp32 = FakeESP32Serial(config)
    qtbot.addWidget(esp32)

    assert config is not None

    window = MainWindow(config, esp32)
    qtbot.addWidget(window)
    window.show()
    qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.button_start_vent, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.toolbar

    assert "Stopped" in window._start_stop_worker._toolbar.label_status.text(
    ) and "PCV" in window._start_stop_worker._toolbar.label_status.text()

    # Enter the menu and change the mode, without starting the ventilator
    qtbot.mouseClick(window.button_menu, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.menu
    qtbot.mouseClick(window.button_autoassist, QtCore.Qt.LeftButton)

    assert "Stopped" in window._start_stop_worker._toolbar.label_status.text(
    ) and "PSV" in window._start_stop_worker._toolbar.label_status.text()
示例#13
0
def test_change_Mode_while_running(qtbot):

    assert qt_api.QApplication.instance() is not None

    esp32 = FakeESP32Serial(config)
    qtbot.addWidget(esp32)

    assert config is not None

    window = MainWindow(config, esp32)
    qtbot.addWidget(window)
    window.show()
    qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.button_start_vent, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.toolbar

    assert "Stopped" in window._start_stop_worker._toolbar.label_status.text(
    ) and "PCV" in window._start_stop_worker._toolbar.label_status.text()

    # Enter the menu and start
    qtbot.mouseClick(window.button_menu, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.menu
    qtbot.mouseClick(window.button_startstop, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.messagebar.button_confirm, QtCore.Qt.LeftButton)

    qtbot.waitUntil(lambda: "Running" in window._start_stop_worker._toolbar.
                    label_status.text() and "PCV" in window._start_stop_worker.
                    _toolbar.label_status.text(),
                    timeout=3000)

    assert window.button_autoassist.isEnabled() == True
示例#14
0
class PmApp(KUniqueApplication):
    def __init__(self, *args, **kwds):
        super(PmApp, self).__init__(*args)

        # Set system Locale, we may not need it anymore
        # It should set just before MainWindow call
        setSystemLocale()

        # Create MainWindow
        self.manager = MainWindow()

    def newInstance(self):
        args = KCmdLineArgs.parsedArgs()

        component = None
        if args.isSet("select-component"):
            component = str(args.getOption("select-component"))
            self.manager.cw.selectComponent(component)

        # Check if show-mainwindow used in sys.args to show mainWindow
        if args.isSet("show-mainwindow"):
            self.manager.show()

        # If system tray disabled show mainwindow at first
        if not config.PMConfig().systemTray():
            self.manager.show()

        return super(PmApp, self).newInstance()
示例#15
0
def main(argv):
    filename = "E:/test1.txt"
    text = open(filename).read()
    tokens = imp_lex(text)

    parse_result = imp_parse(tokens)

    stmt_list = get_stmt_list(parse_result.value)

    pointlist = [[]]

    for i, stmt in enumerate(stmt_list):
        stmt.run(pointlist)

    #geometry = QgsGeometry.fromPolyline(pointlist)

    #TextPolygon_feature.createFeature(self.canvas, geometry, "")

    # create QGis application
    app = QgsApplication(argv, True)

    QCoreApplication.setOrganizationName("IRSG")
    QCoreApplication.setOrganizationDomain("*****@*****.**")
    QCoreApplication.setApplicationName("FlightPlanner")

    # Initialize qgis libraries
    QgsApplication.setPrefixPath(".", True)
    QgsApplication.initQgis()

    mainwindow = MainWindow()
    mainwindow.show()

    retval = app.exec_()
    QgsApplication.exitQgis()
示例#16
0
def main():
    qapp = QtGui.QApplication(sys.argv)

    mainwindow = MainWindow()
    mainwindow.show()

    qapp.exec_()
示例#17
0
def test_selftTest_1(qtbot):

    assert qt_api.QApplication.instance() is not None

    esp32 = FakeESP32Serial(config)
    qtbot.addWidget(esp32)

    assert config is not None

    window = MainWindow(config, esp32)
    qtbot.addWidget(window)
    window.show()
    qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)

    # Open the Self Test section
    qtbot.mouseClick(window.button_start_test, QtCore.Qt.LeftButton)
    assert window.toppane.currentWidget() == window.self_test

    # Press the Leak check button
    qtbot.mouseClick(window.self_test.btn_run_leakcheck, QtCore.Qt.LeftButton)
    qtbot.wait_until(window.self_test._btn_continue.isEnabled, timeout=10000)

    # Press the continue button and start the Flow check
    qtbot.mouseClick(window.self_test._btn_continue, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.self_test.btn_run_spiro_dir, QtCore.Qt.LeftButton)
    qtbot.wait_until(window.self_test._btn_continue.isEnabled, timeout=10000)

    # Press the continue button and start the Change battery check
    qtbot.mouseClick(window.self_test._btn_continue, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.self_test.btn_run_backup_battery,
                     QtCore.Qt.LeftButton)
    qtbot.wait_until(window.self_test._btn_continue.isEnabled, timeout=10000)

    # Press the continue button and go to the Alarm-System check
    qtbot.mouseClick(window.self_test._btn_continue, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.self_test.btn_run_alarmsystem_1,
                     QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.messagebar.button_confirm, QtCore.Qt.LeftButton)
    assert "Failure" in window.self_test.endstatus_label_asc_1.text(
    ) or "Success" in window.self_test.endstatus_label_asc_1.text()

    qtbot.mouseClick(window.self_test.btn_run_alarmsystem_2,
                     QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.messagebar.button_confirm, QtCore.Qt.LeftButton)
    assert "Failure" in window.self_test.endstatus_label_asc_2.text(
    ) or "Success" in window.self_test.endstatus_label_asc_2.text()

    qtbot.mouseClick(window.self_test.btn_run_alarmsystem_3,
                     QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.messagebar.button_confirm, QtCore.Qt.LeftButton)
    assert "Failure" in window.self_test.endstatus_label_asc_3.text(
    ) or "Success" in window.self_test.endstatus_label_asc_3.text()

    # Come back to the previous panel
    previousPageNumber = window.self_test._current_page
    qtbot.mouseClick(window.self_test._btn_back, QtCore.Qt.LeftButton)
    assert window.self_test._current_page == previousPageNumber - 1

    # Return to the menu window
    qtbot.mouseClick(window.messagebar.button_cancel, QtCore.Qt.LeftButton)
示例#18
0
class Application(object):
    """TKinter based application for game."""
    def __init__(self):
        """Initializing the application."""
        self.master = tk.Tk()
        self.master.title("Five Wins Game")
        self.master.geometry("800x600+50+50")
        self.master.config(bg="dodger blue")
        self.master.attributes("-alpha", 0.9)

        self.menubar = tk.Menu(self.master)

        file_menu = tk.Menu(self.menubar, tearoff=0)
        file_menu.add_command(label="Quit", command=self.quit_application)
        self.menubar.add_cascade(label="File", menu=file_menu)

        self.main_window = MainWindow(self.master)
        self.main_window.add(GameBoard(self.main_window), text="Game Board")

        self.master.config(menu=self.menubar)

    def quit_application(self):
        """Leaving the application."""
        self.master.destroy()

    def mainloop(self):
        """Running application main loop."""
        self.master.mainloop()
示例#19
0
def main():

	app = QtGui.QApplication(sys.argv)
	window = MainWindow()
	window.show()

	app.exec_()
示例#20
0
def main():
    app = QApplication(sys.argv)
    app.setApplicationName("Gandalf Enjoys Music")

    window = MainWindow()
    window.show()
    sys.exit(app.exec_())
示例#21
0
文件: main.py 项目: dnaga392/id3pyv
def _main(argv):
    app = QtWidgets.QApplication(argv)
    m = MainWindow()
    m.show()
    # id3 = read_raw_id3(path)
    # m.setID3(id3)
    return app.exec_()
示例#22
0
def main():
    app = QApplication(sys.argv)

    window = MainWindow(Table())
    window.show()

    sys.exit(app.exec_())
示例#23
0
def main(argv):
    app = QApplication(argv, True)

    wnd = MainWindow()
    wnd.show()

    sys.exit(app.exec_())
示例#24
0
    def __init__(self):
        MainWindow.__init__(self)

        self._jlink = jlink.JLinkDll()
        self._is_connected = False
        self._adapter_serial_number = "0"
        self._initialize()
        self.init_timer()
示例#25
0
def main(argv):
    from PySide2.QtWidgets import QApplication
    from PySide2.QtCore import Qt, QCoreApplication
    # QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
    a = QApplication(argv)
    w = MainWindow()
    w.show()
    return a.exec_()
示例#26
0
def start():
    app = QtWidgets.QApplication(sys.argv)
    QtGui.QFontDatabase.addApplicationFont('fonts/segoeui.ttf')
    QtGui.QFontDatabase.addApplicationFont('fonts/segoeuib.ttf')
    w = MainWindow()
    w.show()

    sys.exit(app.exec())
示例#27
0
文件: picapy.py 项目: nivir/Picapy
 def do_activate(self):
     print('activate')
     if self.win is None:
         self.win = MainWindow(self)
         self.add_window(self.win)
         self.win.show()
     else:
         self.win.present()
示例#28
0
文件: kb.py 项目: npcipav/KB
def main():
    #
    app = QtGui.QApplication(sys.argv)
    settings.setDbFileName('diary.sqlite')
    diary = DiaryManager()
    wnd = MainWindow(diary)
    wnd.show()
    sys.exit(app.exec_())
示例#29
0
def main():
    setup()
    app = QApplication(sys.argv)
    form = MainWindow(PINS_X, PINS_Y, PIN_PUMPER1, PIN_PUMPER2,
                      PIN_ENABLE_MOTOR)
    form.show()
    sys.exit(app.exec_())
    cleanup()
示例#30
0
文件: qyok.py 项目: agateau/qyok
def main(argv):
    app = QApplication(argv)
    parser = qymain.createOptionParser()
    options, args = parser.parse_args(argv)
    db.connectDatabase(options.filename)

    dlg = MainWindow()
    dlg.show()
    return app.exec_()
示例#31
0
def main(argv):
    app = QApplication(argv)
    parser = qymain.createOptionParser()
    options, args = parser.parse_args(argv)
    db.connectDatabase(options.filename)

    dlg = MainWindow()
    dlg.show()
    return app.exec_()
示例#32
0
def main():
    app = QApplication(sys.argv)

    widget = RandomNumbersWidget()

    window = MainWindow(widget)
    window.show()

    sys.exit(app.exec_())
示例#33
0
    def __init__(self, *args, **kwds):
        super(PmApp, self).__init__(*args)

        # Set system Locale, we may not need it anymore
        # It should set just before MainWindow call
        setSystemLocale()

        # Create MainWindow
        self.manager = MainWindow()
示例#34
0
def test_change_ITS_PCV(qtbot):
    '''
    Test the change of the ITS Parameter

    At the current situation, the test cannot be executed, since the ITS parameter is not loaded from the default values
    '''

    assert qt_api.QApplication.instance() is not None

    esp32 = FakeESP32Serial(config)
    qtbot.addWidget(esp32)

    assert config is not None

    window = MainWindow(config, esp32)
    qtbot.addWidget(window)
    window.show()
    qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.button_start_vent, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.toolbar

    # Enter the menu and the Mode Settings tab
    qtbot.mouseClick(window.button_menu, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.menu
    qtbot.mouseClick(window.button_settingsfork, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.settingsfork
    qtbot.mouseClick(window.button_settings, QtCore.Qt.LeftButton)
    assert window.toppane.currentWidget() == window.settings

    # Try to increase the value
    startingValue = window.settings._all_spinboxes[
        'pcv_trigger_pressure'].value()

    i = startingValue
    oldValue = 0
    while i <= int(config['pcv_trigger_pressure']['max'] + 1) or i == oldValue:
        window._start_stop_worker._settings.update_spinbox_value(
            'pcv_trigger_pressure', i)
        oldValue = i
        i = i + int(config['pcv_trigger_pressure']['step'])
        assert window.settings._all_spinboxes['pcv_trigger_pressure'].value(
        ) <= config['pcv_trigger_pressure']['max']

    # Try to decrease the value
    window._start_stop_worker._settings.update_spinbox_value(
        'pcv_trigger_pressure', startingValue)

    i = startingValue
    oldValue = 0
    while i >= int(config['pcv_trigger_pressure']['min'] - 1) or i == oldValue:
        window._start_stop_worker._settings.update_spinbox_value(
            'pcv_trigger_pressure', i)
        oldValue = i
        i = i - int(config['pcv_trigger_pressure']['step'])
        assert window.settings._all_spinboxes['pcv_trigger_pressure'].value(
        ) >= config['pcv_trigger_pressure']['min']
示例#35
0
def main():
    """Start the app"""
    app = QApplication(sys.argv)

    if isMac():
        app.setStyle(QStyleFactory.create("Fusion"))

    main_window = MainWindow()
    main_window.show()
    sys.exit(app.exec_())
示例#36
0
def main():
    app = QApplication(sys.argv)
    app.setApplicationName("Visinum-Metadata")
    app.setOrganizationName("Qwilka")
    app.setOrganizationDomain("qwilka.github.io")
    app.setStyle("fusion")  
    mainwindow = MainWindow()
    ##app.mainwindow = mainwindow
    mainwindow.show()
    sys.exit(app.exec_())   # app.exec_()
示例#37
0
文件: tuna.py 项目: takumak/tuna
    def __init__(self):
        super().__init__(sys.argv)

        from icon import TunaIcon
        self.icon = TunaIcon.get()
        self.setWindowIcon(self.icon)

        from mainwindow import MainWindow
        self.window = MainWindow()
        self.window.show()
示例#38
0
def main():
    # create application
    app = QtGui.QApplication(sys.argv)

    # create mainWindow
    mainWindow = MainWindow()
    mainWindow.show()

    # run main loop
    sys.exit(app.exec_())
示例#39
0
文件: gui.py 项目: halbbob/dff
    def launch(self, modPath = None):
        self.splash.show()
        if modPath:
          self.loader = loader()
          self.loader.do_load(modPath, self.splash.showMessage)
        mainWindow = MainWindow(self.app, self.debug)
        mainWindow.show()

        self.splash.finish(mainWindow)
        sys.exit(self.app.exec_())
示例#40
0
def main():
    qapp = create_qapp('My Trading System')

    event_engine = EventEngine()
    # event_engine.start()
    main_engine = MainEngine(event_engine)
    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()
示例#41
0
def test_changePCV_IE(qtbot):
    '''
    Test the change of the I:E
    '''

    assert qt_api.QApplication.instance() is not None

    esp32 = FakeESP32Serial(config)
    qtbot.addWidget(esp32)

    assert config is not None

    window = MainWindow(config, esp32)
    qtbot.addWidget(window)
    window.show()
    qtbot.mouseClick(window.button_new_patient, QtCore.Qt.LeftButton)
    qtbot.mouseClick(window.button_start_vent, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.toolbar

    # Enter the menu and the PSV Settings tab
    qtbot.mouseClick(window.button_menu, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.menu
    qtbot.mouseClick(window.button_settingsfork, QtCore.Qt.LeftButton)
    assert window.bottombar.currentWidget() == window.settingsfork
    qtbot.mouseClick(window.button_settings, QtCore.Qt.LeftButton)
    assert window.toppane.currentWidget() == window.settings

    # Try to increase the value
    startingValue = window.settings._all_spinboxes['insp_expir_ratio'].value()

    i = startingValue
    oldValue = 0
    while i <= float(config['insp_expir_ratio']['max'] + float(
            config['insp_expir_ratio']['step'])) or i == oldValue:
        window._start_stop_worker._settings.update_spinbox_value(
            'insp_expir_ratio', i)
        oldValue = i
        i = i + float(config['insp_expir_ratio']['step'])
        assert window.settings._all_spinboxes['insp_expir_ratio'].value(
        ) <= config['insp_expir_ratio']['max']

    # Try to decrease the value
    window._start_stop_worker._settings.update_spinbox_value(
        'insp_expir_ratio', startingValue)

    i = startingValue
    oldValue = 0
    while i >= float(config['insp_expir_ratio']['min'] - float(
            config['insp_expir_ratio']['step'])) or i == oldValue:
        window._start_stop_worker._settings.update_spinbox_value(
            'insp_expir_ratio', i)
        oldValue = i
        i = i - float(config['insp_expir_ratio']['step'])
        assert window.settings._all_spinboxes['insp_expir_ratio'].value(
        ) >= config['insp_expir_ratio']['min']
示例#42
0
class Application(QtGui.QApplication):
    STATUS_REPLENISH = 0
    STATUS_CONFIRMATION = 1
    STATUS_WORK = 2

    statusChanged = QtCore.pyqtSignal(int, int, name='changeStatus')

    def __init__(self, args):
        QtGui.QApplication.__init__(self, [])
        self.isTestNet = args['testnet']
        self.dataDir = args['datadir']
        self._status = None

    def _install_i18n(self):
        import __builtin__
        __builtin__.__dict__["_"] = lambda x: x

    def exec_(self):
        self._install_i18n()

        from wallet import Wallet
        self.wallet = Wallet(self.dataDir, self.isTestNet)
        self.wallet.balanceUpdated.connect(self._check_status)

        from mainwindow import MainWindow
        self.mainWindow = MainWindow()
        self.mainWindow.show()

        self.wallet.sync_start()
        QtCore.QTimer.singleShot(0, self._check_status)
        retval = super(QtGui.QApplication, self).exec_()
        self.mainWindow.chatpage.sync_stop()
        self.wallet.sync_stop()
        return retval

    def _check_status(self):
        moniker = clubAsset['monikers'][0]
        available_balance = self.wallet.get_available_balance(moniker)
        unconfirmed_balance = self.wallet.get_unconfirmed_balance(moniker)

        if available_balance > 0:
            self._set_new_status(self.STATUS_WORK)
        else:
            if unconfirmed_balance > 0:
                self._set_new_status(self.STATUS_CONFIRMATION)
            else:
                self._set_new_status(self.STATUS_REPLENISH)

    def _set_new_status(self, status):
        if self._status == status:
            return
        oldStatus = self._status
        self._status = status
        self.statusChanged.emit(oldStatus, status)
示例#43
0
文件: main.py 项目: teddBroiler/Sabel
def main():
    splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
    splash.setMask(splash_pix.mask())
    splash.show()
    app.processEvents()
    # app.setStyle('Plastique')
    frame = MainWindow()
    frame.showMaximized()
    splash.finish(frame)
    frame.init()
    app.exec_()
示例#44
0
文件: commit.py 项目: amirgeva/commit
def main():
    root=os.path.abspath('.')
    if len(sys.argv)>1:
        root=os.path.abspath(sys.argv[1])
    app=QtGui.QApplication(sys.argv)
    QtCore.QCoreApplication.setOrganizationName("MLGSoft")
    QtCore.QCoreApplication.setOrganizationDomain("mlgsoft.com")
    QtCore.QCoreApplication.setApplicationName("commit")
    w=MainWindow(root)
    w.show()
    app.exec_()
示例#45
0
def main():
    logger = logging.getLogger('BLUsage')
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    try:
        os.mkdir(os.path.expanduser('~/.blusage'))
    except Exception as e:
        logger.debug(e)
    app = QApplication(sys.argv)
    mw = MainWindow()
    mw.show()
    sys.exit(app.exec_())
示例#46
0
def main():
    import sys
    from PySide import QtGui
    from mainwindow import MainWindow

    app = QtGui.QApplication(sys.argv)

    window = MainWindow()
    window.show()

    return app.exec_()
示例#47
0
文件: main.py 项目: liyulun/mantid
def start(options, args):
    """Starts the GUI and passes the command line
       arguments along to the GUI
       @param options A dictionary of the options passed to the migration
       @param args The positional command line arguments
       load into the GUI
    """
    messages.notify("Starting GUI")
    app = _qtapp()
    window = MainWindow()
    window.show()
    return app.exec_()
示例#48
0
class Application(object):

    def __init__(self):
        self.window = None
        self.connection = None

        self._init_window()

        self._init_connection()

        GObject.idle_add(self.send_data_to_gtk_thread)
        #GObject.idle_add(self.retrieve_data_from_gtk)

    def _init_window(self):
        self.window = MainWindow()
        self.window.connect('delete-event', self.quit)

    def _init_connection(self):
        self.connection = GtalkConnection()
        self.connection.start_connection()

    def send_data_to_gtk_thread(self):
        data = {
            'roster': '',
            'messages': [],
        }
        if self.connection.roster_changed and self.connection.roster != '':
            print("Updating roster")
            data["roster"] = self.connection.roster
        if self.connection.has_new_messages:
            print("adding messages")
            data["messages"] = self.connection.msg_queue

        if dict_have_data(data):
            self.window.parse_new_data(data)
            self.connection.reset_data()

        return True

    def retrieve_data_from_gtk(self):
        to, client_data = self.window.get_send_data()
        if client_data != None:
            for msg in client_data:
                print("sending msg",msg)
                self.connection.send_msg_to(to, msg)

        return False


    def quit(self, widget, event):
        print("Exiting.. waiting disconnect form server") 
        self.connection.stop_connection()
        Gtk.main_quit()
示例#49
0
class MainApp(QtGui.QApplication):
    """Application event loop thats spawns the main window.
    """

    def __init__(self, args):
        super(MainApp, self).__init__(args)
        """Initialize application properties and open main window.

        Args:
            args (list): sys.argv
        """
        # Prevent a dialog from exiting if main window not visisble
        self.setQuitOnLastWindowClosed(False)

        # Set application properties
        self.setApplicationName(APP_DOMAIN)
        self.setOrganizationName(APP_ORG)
        self.setApplicationName(APP_NAME)
        self.setApplicationVersion(APP_VERSION)

        # Create main window
        if "minimize" in args:
            self.mw = MainWindow(minimize=True)
        else:
            self.mw = MainWindow(minimize=False)

        # Perform clean up actions when quit message signaled
        self.connect(self, QtCore.SIGNAL("aboutToQuit()"), self._on_quit)

    @QtCore.Slot()
    def _on_quit(self):
        """Cleanup application and copy clipboard data to OS clipboard.

        Makes a copy of the clipboard pointer data into the OS clipboard. The 
        basic concept behind this is that by default copying something into the
        clipboard only copies a reference/pointer to the source application. 
        Then when another application wants to paste the data from the 
        clipboard  it requests the data from the source application.

        Args:
            None

        Returns:
            None
        """
        self.mw.clean_up()

        # Copy and remove pointer
        clipboard = QtGui.QApplication.clipboard()
        event = QtCore.QEvent(QtCore.QEvent.Clipboard)
        QtGui.QApplication.sendEvent(clipboard, event)
        logging.debug("Exiting...")
示例#50
0
文件: kalpana.py 项目: nycz/lcars-tem
def create_objects(configdir):
    smgr = SettingsManager(configdir)
    mw = MainWindow(smgr)
    txta = TextArea(mw, smgr)
    chsb = ChapterSidebar(smgr, txta.toPlainText, txta.textCursor)
    term = Terminal(mw, smgr, lambda: txta.file_path)
    # Ugly shit
    mw.set_is_modified_callback(txta.document().isModified)
    return OrderedDict((('chaptersidebar', chsb),
                        ('mainwindow', mw),
                        ('settingsmanager', smgr),
                        ('terminal', term),
                        ('textarea', txta)))
示例#51
0
def main():
    pyqtRemoveInputHook()
    QDir(QDir.homePath()).mkdir(".ricodebug")

    app = QApplication(sys.argv)
    app.setApplicationName("ricodebug")
    window = None
    Logger.getInstance().init("logfile", window)
    window = MainWindow()
    if (len(sys.argv) > 1):
        window.debug_controller.openExecutable(sys.argv[1])

    window.show()
    sys.exit(app.exec_())
示例#52
0
def main():
    root = Tk()
    root.minsize(800,600)
    app = MainWindow(root)
    
    infotab = Tabs(app)
    k_map = Map(app, "Maps\Kingston_z1.gif", (44.2296,76.4928), (44.2224,76.4856), 626, 872)
    u_map = Map(app, "Maps\Green_River_z2.gif", (38.850,110.25), (38.830,110.21), 1250, 810)
    u_map_big = Map(app, "Maps\Green_River_Launch_Map.gif", (38.8440, 110.255), (38.8296, 110.205), 7137, 2657)
    u_map_2016 = Map(app, "Maps\GR_2016.gif", (38.82,109.99), (38.77,109.88), 1240, 666)
    
    mapplot = MapGraph(app,(u_map_2016, u_map_big, u_map, k_map), index = 0)
    dataplot = Datamonitor(app)
    altplot = Plot(app, ylabel="Altitude (m)", xinterval=float("inf"), numy=2)
    
    battery_meter = Meter(app, 4.3, 3)
    serialmonitor = SerialMonitor(app, altplot, mapplot, dataplot, battery_meter)
    infotab.add_tab(mapplot, "Map")
    infotab.add_tab(dataplot, "Plots")
    
    widgets = (infotab, altplot, serialmonitor)
    app.setwidgets(widgets)
    #serialmonitor.scan_ports()
    app.bind("<Configure>", app.fit_widgets())
    app.mainloop()
示例#53
0
def main(argv):
    app = QApplication(argv)

    qtTr = QTranslator()
    if qtTr.load("qt_" + QLocale.system().name(), ":/i18n/"):
        app.installTranslator(qtTr)

    appTr = QTranslator()
    if appTr.load("hestia_" + QLocale.system().name(), ":/i18n/"):
        app.installTranslator(appTr)

    win = MainWindow()
    win.show()

    return app.exec_()
def main():
    app = QApplication(sys.argv)

    font = app.font()
    if sys.platform.startswith("win"):
        font.setFamily("Microsoft YaHei")
    else:
        font.setFamily("Ubuntu")
    app.setFont(font)

    main_window = MainWindow()
    main_window.setWindowTitle("Image Downloader")
    main_window.show()

    sys.exit(app.exec_())
示例#55
0
    def createUI(self,parent):
        from mainwindow import MainWindow
        
        mainActions = MainWindow.getInstance().actions
        self.setTitle('Mirror')
        
        # base layout
        self.cmdLayout = self.createCommandLayout([
                    ('Initialize', self.execInitMirror,''),
                    ('Mirror Weights', mainActions.mirrorWeights,'')
                    ], SkinToolsDocs.MIRRORWEIGHTS_INTERFACE)
        
        mainActions.mirrorWeights.addUpdateControl(self.cmdLayout.innerLayout)
        
        # mirror options group

        group = self.controls.mirrorOptionsGroup = self.createUIGroup(self.cmdLayout.innerLayout, 'Mirroring Options')

        self.createFixedTitledRow(group, 'Mirror direction')
        self.controls.mirrorDirection = DropDownField(self.VAR_PREFIX+'mirrorDirection')
        self.rebuildMirrorDirectionDropDown()
        LayerEvents.mirrorCacheStatusChanged.addHandler(self.rebuildMirrorDirectionDropDown,parent)

        self.createFixedTitledRow(group, 'Mirror Seam Width')
        self.controls.mirrorWidth = FloatField(self.VAR_PREFIX+'mirrorWidth', minValue=0, maxValue=None, step=1.0, defaultValue=0.1, annotation='Defines width of the interpolation from left to right side on the model center line.')
        cmds.setParent(group)
        self.createTitledRow(group, 'Elements')
        self.controls.mirrorWeights = CheckBoxField(self.VAR_PREFIX+'MirrorWeights',label="Mirror weights",
                annotation='Check this if mirror operation should be mirroring weights',defaultValue=1)
        self.controls.mirrorMask = CheckBoxField(self.VAR_PREFIX+'MirrorMask',label="Mirror mask",
                annotation='Check this if mirror operation should be mirroring layer mask',defaultValue=1)
        
        
        
        return self.cmdLayout.outerLayout.layout
示例#56
0
    def main(self):
        """
            Main entry point of the application. This is called to perform initialization of the program
            state and start up the GUI.
        """

        empty_config = {"aliases": {}, "triggers": {}, "ansi": {}}
        self.config = empty_config
        self.alias_states = {}
        GLib.idle_add(self.update)

        self.main_window = MainWindow(self)

        # Before we finally launch, load the config
        try:
            with open("config.txt", "r") as handle:
                buffer = handle.read()

                config = json.loads(buffer)

                for alias_name in config["aliases"]:
                    self.add_alias(alias_name, config["aliases"][alias_name]["address"], config["aliases"][alias_name]["password"])

                self.config = config
        except IOError:
            print("Failed to load config.")

        # Once we have a config, ensure that our base level config objects exist
        # FIXME: Probably should recurse this
        for key in empty_config:
            if key not in self.config:
                self.config[key] = empty_config[key]

        Gtk.main()
示例#57
0
class Tuxedo:
    def __init__(self):
        # Create a connection to the database
        self.db = Database()

        # Create the main window
        self.mainWindow = MainWindow(self.db)

        # Create the tray icon
        self.trayicon = TrayIcon(self.mainWindow)

        # Refresh the list of tasks
        self.mainWindow.refresh()

        # Run gtk
        gtk.main()
示例#58
0
def main():
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    app = QtGui.QApplication(sys.argv)

    app.setApplicationName("kamera")
    app.setOrganizationName("kamera")

    locale = QtCore.QLocale.system().name()
    translator = QtCore.QTranslator()
    translator.load(":/kamera_%s.qm" % locale)
    app.installTranslator(translator)

    mainWindow = MainWindow()
    mainWindow.show()

    return app.exec_()
示例#59
0
 def __init__(self, parent=None):
   super(QtCore.QObject, self).__init__(parent)
   ##TODO check for internet connection (display warning if none as can't get map data)
   
   ##TODO check for updates to the application
   
   #data
   self.db_manager = model.DBManager(version.getVersionString())
   self.view_data = model.ViewData()
   self.scanner_thread = None
   self.main_window = MainWindow( js_to_server_call_fn=self._onCallFromBrowserWidget, slider_time_to_formatted_date_fn=self._format_slider_time)
   self.main_window.showTargetDirectoryScreen()
   
   self.photo_table = self.main_window.photo_table
   self.time_slider = self.main_window.time_slider
   #internal settings
   self.view_refresh_count = 0
   self.slider_event_count = 0
   self.accept_new_images = False  # guard against queued images
   self.show_paths = True
   self._last_idlatlng_list = []
   self._last_arrow_list = []
   
   #calls we can receive from the html part of the gui (BrowserWidget)
   self.server_api = {"mapMoved": self._mapMoved,
                      "getImageData": self._getImageData,
                      "mapPhotoHighlighted": self._mapPhotoHighlighted,
                      "imagesDragged": self._imagesDragged }
   
   #connect to the GUI
   self._connectToGUI()
示例#60
0
文件: zoxel.py 项目: LRiecken/zoxel
def main():
    # create application
    app = QtGui.QApplication(sys.argv)

    # create mainWindow
    mainwindow = MainWindow()
    mainwindow.show()

    # Remember our main window
    app.mainwindow = mainwindow

    # Load system plugins
    mainwindow.load_plugins()

    # run main loop
    sys.exit(app.exec_())