-
Notifications
You must be signed in to change notification settings - Fork 47
/
config.py
42 lines (37 loc) · 1.24 KB
/
config.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
import json
conf = open("config.json")
configData = json.load(conf)
conf.close()
def getConfigStatus(key):
f = open("config.json")
configData = json.load(f)
f.close()
return configData[key]
def setConfigStatus(key, value):
f = open("config.json")
configData = json.load(f)
f.close()
configData[key] = value
with open("config.json", "w") as outfile:
outfile.write(json.dumps(configData, indent=4))
return
pb_token = configData["pushbutton_token"]
pushbutton_device_iden = configData["pushbutton_device_iden"]
jwt_token = configData["wfm_jwt_token"]
jwt_token = "JWT " + jwt_token.split(" ")[-1]
inGameName = configData['inGameName']
platform = configData['platform'].lower()
webhookLink = configData["webhookLink"]
# Read JSON file
with open('settings.json') as settings:
data = json.load(settings)
# Extract values and initialize variables
blacklistedItems = data['blacklistedItems']
whitelistedItems = data['whitelistedItems']
strictWhitelist = data['strictWhitelist']
priceShiftThreshold = data['priceShiftThreshold']
avgPriceCap = data['avgPriceCap']
maxTotalPlatCap = data['maxTotalPlatCap']
volumeThreshold = data['volumeThreshold']
rangeThreshold = data['rangeThreshold']
pingOnNotif = data["pingOnNotif"]