Browse Source

Enabled comments in config files

1.00.00
Sven Karsten 1 year ago
parent
commit
ff759bffec
  1. 3
      DESTINATIONS.example
  2. 7
      gui/iow_esm_globals.py

3
DESTINATIONS.example

@ -1,4 +1,5 @@
haumea sk1480@haumea1:/data/sk1480/IOW_ESM
phy-2 karsten@phy-2:/silod7/karsten/IOW_ESM
hlrnb mvkkarst@blogin:/scratch/usr/mvkkarst/IOW_ESM
hlrng mvkkarst@glogin:/scratch/usr/mvkkarst/IOW_ESM
hlrng mvkkarst@glogin:/scratch/usr/mvkkarst/IOW_ESM
# you can add comments if the line starts with '#'

7
gui/iow_esm_globals.py

@ -35,10 +35,17 @@ def read_iow_esm_configuration(file_name):
config = {}
with open(file_name, "r") as f:
for line in f:
# skip comments
if line[0] == "#":
continue
# separate line into keyword and value
try:
(key, val) = line.split()
config[key] = val
except:
# ignore empty lines
pass
return config
Loading…
Cancel
Save