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):
|
||||
#TODO Test si ya existe un dump anterior, si no, dumpear todo lo anterior
|
||||
fileName = name+"Dump.json"
|
||||
with open(fileName,"w+") as f:
|
||||
meta = {'meta':[{
|
||||
'name': name,
|
||||
'entity': entity,
|
||||
'creationDate': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
||||
}]}
|
||||
json.dump(meta, f)
|
||||
filePath = "./dumps/"+name+"Dump.json"
|
||||
if os.path.isfile(filePath): return
|
||||
else:
|
||||
with open(filePath,"w+") as f:
|
||||
meta = {'meta':[{
|
||||
'name': name,
|
||||
'entity': entity,
|
||||
'creationDate': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
||||
}]}
|
||||
json.dump(meta, f)
|
||||
return
|
||||
|
||||
def addEntryToDump(name, element):
|
||||
#TODO Test si existe el dump anterior
|
||||
fileName = name+"Dump.json"
|
||||
with open(fileName,"w+") as f:
|
||||
filePath = "./dumps/"+name+"Dump.json"
|
||||
with open(filePath,"w+") as f:
|
||||
message = {'mensaje':[{
|
||||
'element': element,
|
||||
'Date': strftime("%Y-%m-%d %H:%M:%S", gmtime())
|
||||
|
Loading…
Reference in New Issue
Block a user