Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/archivo.py
diff options
context:
space:
mode:
authoryaderv <yajosev@gmail.com>2011-02-23 17:24:34 (GMT)
committer yaderv <yajosev@gmail.com>2011-02-23 17:24:34 (GMT)
commit8f59d01cb7718c9305a9fd747ff7993ef3918d1b (patch)
treeda50cefc5305f1ca46bebd5071eb24eb5d78886b /archivo.py
parent46d4776242b7618fab36328c3e22b1f64b1e21a0 (diff)
mark and unmark selected days
Diffstat (limited to 'archivo.py')
-rw-r--r--archivo.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/archivo.py b/archivo.py
index bd0b5be..1932e0f 100644
--- a/archivo.py
+++ b/archivo.py
@@ -157,7 +157,10 @@ def dict_meses(path, fecha=None):
if fecha is not None:
if indice in datos:
- datos[indice].append(fecha)
+ if not fecha in datos[indice]:
+ datos[indice].append(fecha)
+ else:
+ pass
else:
datos[indice] = []
@@ -166,3 +169,16 @@ def dict_meses(path, fecha=None):
pickle.dump(datos, f)
f.close()
return datos
+
+def borrar_dict_meses(path, fecha):
+ path = path + '/data/lista_dias.pkl'
+ indice = fecha[:4]
+ fecha = int(fecha[4:])
+ f = open(path, 'rb+wb')
+ datos = pickle.load(f)
+ borrar = datos[indice].index(fecha)
+ del datos[indice][borrar]
+ f.seek(0)
+ pickle.dump(datos, f)
+ f.close()
+