Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
installer
Commits
bd3de69d
Commit
bd3de69d
authored
Aug 12, 2021
by
Paul McCarthy
🚵
Browse files
BF: py2 compat - command may be unicode string
parent
7534f1b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
fslinstaller.py
View file @
bd3de69d
...
@@ -721,6 +721,14 @@ class Progress(object):
...
@@ -721,6 +721,14 @@ class Progress(object):
return
fallback
return
fallback
def
isstr
(
s
):
"""Returns True if s is a string, False otherwise, Works on python 2.7
and >=3.3.
"""
try
:
return
isinstance
(
s
,
basestring
)
except
Exception
:
return
isinstance
(
s
,
str
)
@
contextlib
.
contextmanager
@
contextlib
.
contextmanager
def
tempdir
(
override_dir
=
None
):
def
tempdir
(
override_dir
=
None
):
"""Returns a context manager which creates, changes into, and returns a
"""Returns a context manager which creates, changes into, and returns a
...
@@ -933,14 +941,13 @@ class Process(object):
...
@@ -933,14 +941,13 @@ class Process(object):
if
total
is
None
:
label
=
None
if
total
is
None
:
label
=
None
else
:
label
=
'%'
else
:
label
=
'%'
if
is
instance
(
cmd
,
str
):
cmds
=
[
cmd
]
if
is
str
(
cmd
):
cmds
=
[
cmd
]
else
:
cmds
=
cmd
else
:
cmds
=
cmd
with
Progress
(
label
=
label
,
with
Progress
(
label
=
label
,
fmt
=
'{:.0f}'
,
fmt
=
'{:.0f}'
,
transform
=
Progress
.
percent
)
as
prog
:
transform
=
Progress
.
percent
)
as
prog
:
for
cmd
in
cmds
:
for
cmd
in
cmds
:
proc
=
Process
(
cmd
,
*
args
,
**
kwargs
)
proc
=
Process
(
cmd
,
*
args
,
**
kwargs
)
...
...
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