diff options
-rwxr-xr-x | MANIFEST | 4 | ||||
-rw-r--r-- | archivo.py | 7 | ||||
-rw-r--r-- | calendario.py | 12 | ||||
-rw-r--r-- | fecha.py | 2 |
4 files changed, 16 insertions, 9 deletions
@@ -1,8 +1,12 @@ archivo.py LICENSE +README setup.py fecha.py COPYING calendario.py +po/Calendario.pot activity/activity.info activity/icono_calendario.svg +.calendario.py.swp +efe.pkl @@ -69,18 +69,17 @@ def crear_modelo(indice, path): def abrir_efemeride(path): '''open the ephemeris file and return a data dictionary''' path = path + '/data/efemerides.pkl' - if not os.path.exists(path): _log.debug('THE FILE EFEMERIDES DID NOT EXISTS') archivo = open(path, 'wb') texto = {} pickle.dump(texto, archivo) - + archivo.close() else: - #_log.debug('THE FILE EXISTS') + _log.debug('THE FILE EPHEMERIS EXISTS') archivo = open(path, 'rb') texto = pickle.load(archivo) - + archivo.close() return texto def guardar_dato(indice, contenido, categoria, bolean, path): diff --git a/calendario.py b/calendario.py index 32271d9..420f761 100644 --- a/calendario.py +++ b/calendario.py @@ -22,6 +22,7 @@ import gtk import logging from sugar.activity import activity +from sugar.graphics.toolbutton import ToolButton class CalendarioActivity(activity.Activity): '''the sugar class''' @@ -29,9 +30,12 @@ class CalendarioActivity(activity.Activity): def __init__(self, handle, create_jobject=True): ''' init class''' activity.Activity.__init__(self, handle, False) - #super(CalendarioActivity, self).__init__(handle) self.set_title(_('Calendario')) + + barra_nueva = gtk.Toolbar() + barra_nueva.show() barra_herramientas = activity.ActivityToolbox(self) + barra_herramientas.add_toolbar(_('Opciones'),barra_nueva) self.set_toolbox(barra_herramientas) barra_herramientas.show() self.fecha_normal = FechaNormal() @@ -71,11 +75,11 @@ class CalendarioActivity(activity.Activity): #ephemeris files self.texto = abrir_efemeride(self.path) - if self.texto.has_key(self.fecha_normal.fecha_especial()): + if self.texto.has_key(self.fecha_normal.fecha_especial()): self.buffer.set_text(self.texto[self.fecha_normal.fecha_especial()]) - + else: - self.buffer.set_text('Hoy no se celebra ninguna efemeride') + self.buffer.set_text(_('Sin efemerides')) self.efemeride = gtk.TextView(self.buffer) self.efemeride.set_editable(False) @@ -51,5 +51,5 @@ class FechaNormal(object): '''special format of a date for be use it like a dicctionary key''' self.fecha = datetime.today() - return self.fecha.strftime("%y-%b-%d") + return self.fecha.strftime("%d/%m/%y") |