Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
f50ff414
Commit
f50ff414
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
BF: fixes to info function
parent
54d0e61d
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/utils/fslsub.py
+4
-4
4 additions, 4 deletions
fsl/utils/fslsub.py
with
4 additions
and
4 deletions
fsl/utils/fslsub.py
+
4
−
4
View file @
f50ff414
...
@@ -40,8 +40,7 @@ Example usage, building a short pipeline::
...
@@ -40,8 +40,7 @@ Example usage, building a short pipeline::
"""
"""
from
six
import
string_types
,
BytesIO
from
six
import
BytesIO
import
subprocess
as
sp
import
os.path
as
op
import
os.path
as
op
import
glob
import
glob
import
time
import
time
...
@@ -149,8 +148,9 @@ def info(job_id):
...
@@ -149,8 +148,9 @@ def info(job_id):
:return: dictionary with information on the submitted job (empty
:return: dictionary with information on the submitted job (empty
if job does not exist)
if job does not exist)
"""
"""
from
fsl.utils.run
import
run
try
:
try
:
result
=
sp
.
call
([
'
qstat
'
,
'
-j
'
,
job_id
])
.
decode
(
'
utf-8
'
)
result
=
run
([
'
qstat
'
,
'
-j
'
,
job_id
])
except
FileNotFoundError
:
except
FileNotFoundError
:
log
.
debug
(
"
qstat not found; assuming not on cluster
"
)
log
.
debug
(
"
qstat not found; assuming not on cluster
"
)
return
{}
return
{}
...
@@ -158,7 +158,7 @@ def info(job_id):
...
@@ -158,7 +158,7 @@ def info(job_id):
return
{}
return
{}
res
=
{}
res
=
{}
for
line
in
result
.
splitlines
()[
1
:]:
for
line
in
result
.
splitlines
()[
1
:]:
key
,
value
=
line
.
split
(
'
:
'
,
nsplit
=
1
)
key
,
value
=
line
.
split
(
'
:
'
,
1
)
res
[
key
.
strip
()]
=
value
.
strip
()
res
[
key
.
strip
()]
=
value
.
strip
()
return
res
return
res
...
...
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