1
2
3
4
5"""
6This script processes data recorded by profiler and creates two types
7of diagrams - UML sequence diagrams and call graphs.
8
9
10Requirements for custom Python installations
11============================================
12
13Python, which is bundled with winIDEA, already has all dependencies
14configured.
15
161. - For sequence diagrams module 'seqdiag' has to be installed.
17 First download setuptools from:
18 https://pypi.python.org/pypi/setuptools#files
19 and install.
20 - Install 'seqdiag' (use correct path for your Python installation):
21 `C:\Python27\Scripts\easy_install seqdiag`
22
23 Alternatively (if the above steps failed) you can download seqdiag from:
24 https://pypi.python.org/pypi/seqdiag/
25 Uncompress it (7-zip can be used) and run:
26
27 python setup.py
28
292. Install graphviz. Windows installer can be downloaded from:
30 http://www.graphviz.org/Download_windows.php
31 The console or IDE where the scripts will be ran should be restarted
32 after the graphviz has been installed.
33
34See also help text in function _parse_cmd_line_options().
35"""
36
37import sys
38import traceback
39import isystem.seqAndCallDiag as scdiag
40
41
42def main():
43
44 profilerExportFile = '../../targetProjects/profilerSample-1.xml'
45 callGraphImageFName = '../../targetProjects/profilerSample-1.call'
46 seqDiagImageFName = '../../targetProjects/profilerSample-1.svg'
47 functionName = ''
48 isCreateSeqDiag = True
49 isCreateCallGraph = False
50 seqDiagCompactLevel = 4
51 isCreateSeqDiagImage = True
52 isCreateCallGraphImage = False
53 isOpenSeqDiagImage = True
54 isOpenCallGraphImage = False
55 variableName = ''
56 is_binary_timeline = False
57
58 try:
59 scdiag.generateDiagrams('',
60 profilerExportFile,
61 callGraphImageFName,
62 seqDiagImageFName,
63 '',
64 isCreateSeqDiag, isCreateCallGraph,
65 4,
66 isCreateSeqDiagImage, isCreateCallGraphImage,
67 isOpenSeqDiagImage, isOpenCallGraphImage,
68 variableName, is_binary_timeline)
69 except Exception as ex:
70 print(str(ex), file=sys.stderr)
71 traceback.print_exc()
72
73
74if __name__ == "__main__":
75 main()