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
add_module
Commits
383f7553
Commit
383f7553
authored
Oct 22, 2020
by
Paul McCarthy
🚵
Browse files
MNT: de-lint
parent
60e7391e
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsl/add_module/admin.py
View file @
383f7553
...
...
@@ -24,7 +24,7 @@ import sys
import
shlex
import
pathlib
from
typing
import
Union
,
Optional
,
List
,
Sequence
,
Callable
from
typing
import
Union
,
Optional
,
List
,
Callable
from
fsl.add_module.messages
import
error
...
...
@@ -54,7 +54,7 @@ def runAsAdmin(routine : str, *argv : str):
thismod
=
op
.
abspath
(
__file__
)
argv
=
[
'sudo'
,
command
,
thismod
]
+
[
routine
]
+
list
(
argv
)
argv
=
[
shlex
.
quote
(
a
)
for
a
in
argv
]
result
=
sp
.
run
(
' '
.
join
(
argv
),
shell
=
True
)
result
=
sp
.
run
(
' '
.
join
(
argv
),
shell
=
True
,
check
=
False
)
if
result
.
returncode
!=
0
:
error
(
f
'Admin call failed:
{
argv
}
'
,
wrap
=
False
)
...
...
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