Commit 9bc7d650 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Moved imcp/mv main scripts into a proper package, so they can be

programmatically invoked.
parent 5bf216bc
#!/usr/bin/env python
#
# __init__.py - The fsl.scripts package.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""The ``fsl.scripts`` package contains all of the executable scripts provided
by ``fslpy``.
"""
#!/usr/bin/env python
#
# imcp - Copy image files.
# imcp.py - Copy image files.
#
# Author: Paul McCarthy <paulmc@fmrib.ox.ac.uk>
#
"""This module defines the ``imcp`` application, for copying NIFTI image
files.
The :func:`main` function is essentially a wrapper around the
:func:`fsl.utils.imcp.imcp` function - see its documentation for more details.
"""
from __future__ import print_function
......@@ -33,6 +39,9 @@ def main(argv=None):
:func:`fsl.utils.imcp.imcp` function on each input.
"""
if argv is None:
argv = sys.argv[1:]
if len(argv) < 2:
print(usage)
sys.exit(1)
......
#!/usr/bin/env python
#
# immv - Move image files.
# immv.py - Move image files.
#
# Author: Paul McCarthy <paulmc@fmrib.ox.ac.uk>
#
"""This module defines the ``immv`` application, for moving NIFTI image
files.
The :func:`main` function is essentially a wrapper around the
:func:`fsl.utils.imcp.immv` function - see its documentation for more details.
"""
from __future__ import print_function
......@@ -53,7 +60,7 @@ def main(argv=None):
for src in srcs:
try:
imcp.immv(src, dest, useDefaultExt=True, move=True)
imcp.immv(src, dest, useDefaultExt=True)
except Exception as e:
print(e)
......
......@@ -60,8 +60,10 @@ setup(
tests_require=['pytest', 'pytest-runner'],
test_suite='tests',
scripts=[
op.join('bin', 'fslpy_imcp'),
op.join('bin', 'fslpy_immv'),
]
entry_points={
'console_scripts' : [
'fslpy_imcp = fsl.scripts.imcp:main',
'fslpy_immv = fsl.scripts.immv:main'
]
}
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment