示例#1
0
def do_analysis():
    from Widgets import MainWindow
    try:
        # 获取函数调用图
        from pycallgraph2.config import Config
        from pycallgraph2.globbing_filter import GlobbingFilter
        from pycallgraph2.output.graphviz import GraphvizOutput
        from pycallgraph2.pycallgraph import PyCallGraph
        # 函数流程图调用
        config = Config()
        config.trace_filter = GlobbingFilter(
            include=['Widgets.*', 'Utils.*'],
            exclude=['pycallgraph2.*', '*.secret_function'])
        with PyCallGraph(GraphvizOutput(tool='D:/soft/Graphviz/bin/dot',
                                        output_file='call_detail.png'),
                         config=config):
            MainWindow.main()
    except:
        MainWindow.main()
示例#2
0
文件: guiManager.py 项目: n0rel/self
    def __init__(self, listOfIds: list, eventQueue: queue.Queue):
        # create the item graphs, store them in a dataset
        self.graphs = {}
        for item in listOfIds:
            graf = graph.graph(5, 4)
            self.graphs[item] = graf

        self.currentItem = ''
        self.currentView = 'home'
        # create the MainWindow object
        self.window = MainWindow.MainWindow(listOfIds=listOfIds, eventQueue=eventQueue, graphs=self.graphs)
        # show the mainwindow
        self.window.show()
示例#3
0
文件: Main.py 项目: mazhou/pythonApp
def showError(message):

    from PyQt5.QtWidgets import QApplication, QErrorMessage, QCheckBox, \
        QPushButton, QLabel, QStyle
    from PyQt5.QtCore import Qt
    app = QApplication(sys.argv)
    app.setQuitOnLastWindowClosed(True)
    # 设置内置错误图标
    app.setWindowIcon(app.style().standardIcon(QStyle.SP_MessageBoxCritical))
    w = QErrorMessage()
    w.finished.connect(lambda _: app.quit)
    w.resize(600, 400)
    # 去掉右上角?
    w.setWindowFlags(w.windowFlags() & ~Qt.WindowContextHelpButtonHint)
    w.setWindowTitle(w.tr('Error'))
    # 隐藏图标、勾选框、按钮
    w.findChild(QLabel, '').setVisible(False)
    w.findChild(QCheckBox, '').setVisible(False)
    w.findChild(QPushButton, '').setVisible(False)
    w.showMessage(escape(message))
    sys.exit(app.exec_())


try:
    from Widgets import MainWindow

    MainWindow.main()
except SystemExit:
    pass
except:
    showError(traceback.format_exc())