-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjsoni_control.py
More file actions
29 lines (21 loc) · 849 Bytes
/
jsoni_control.py
File metadata and controls
29 lines (21 loc) · 849 Bytes
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
import json
class Config:
def __init__(self):
self.config_file = "settings.json"
def settings_reader(self):
with open(self.config_file, "r", encoding='utf-8') as read_file:
data = json.load(read_file)
return data
def settings_write(self, data):
with open(self.config_file, "w", encoding='utf-8') as outfile:
json.dump(data, outfile, indent=4)
class DB_logs:
def __init__(self):
self.config_file = "logs_info.json"
def settings_reader(self):
with open(self.config_file, "r", encoding='utf-8') as read_file:
data = json.load(read_file)
return data
def settings_write(self, data):
with open(self.config_file, "w", encoding='utf-8') as outfile:
json.dump(data, outfile, indent=4)