nada formado (1)
This commit is contained in:
parent
5c4c85743f
commit
3918db58cc
23
main.py
23
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
|
||||||
meta = {'meta':[{
|
else:
|
||||||
'name': name,
|
with open(filePath,"w+") as f:
|
||||||
'entity': entity,
|
meta = {'meta':[{
|
||||||
'creationDate': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
'name': name,
|
||||||
}]}
|
'entity': entity,
|
||||||
json.dump(meta, f)
|
'creationDate': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
||||||
|
}]}
|
||||||
|
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