Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Caren Kresse
callgraph
Commits
7e75e3a8
Commit
7e75e3a8
authored
May 15, 2021
by
Carsten Emde
Browse files
Added option to specify font name for Graphviz
parent
9f2be485
Changes
1
Show whitespace changes
Inline
Side-by-side
generatecypher.py
View file @
7e75e3a8
...
...
@@ -64,7 +64,7 @@ def notarget(filename, limitsearch):
def
createoutput
(
outputdir
,
outputformat
,
machine_to_binary
,
linked_libraries
,
filename_to_full_path
,
elf_to_exported_symbols
,
elf_to_imported_symbols
,
symlink_to_target
,
targets
,
forcesymbols
):
elf_to_imported_symbols
,
symlink_to_target
,
targets
,
forcesymbols
,
fontname
):
'''Create an output file for each set of ELF files that belongs together'''
# create an output file for each architecture/operating system
...
...
@@ -159,6 +159,10 @@ def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
outputfileopen
.
write
(
"<nodes>
\n
"
)
elif
outputformat
==
'gv'
:
outputfileopen
.
write
(
"digraph "
+
os
.
path
.
basename
(
limitsearch
[
0
])
+
" {
\n
ratio=0.562;
\n
"
)
if
fontname
is
not
None
:
outputfileopen
.
write
(
" graph [fontname=
\"
"
+
fontname
+
"
\"
];
\n
"
)
outputfileopen
.
write
(
" node [fontname=
\"
"
+
fontname
+
"
\"
];
\n
"
)
outputfileopen
.
write
(
" edge [fontname=
\"
"
+
fontname
+
"
\"
];
\n
"
)
seenfirst
=
False
...
...
@@ -410,6 +414,10 @@ def main(argv):
dest
=
"outputformat"
,
help
=
"output format 'cypher', 'gexf', 'gv' or 'text', default 'gv'"
,
metavar
=
"FORMAT"
)
parser
.
add_argument
(
"-p"
,
"--fontname"
,
action
=
"store"
,
dest
=
"fontname"
,
help
=
"name of the font to be used throughout the document ('gv' only)"
,
metavar
=
"FONT"
)
parser
.
add_argument
(
"-s"
,
"--skipdirs"
,
action
=
"store"
,
dest
=
"skipdirs"
,
help
=
"exclude directories from being scanned"
,
metavar
=
"DIR"
)
...
...
@@ -771,7 +779,7 @@ def main(argv):
createoutput
(
outputdir
,
outputformat
,
machine_to_binary
,
linked_libraries
,
filename_to_full_path
,
elf_to_exported_symbols
,
elf_to_imported_symbols
,
symlink_to_target
,
args
.
targets
,
args
.
forcesymbols
)
args
.
targets
,
args
.
forcesymbols
,
args
.
fontname
)
if
__name__
==
"__main__"
:
main
(
sys
.
argv
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment