diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | calendario.py | 14 | ||||
-rw-r--r-- | fecha.py | 32 |
3 files changed, 41 insertions, 6 deletions
@@ -1 +1,2 @@ *.pyc +*~ diff --git a/calendario.py b/calendario.py index 16dc6fd..c044592 100644 --- a/calendario.py +++ b/calendario.py @@ -17,7 +17,7 @@ #along with this program. If not, see <http://www.gnu.org/licenses/>. from gettext import gettext as _ -from datetime import datetime +from fecha import Fecha import gtk import gobject @@ -30,11 +30,12 @@ class Calendario: self.ventana.set_title(_('Calendario')) self.ventana.connect('destroy', self._cerrar_cb) - #interface + ######################### set interface ######################## #calendar widget self.calendario = gtk.Calendar() - self.fecha = 'Hoy es: ' + str(datetime.today()) + self.fecha = Fecha() + self.fecha = _('Hoy es ') + self.fecha.convertir() self.texto_fecha = gtk.Label(self.fecha) #area of daily activities @@ -76,6 +77,7 @@ class Calendario: self.contenedor_vd = gtk.VBox() self.contenedor_vi = gtk.VBox() self.sub_contenedor_h = gtk.HBox() + self.botones_contenedor = gtk.VBox() self.ventana.add(self.contenedor_h) ########################### Add Blocks ################################ @@ -91,9 +93,9 @@ class Calendario: self.contenedor_vd.pack_start(self.sub_contenedor_h, False, padding = 15) self.sub_contenedor_h.pack_start(self.area_entrada) - self.sub_contenedor_h.pack_start(self.boton1, False) - self.sub_contenedor_h.pack_start(self.boton2, False) - + self.sub_contenedor_h.pack_start(self.botones_contenedor, False) + self.botones_contenedor.pack_start(self.boton1) + self.botones_contenedor.pack_start(self.boton2) self.contenedor_h.show_all() diff --git a/fecha.py b/fecha.py new file mode 100644 index 0000000..ee9ebe7 --- /dev/null +++ b/fecha.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# +#Copyright (C) 2010, Yader Velasquez +#Copyright (C) 2010, Marcelo Gutierrez +# +#This program is free software: you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation, either version 3 of the License, or +#(at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program. If not, see <http://www.gnu.org/licenses/>. + +from datetime import date + +class Fecha(object): + '''a simple class for get and convert date''' + + def __init__(self): + '''init class''' + self.fecha = date.today() + + def convertir(self): + '''class for convert date''' + return self.fecha.strftime("%d de %B de %Y") + + |