Skip to content

Commit 17ab332

Browse files
committed
initialize_cent_config will generate a config from a base config
1 parent fcae1ae commit 17ab332

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

example_config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"state": {
3+
"host": "localhost",
4+
"port": 6379
5+
},
6+
"structure": {
7+
"module": "centrifuge.structure.sqlite",
8+
"settings": {
9+
"path": "centrifuge.db"
10+
}
11+
}
12+
}

wwc/wwc/scripts/initialize_cent_config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ def section_template(section):
2424

2525

2626
def load_config():
27-
with open("config.json") as f:
27+
if os.path.isfile('config.json'):
28+
filename = 'config.json'
29+
else:
30+
filename = 'example_config.json'
31+
with open(filename) as f:
2832
return json.loads(f.read())
2933

3034

0 commit comments

Comments
 (0)