Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3BUU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
simulation
KM3BUU
Commits
50ba43b8
Commit
50ba43b8
authored
4 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Black format
parent
840d852d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Merge python environment
Pipeline
#12494
failed
4 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
km3buu/__version__.py
+3
-3
3 additions, 3 deletions
km3buu/__version__.py
km3buu/config.py
+8
-8
8 additions, 8 deletions
km3buu/config.py
with
11 additions
and
11 deletions
km3buu/__version__.py
+
3
−
3
View file @
50ba43b8
...
...
@@ -13,10 +13,10 @@ from os.path import dirname, realpath, join
from
setuptools_scm
import
get_version
version
=
'
unknown version
'
version
=
"
unknown version
"
try
:
version
=
get_version
(
root
=
'
..
'
,
relative_to
=
__file__
)
version
=
get_version
(
root
=
"
..
"
,
relative_to
=
__file__
)
except
LookupError
:
with
open
(
join
(
realpath
(
dirname
(
__file__
)),
"
version.txt
"
),
'
r
'
)
as
fobj
:
with
open
(
join
(
realpath
(
dirname
(
__file__
)),
"
version.txt
"
),
"
r
"
)
as
fobj
:
version
=
fobj
.
read
()
This diff is collapsed.
Click to expand it.
km3buu/config.py
+
8
−
8
View file @
50ba43b8
...
...
@@ -22,7 +22,7 @@ __maintainer__ = "Johannes Schumann"
__email__
=
"
jschumann@km3net.de
"
__status__
=
"
Development
"
CONFIG_PATH
=
os
.
path
.
expanduser
(
'
~/.km3buu/config
'
)
CONFIG_PATH
=
os
.
path
.
expanduser
(
"
~/.km3buu/config
"
)
log
=
get_logger
(
__name__
)
...
...
@@ -37,7 +37,7 @@ class Config(object):
if
section
not
in
self
.
config
.
sections
():
self
.
config
.
add_section
(
section
)
self
.
config
.
set
(
section
,
key
,
value
)
with
open
(
self
.
_config_path
,
'
w
'
)
as
f
:
with
open
(
self
.
_config_path
,
"
w
"
)
as
f
:
self
.
config
.
write
(
f
)
def
get
(
self
,
section
,
key
,
default
=
None
):
...
...
@@ -59,17 +59,17 @@ class Config(object):
dev_path
=
abspath
(
join
(
dirname
(
__file__
),
os
.
pardir
,
IMAGE_NAME
))
if
isfile
(
dev_path
):
image_path
=
dev_path
elif
click
.
confirm
(
"
Is the GiBUU image already available?
"
,
default
=
False
):
image_path
=
click
.
prompt
(
"
GiBUU image path?
"
,
type
=
click
.
Path
(
exists
=
True
,
dir_okay
=
False
))
elif
click
.
confirm
(
"
Is the GiBUU image already available?
"
,
default
=
False
):
image_path
=
click
.
prompt
(
"
GiBUU image path?
"
,
type
=
click
.
Path
(
exists
=
True
,
dir_okay
=
False
)
)
elif
click
.
confirm
(
"
Install image from remote?
"
,
default
=
True
):
default_dir
=
join
(
os
.
environ
[
"
HOME
"
],
"
.km3buu
"
)
image_dir
=
click
.
prompt
(
"
GiBUU image path (default: ~/.km3buu) ?
"
,
type
=
click
.
Path
(
exists
=
True
,
file_okay
=
False
),
default
=
default_dir
)
default
=
default_dir
,
)
image_path
=
build_image
(
image_dir
)
self
.
set
(
section
,
key
,
image_path
)
return
image_path
...
...
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