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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
35d904f1
Commit
35d904f1
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
fsl/__init__ uses pkgutil to find fslpy tools, instead of 'glob fsl/tools/*py'
parent
8ff5a279
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/__init__.py
+2
-11
2 additions, 11 deletions
fsl/__init__.py
with
2 additions
and
11 deletions
fsl/__init__.py
+
2
−
11
View file @
35d904f1
...
@@ -52,12 +52,11 @@ also provide the following module level attributes:
...
@@ -52,12 +52,11 @@ also provide the following module level attributes:
import
logging
import
logging
import
pkgutil
import
warnings
import
warnings
import
os
import
os
import
os.path
as
op
import
sys
import
sys
import
glob
import
argparse
import
argparse
import
importlib
import
importlib
import
subprocess
import
subprocess
...
@@ -109,15 +108,7 @@ def getFSLToolNames():
...
@@ -109,15 +108,7 @@ def getFSLToolNames():
"""
Returns the name of every tool in the :mod:`fsl.tools` package.
"""
Returns the name of every tool in the :mod:`fsl.tools` package.
"""
"""
toolFiles
=
glob
.
glob
(
op
.
join
(
op
.
dirname
(
tools
.
__file__
),
'
*py
'
))
allTools
=
[
mod
for
_
,
mod
,
_
in
pkgutil
.
iter_modules
(
tools
.
__path__
)]
allTools
=
[]
for
toolFile
in
toolFiles
:
toolName
=
op
.
splitext
(
op
.
basename
(
toolFile
))[
0
]
if
toolName
!=
'
__init__
'
:
allTools
.
append
(
toolName
)
return
allTools
return
allTools
...
...
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