Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/archivo.py
diff options
context:
space:
mode:
authorYader Velásquez <yajosev@gmail.com>2011-02-11 22:35:20 (GMT)
committer Yader Velásquez <yajosev@gmail.com>2011-02-11 22:35:20 (GMT)
commit21e27352e9540aff73fcebe47b023ab61bd193e1 (patch)
treeb2f0f5ec0bed37f436d7981fa325dc0eff7c7274 /archivo.py
parenta843016ab52b06030d3cd85889b44564316500f0 (diff)
mark calendar fuction improved
Diffstat (limited to 'archivo.py')
-rw-r--r--archivo.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/archivo.py b/archivo.py
index 12a461a..7eea239 100644
--- a/archivo.py
+++ b/archivo.py
@@ -118,7 +118,6 @@ def guardar_dato(indice, contenido, categoria, bolean, path):
dia[indice].append([contenido, categoria, prioridad])
f.seek(0)
pickle.dump(dia, f)
- f.flush()
f.close()
def borrar_dato(indice, indice_lista, path):
@@ -132,7 +131,6 @@ def borrar_dato(indice, indice_lista, path):
del dia[indice][indice_lista]
f.seek(0)
pickle.dump(dia, f)
- f.flush()
f.close()
def dict_meses(path, fecha=None):
@@ -147,7 +145,6 @@ def dict_meses(path, fecha=None):
_log.debug('THE FILE LISTA_DIAS DID NOT EXISTS')
f = open(path, 'wb')
datos = {}
- pickle.dump(datos, f)
else:
f = open(path, 'rb+wb')
@@ -155,14 +152,12 @@ def dict_meses(path, fecha=None):
if fecha is not None:
if indice in datos:
- datos[indice] = lista_fechas.append(fecha)
+ datos[indice].append(fecha)
else:
- lista_fechas = []
- lista_fechas.append(fecha)
- datos[indice] = lista_fechas
- pickle.dump(datos, f)
-
+ datos[indice] = []
+
+
f.seek(0)
- f.flush()
+ pickle.dump(datos, f)
f.close()
return datos