-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample_user_json_gen.py
43 lines (33 loc) · 1.28 KB
/
sample_user_json_gen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#user weburl and pushover tokens config
import os
import json
import platform
# paths between platforms
if platform.system() == 'Windows':
wdir = 'D:\\GitHub\\Bindicator'
elif platform.system() == 'Linux':
wdir = '/home/pi/Documents/Bindicator'
# make a folder called user_config and ENSURE this is in the gitignore
# DO NOT COMMIT YOUR USER DATA TO GITHUB!
os.chdir(os.path.join(wdir,'user_config'))
def write_json (filename, data):
with open(filename, 'w') as outfile:
json.dump(data, outfile)
# add your data here
users = {
"<user1>" : {"council" : "<add_council_as_in_xpaths>"
,"urlpath" : "<add_house_bin_collection_url>"
, "apptoken" : "<add_bindicator_pushover_app_token>"
, "usertoken" : "<add_user_pushover_token>"
, "notification" : "yes" # setting for if this user should get push notifications
, "bindicate" : "yes" # setting for if this user should get bindicator lights
},
"[user2]" : {"council" : "<add_council_as_in_xpaths>"
,"urlpath" : "<add_house_bin_collection_url>"
, "apptoken" : "<add_bindicator_pushover_app_token>"
, "usertoken" : "<add_user_pushover_token>"
, "notification" : "yes"
, "bindicate" : "no"
}
}
write_json('users.json', users)