-
Notifications
You must be signed in to change notification settings - Fork 0
/
salva.py
47 lines (40 loc) · 960 Bytes
/
salva.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
44
45
46
47
"""
pass
"""
import json
def checkpoint(tabelas, log):
"""
pass
"""
salva_log(log)
salva_checkpoint(tabelas)
def commit(log):
"""
pass
"""
salva_log(log)
def carrega_tabelas():
"""
pass
"""
nome = "banco_de_dados.json"
with open(nome) as arq:
print("Base de dados Carregada.")
return json.load(arq)
def salva_checkpoint(tabelas):
"""pass
https://stackoverflow.com/questions/13249415/can-i-implement-custom-indentation-for-pretty-printing-in-python-s-json-module
"""
nome = "banco_de_dados.json"
modo = 'w'
with open(nome, modo) as arq:
json.dump(tabelas, arq, indent=4)
print("Base de dados Salva.")
def salva_log(log):
"""pass"""
nome = "log.json"
modo = 'w'
with open(nome, modo) as arq:
json.dump(log, arq, indent='\t')
print("Log salvo!")
# pass