From 307971bb5757a88b368d31ba698fbf3851707ecd Mon Sep 17 00:00:00 2001 From: Yader Velásquez Date: Tue, 01 Feb 2011 22:02:08 +0000 Subject: new fuction for mark the days of the calendar --- (limited to 'archivo.py') diff --git a/archivo.py b/archivo.py index d3726ce..b913cfa 100644 --- a/archivo.py +++ b/archivo.py @@ -96,8 +96,6 @@ def guardar_efemeride(path, file_name): current_text = current_text[:j] + '\n' + current_text[j + 1 :] current_id = lines[i][0 : 8] di[current_id] = current_text - _log.debug(di) - _log.debug(type(path)) file_new = open(path, 'wb') pickle.dump(di,file_new) file_new.close() @@ -136,3 +134,25 @@ def borrar_dato(indice, indice_lista, path): pickle.dump(dia, f) f.flush() f.close() + +def lista_meses(path): + path = path + '/data/lista_dias.pkl' + + meses = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'ago', 'sep', + 'oct', 'nov', 'dec'] + + if not os.path.exists(path): + _log.debug('THE FILE LISTA_DIAS DID NOT EXISTS') + f = open(path, 'wb') + datos = {} + for i in meses: + datos[i] = [] + pickle.dump(datos, f) + + else: + f = open(path, 'rb + wb') + datos = pickle.load(f) + f.seek(0) + f.flush() + f.close() + return datos -- cgit v0.9.1