Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
METRo projects
metro
Commits
de4ab480
Commit
de4ab480
authored
Mar 26, 2008
by
Miguel Tremblay
Browse files
No need to use 'len(list)-1' to retrieve the last argument of a list. '-1' is enough.
parent
46c8bd7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/frontend/toolbox/metro_util.py
View file @
de4ab480
...
...
@@ -83,11 +83,11 @@ def get_metro_root_path( ):
Return the root path of METRo package.
"""
lPath
=
string
.
split
(
sys
.
path
[
0
],
"/"
)
if
lPath
[
len
(
lPath
)
-
1
]
==
"frontend"
:
if
lPath
[
-
1
]
==
"frontend"
:
sRoot_path
=
string
.
join
(
lPath
[:
-
2
],
"/"
)
elif
lPath
[
len
(
lPath
)
-
1
]
==
"bin"
:
elif
lPath
[
-
1
]
==
"bin"
:
sRoot_path
=
string
.
join
(
lPath
[:
-
1
],
"/"
)
elif
lPath
[
len
(
lPath
)
-
1
]
==
"metro"
:
elif
lPath
[
-
1
]
==
"metro"
:
sRoot_path
=
string
.
join
(
lPath
[:
-
3
],
"/"
)
else
:
# Check if metro_util is used as a library
lPythonPath
=
string
.
split
(
os
.
environ
[
'PYTHONPATH'
],
":"
)
...
...
@@ -103,7 +103,7 @@ def get_metro_root_path( ):
_
(
"Aborting execution of METRo.
\n
"
)
print
sError
sys
.
exit
(
1
)
return
sRoot_path
def
get_exec_root_path
(
):
...
...
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