File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Library
1010Library /*
1111Library.zip
1212* .log
13+ call_detail.png
1314Resources /Data /*
1415Resources /Images /Avatars /* .jpg
1516Resources /Images /Wallpaper /*
Original file line number Diff line number Diff line change @@ -72,9 +72,36 @@ def showError(message):
7272 sys .exit (app .exec_ ())
7373
7474
75- try :
75+ def do_analysis () :
7676 from Widgets import MainWindow
77- MainWindow .main ()
77+ try :
78+ # 获取函数调用图
79+ from pycallgraph2 .config import Config
80+ from pycallgraph2 .globbing_filter import GlobbingFilter
81+ from pycallgraph2 .output .graphviz import GraphvizOutput
82+ from pycallgraph2 .pycallgraph import PyCallGraph
83+ # 函数流程图调用
84+ config = Config ()
85+ config .trace_filter = GlobbingFilter (
86+ include = ['Widgets.*' , 'Utils.*' ],
87+ exclude = ['pycallgraph2.*' , '*.secret_function' ]
88+ )
89+ with PyCallGraph (
90+ GraphvizOutput (
91+ tool = 'D:/soft/Graphviz/bin/dot' ,
92+ output_file = 'call_detail.png' ),
93+ config = config ):
94+ MainWindow .main ()
95+ except :
96+ MainWindow .main ()
97+
98+
99+ try :
100+ if '-analysis' in sys .argv :
101+ do_analysis ()
102+ else :
103+ from Widgets import MainWindow
104+ MainWindow .main ()
78105except SystemExit :
79106 pass
80107except :
You can’t perform that action at this time.
0 commit comments