Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
4ab83ccb
Commit
4ab83ccb
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: New abspath script
parent
9a9b51ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/scripts/fsl_abspath.py
+35
-0
35 additions, 0 deletions
fsl/scripts/fsl_abspath.py
with
35 additions
and
0 deletions
fsl/scripts/fsl_abspath.py
0 → 100644
+
35
−
0
View file @
4ab83ccb
#!/usr/bin/env python
#
# fsl_abspath.py - Make a path absolute
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""
The fsl_abspath command - makes relative paths absolute.
"""
import
os.path
as
op
import
sys
usage
=
"""
usage: fsl_abspath path
"""
.
strip
()
def
main
(
argv
=
None
):
"""
fsl_abspath - make a relative path absolute.
"""
if
argv
is
None
:
argv
=
sys
.
argv
[
1
:]
if
len
(
argv
)
!=
1
:
print
(
usage
)
return
1
print
(
op
.
realpath
(
argv
[
0
]))
return
0
if
__name__
==
'
__main__
'
:
sys
.
exit
(
main
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment