nada formado (1)
This commit is contained in:
parent
5c4c85743f
commit
3918db58cc
11
main.py
11
main.py
@ -47,19 +47,22 @@ def handler(events):
|
|||||||
|
|
||||||
def createNewDump(name, entity):
|
def createNewDump(name, entity):
|
||||||
#TODO Test si ya existe un dump anterior, si no, dumpear todo lo anterior
|
#TODO Test si ya existe un dump anterior, si no, dumpear todo lo anterior
|
||||||
fileName = name+"Dump.json"
|
filePath = "./dumps/"+name+"Dump.json"
|
||||||
with open(fileName,"w+") as f:
|
if os.path.isfile(filePath): return
|
||||||
|
else:
|
||||||
|
with open(filePath,"w+") as f:
|
||||||
meta = {'meta':[{
|
meta = {'meta':[{
|
||||||
'name': name,
|
'name': name,
|
||||||
'entity': entity,
|
'entity': entity,
|
||||||
'creationDate': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
'creationDate': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
||||||
}]}
|
}]}
|
||||||
json.dump(meta, f)
|
json.dump(meta, f)
|
||||||
|
return
|
||||||
|
|
||||||
def addEntryToDump(name, element):
|
def addEntryToDump(name, element):
|
||||||
#TODO Test si existe el dump anterior
|
#TODO Test si existe el dump anterior
|
||||||
fileName = name+"Dump.json"
|
filePath = "./dumps/"+name+"Dump.json"
|
||||||
with open(fileName,"w+") as f:
|
with open(filePath,"w+") as f:
|
||||||
message = {'mensaje':[{
|
message = {'mensaje':[{
|
||||||
'element': element,
|
'element': element,
|
||||||
'Date': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
'Date': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
||||||
|
Loading…
Reference in New Issue
Block a user