diff options
author | Yader Velásquez <yajosev@gmail.com> | 2010-09-02 14:35:55 (GMT) |
---|---|---|
committer | Yader Velásquez <yajosev@gmail.com> | 2010-09-02 14:35:55 (GMT) |
commit | 0998139878240109abfb261e74b9679288eef454 (patch) | |
tree | e645639d4c80c85db483e573a6f5e92631796fa1 /archivo.py | |
parent | bda270ef0c1a7da5c60737b95d9c8f920f7a9e98 (diff) |
better documentation
Diffstat (limited to 'archivo.py')
-rw-r--r-- | archivo.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -22,12 +22,12 @@ import gobject from gettext import gettext as _ def crear_modelo(indice): - '''create a define liststore model''' + '''create the liststore model for the main block''' archivo = open('files/actividades.pkl', 'rb') dia = pickle.load(archivo) contar = 1 modelo = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING) - #esto cambiara de acuerdo al proceso de automatizacion + if dia.has_key(indice): for activ in dia[indice]: modelo.append([contar, activ]) @@ -35,17 +35,18 @@ def crear_modelo(indice): else : vacio = (_('no hay actividades para el día de hoy')) modelo.append([0,vacio]) + archivo.close() return modelo def abrir_efemeride(): - '''open the ephemeris file and return a dictionary''' + '''open the ephemeris file and return a data dictionary''' archivo = open('files/efemerides.pkl', 'rb') texto = pickle.load(archivo) return texto def guardar_dato(indice, contenido): - '''add new content to a list in a dictionary''' + '''save the content in a file, add the content to a dictionary->list''' indice = str(indice) f = open('files/actividades.pkl', 'rb+wb') dia = pickle.load(f) @@ -54,6 +55,6 @@ def guardar_dato(indice, contenido): dia[indice].append(contenido) f.seek(0) pickle.dump(dia, f) - #f.flush() + f.flush() f.close() |