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
Evan Edmond
fslpy
Commits
6ae4910d
Commit
6ae4910d
authored
Jan 28, 2019
by
Paul McCarthy
🚵
Browse files
BF: Adjustments to commonBase function
parent
c63487f8
Changes
1
Show whitespace changes
Inline
Side-by-side
fsl/utils/path.py
View file @
6ae4910d
...
...
@@ -485,14 +485,17 @@ def commonBase(paths):
depths
=
[
len
(
p
.
split
(
op
.
sep
))
for
p
in
paths
]
base
=
max
(
zip
(
depths
,
paths
),
key
=
operator
.
itemgetter
(
0
))[
1
]
last
=
base
while
True
:
base
=
op
.
split
(
base
)[
0
]
if
len
(
base
)
==
0
:
if
base
==
last
or
len
(
base
)
==
0
:
break
last
=
base
if
all
([
p
.
startswith
(
base
)
for
p
in
paths
]):
return
base
...
...
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