Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openCARP
carputils
Commits
c9506fb8
Commit
c9506fb8
authored
Jun 28, 2021
by
Marie Houillon
Browse files
Add condition on bundle module loading
parent
5a63243a
Pipeline
#2166
passed with stage
in 1 minute and 9 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
carputils/bundle/__init__.py
View file @
c9506fb8
...
...
@@ -60,4 +60,5 @@ from carputils.bundle.bundle import BundleModule
# This hack is 'officially' supported, as outlined in this message by Gudio van
# Rossum, the creator of Python:
# https://mail.python.org/pipermail/python-ideas/2012-May/014969.html
sys
.
modules
[
__name__
]
=
BundleModule
()
if
hasattr
(
sys
.
modules
[
'__main__'
],
'__file__'
):
sys
.
modules
[
__name__
]
=
BundleModule
()
\ No newline at end of file
carputils/settings/buildinfo.py
View file @
c9506fb8
...
...
@@ -100,11 +100,10 @@ def makevars(execs):
makevars
.
CIRCADAPT
=
0
makevars
.
FSM
=
0
makevars
.
WITH_PURK
=
0
cmd
=
[
str
(
execs
.
CARP
),
'-buildinfo'
]
try
:
output
=
subprocess
.
check_output
(
cmd
).
decode
(
'utf8'
).
split
(
'
\n
'
)
except
subprocess
.
CalledProcessError
:
warn
(
'Error retrieving -buildinfo from openCARP - assuming no mechanics '
'or CUDA'
)
...
...
carputils/settings/summary.py
View file @
c9506fb8
...
...
@@ -24,7 +24,6 @@ def summary(config, execs, solver_opts, cli):
"""
Generate a summary report of the execs generated by cli.
"""
width
=
format
.
terminal_width
()
EQUALS_LINE
=
'='
*
width
DASH_LINE
=
'-'
*
width
...
...
carputils/tools.py
View file @
c9506fb8
...
...
@@ -446,7 +446,6 @@ def carpexample(parser=standard_parser,
"""
@
wraps
(
run
)
def
wrapped
(
argv
=
sys
.
argv
[
1
:],
job
=
None
,
outdir
=
None
):
# Generate parser
prs
=
parser
()
...
...
@@ -488,7 +487,11 @@ def carpexample(parser=standard_parser,
# Create self-contained bundle
if
settings
.
cli
.
bundle
is
not
None
:
bundle
.
create_bundle_folder
()
if
not
hasattr
(
sys
.
modules
[
'__main__'
],
'__file__'
):
print
(
"Your system configuration doesn't allow to use the --bundle option."
)
sys
.
exit
(
0
)
else
:
bundle
.
create_bundle_folder
()
# Generate job ID
if
temp
:
...
...
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