Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
35e1f629
Commit
35e1f629
authored
May 31, 2021
by
Dennis Gläser
Browse files
[bin][util] make common.py PEP8-compliant
parent
534d19b2
Changes
1
Show whitespace changes
Inline
Side-by-side
bin/util/common.py
View file @
35e1f629
...
...
@@ -3,12 +3,14 @@ import sys
import
functools
import
subprocess
# execute a command and retrieve the output
def
runCommand
(
command
):
try
:
return
subprocess
.
run
(
command
,
shell
=
True
,
check
=
True
,
return
subprocess
.
run
(
command
,
shell
=
True
,
check
=
True
,
text
=
True
,
capture_output
=
True
).
stdout
except
Exception
as
e
:
except
Exception
:
print
()
print
(
"An error occurred during subprocess run:"
)
print
(
"-- command: {}"
.
format
(
command
))
...
...
@@ -16,11 +18,12 @@ def runCommand(command):
print
(
"-- error: {}"
.
format
(
sys
.
exc_info
()[
1
]))
if
"git "
in
command
:
print
()
print
(
"It seems that a git command failed. Please check:
\n
"
\
" -- is the module registered as git repository?
\n
"
\
print
(
"It seems that a git command failed. Please check:
\n
"
" -- is the module registered as git repository?
\n
"
" -- is upstream defined for the branch?
\n
"
)
raise
# decorator to call function from within the given path
def
callFromPath
(
path
):
def
decorator_callFromPath
(
callFunc
):
...
...
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