diff options
author | yaderv <yajosev@gmail.com> | 2011-02-23 17:24:34 (GMT) |
---|---|---|
committer | yaderv <yajosev@gmail.com> | 2011-02-23 17:24:34 (GMT) |
commit | 8f59d01cb7718c9305a9fd747ff7993ef3918d1b (patch) | |
tree | da50cefc5305f1ca46bebd5071eb24eb5d78886b /archivo.py | |
parent | 46d4776242b7618fab36328c3e22b1f64b1e21a0 (diff) |
mark and unmark selected days
Diffstat (limited to 'archivo.py')
-rw-r--r-- | archivo.py | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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() + |