def run(params: list) -> int: """ Starts the application. :return: Error code. If no error occurred returns 0. """ for item in params: if str(item).lower() == "--verbose": Config.set_executed_type(ExecutedType.Verbose) break result = -1 try: exec_real_path = os.path.realpath(params[0]) exec_dir = os.path.dirname(exec_real_path) Config.set_root_dir(exec_dir) app = QApplication(params) Tools.check_paths() window = MainWindow() window.show() result = app.exec_() except Exception as ex: # wildcard for an app crash Tools.write_log(ex) result = -2 finally: Tools.write_verbose("Application error code is %s" % result) return result
def main( argv, file=None, pdf=None, verbose=None, debug=0, develop=None, fallback=None ): """ Entry Point. """ GlobalState.is_verbose = verbose GlobalState.is_develop = develop GlobalState.is_fallback = fallback # Debug-Level soll immer als Zahl gespeichert werden. Der Zugehörige Name kann über das Tupel Config.DEBUG_LEVELS herausgefunden werden. if debug in Config.DEBUG_LEVELS: GlobalState.debug_level = Config.DEBUG_LEVELS.index( debug ) else: GlobalState.debug_level = int( debug ) if GlobalState.debug_level and GlobalState.debug_level > Config.DEBUG_LEVEL_NONE: print("{name} runs in debug mode (debug-level: {level_index} \"{level_name}\").".format( name=Config.PROGRAM_NAME, level_index=GlobalState.debug_level, level_name=Config.DEBUG_LEVELS[GlobalState.debug_level], )) if GlobalState.debug_level >= Config.DEBUG_LEVEL_MODIFIES_EXPORTS: print("WARNING! Exporting and printing character sheets is not recommended.") if GlobalState.is_develop: print( "{name} runs in development mode.".format( name=Config.PROGRAM_NAME, )) print( "WARNING! You may encounter unexpected behaviour. Data loss is possible. Proceed only, if you know, what you are doing." ) app = QApplication( argv ) w = MainWindow( file, exportPath=pdf ) w.show() retcode = app.exec_()
def main(argv, file=None, pdf=None, verbose=None, debug=0, develop=None, fallback=None): """ Entry Point. """ GlobalState.is_verbose = verbose GlobalState.is_develop = develop GlobalState.is_fallback = fallback # Debug-Level soll immer als Zahl gespeichert werden. Der Zugehörige Name kann über das Tupel Config.DEBUG_LEVELS herausgefunden werden. if debug in Config.DEBUG_LEVELS: GlobalState.debug_level = Config.DEBUG_LEVELS.index(debug) else: GlobalState.debug_level = int(debug) if GlobalState.debug_level and GlobalState.debug_level > Config.DEBUG_LEVEL_NONE: print( "{name} runs in debug mode (debug-level: {level_index} \"{level_name}\")." .format( name=Config.PROGRAM_NAME, level_index=GlobalState.debug_level, level_name=Config.DEBUG_LEVELS[GlobalState.debug_level], )) if GlobalState.debug_level >= Config.DEBUG_LEVEL_MODIFIES_EXPORTS: print( "WARNING! Exporting and printing character sheets is not recommended." ) if GlobalState.is_develop: print("{name} runs in development mode.".format( name=Config.PROGRAM_NAME, )) print( "WARNING! You may encounter unexpected behaviour. Data loss is possible. Proceed only, if you know, what you are doing." ) app = QApplication(argv) w = MainWindow(file, exportPath=pdf) w.show() retcode = app.exec_()
# -*-coding:Utf-8 -* import sys from src.MainWindow import MainWindow from PySide.QtGui import QApplication if __name__ == '__main__': app = QApplication(sys.argv) mainWindow = MainWindow() mainWindow.show() sys.exit(app.exec_())
from src.MainWindow import MainWindow from PyQt5 import QtWidgets import sys from src.CheckDialog import * if __name__ == '__main__': try: app = QtWidgets.QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_()) except Exception as e: print(e)
# -*- coding: utf-8 -*- # app for database and hydrosoftware final work # author: rainyl # update: 2019-3-27 import sys from PyQt5.QtWidgets import QApplication from src.MainWindow import MainWindow if __name__ == "__main__": app = QApplication(sys.argv) mainwindow = MainWindow() mainwindow.show() sys.exit(app.exec_())
import sys from PyQt5.QtWidgets import QApplication from src.MainWindow import MainWindow if __name__ == '__main__': app = QApplication(sys.argv) ex = MainWindow() ex.show() sys.exit(app.exec_())
import sys from PySide2 import QtWidgets from src.BlackPalette import BlackPalette from src.MainWindow import MainWindow INFORMATION = "se_music.xlsx" # KNOWLEDGE_BASE = "music-if-then.txt" KNOWLEDGE_BASE = "KnowledgeBase.txt" QA = "QA.json" if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) app.setPalette(BlackPalette()) mainWindow = MainWindow(INFORMATION, KNOWLEDGE_BASE, QA) mainWindow.setPalette(BlackPalette()) mainWindow.show() app.exec_()