Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F66660240
loadconf.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jun 12, 04:42
Size
759 B
Mime Type
text/x-python
Expires
Fri, Jun 14, 04:42 (2 d)
Engine
blob
Format
Raw Data
Handle
18256628
Attached To
R11586 sausage-api
loadconf.py
View Options
# © All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE,
# Switzerland
# SCITAS - Scientific IT and Application Support, 2021
# See the LICENSE.txt file for more details.
import
json
class
LoadConf
(
object
):
def
__init__
(
self
):
self
.
clusters
=
[]
self
.
currencies
=
[
"time"
,
"chf"
,
"co2"
]
self
.
time
=
{}
self
.
chf
=
{}
self
.
co2
=
{}
with
open
(
'/etc/sausage/sausage-api.json'
)
as
fj
:
self
.
conf
=
json
.
load
(
fj
)
for
key
,
value
in
self
.
conf
.
items
():
self
.
clusters
.
append
(
key
)
for
cl
in
self
.
clusters
:
self
.
time
.
update
({
cl
:
1
,
})
self
.
chf
.
update
({
cl
:
self
.
conf
[
cl
][
"chf"
],
})
self
.
co2
.
update
({
cl
:
self
.
conf
[
cl
][
"co2"
],
})
Event Timeline
Log In to Comment