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
9db35f85
Commit
9db35f85
authored
May 09, 2021
by
Carsten Emde
Browse files
Improved performance of directory skipping
parent
adc39b77
Changes
1
Hide whitespace changes
Inline
Side-by-side
generatecypher.py
View file @
9db35f85
...
...
@@ -470,17 +470,12 @@ def main(argv):
dirwalker
=
os
.
walk
(
dirtoscan
)
for
direntry
in
dirwalker
:
for
filename
in
direntry
[
2
]:
fullfilename
=
os
.
path
.
join
(
direntry
[
0
],
filename
)
# Exclude specified directories
skip
=
False
for
skipdir
in
skipdirs
:
if
fullfilename
.
startswith
(
skipdir
):
skip
=
True
break
if
skip
:
for
root
,
dirs
,
files
in
os
.
walk
(
dirtoscan
,
topdown
=
True
):
[
dirs
.
remove
(
d
)
for
d
in
list
(
dirs
)
for
s
in
skipdirs
if
root
.
startswith
(
s
)]
for
filename
in
files
:
fullfilename
=
os
.
path
.
join
(
root
,
filename
)
if
fullfilename
==
[]:
continue
# Exclude broken links
...
...
@@ -518,7 +513,7 @@ def main(argv):
targetfile
=
os
.
path
.
relpath
(
targetfile
,
'/'
)
targetfile
=
os
.
path
.
join
(
dirtoscan
,
targetfile
)
else
:
targetfile
=
os
.
path
.
normpath
(
os
.
path
.
join
(
direntry
[
0
]
,
targetfile
))
targetfile
=
os
.
path
.
normpath
(
os
.
path
.
join
(
root
,
targetfile
))
# then recursively check whether or not symbolic links
# point to other symbolic links or to paths that exist
...
...
Write
Preview
Markdown
is supported
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