From e530d54d0570ebf088cbabfa0ca01aca2a343742 Mon Sep 17 00:00:00 2001 From: Rafael Ortiz Date: Thu, 18 Aug 2011 18:36:31 +0000 Subject: pep8 fixes --- diff --git a/calendario.py b/calendario.py index cb1c6d0..eee8a12 100644 --- a/calendario.py +++ b/calendario.py @@ -26,6 +26,7 @@ import logging from sugar.activity import activity from sugar.graphics.toolbutton import ToolButton + class CalendarioActivity(activity.Activity): '''the sugar class''' @@ -55,8 +56,8 @@ class CalendarioActivity(activity.Activity): self._log = logging.getLogger('Log Calendario') self.path = self.get_activity_root() self.check_editar = False - ######################### set interface ######################## + ######################### set interface ######################## #calendar self.calendario = gtk.Calendar() self.fecha = _('Today') + self.fecha_normal.fecha_actual() @@ -76,7 +77,6 @@ class CalendarioActivity(activity.Activity): self.area_texto.set_shadow_type(gtk.SHADOW_IN) self.area_texto.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - self.lista_fecha_t = self.calendario.get_date() self.indice_dia_t = FechaUnix(self.lista_fecha_t) @@ -236,22 +236,22 @@ class CalendarioActivity(activity.Activity): self.compl.connect('toggled', self._compl_cb) ########################### Add Blocks ################################ - self.contenedor_h.pack_start(self.contenedor_vi, False, padding = 5) - self.contenedor_h.pack_start(self.contenedor_vd, padding = 5) + self.contenedor_h.pack_start(self.contenedor_vi, False, padding=5) + self.contenedor_h.pack_start(self.contenedor_vd, padding=5) #calendar - self.contenedor_vi.pack_start(self.texto_fecha, False, padding = 5) - self.contenedor_vi.pack_start(self.calendario, False, padding = 5) - self.contenedor_vi.pack_start(self.marco_expandible, padding = 5) + self.contenedor_vi.pack_start(self.texto_fecha, False, padding=5) + self.contenedor_vi.pack_start(self.calendario, False, padding=5) + self.contenedor_vi.pack_start(self.marco_expandible, padding=5) self.contenedor_vd.pack_start(self.marco_actividades) #self.contenedor_vd.pack_start(self.expandir_tareas, False) self.contenedor_vd.pack_start(self.contenedor_extendido, False) self.contenedor_extendido.pack_start(self.expandir) - self.contenedor_vd.pack_start(self.sub_contenedor_h, False, padding = 5) + self.contenedor_vd.pack_start(self.sub_contenedor_h, False, padding=5) self.sub_contenedor_h.pack_start(self.area_entrada) - self.sub_contenedor_h.pack_start(self.botones_contenedor, False, padding = 3) + self.sub_contenedor_h.pack_start(self.botones_contenedor, False, padding=3) self.botones_contenedor.pack_start(self.boton1) self.botones_contenedor.pack_start(self.boton4) self.botones_contenedor.pack_start(self.boton2) @@ -429,19 +429,19 @@ class CalendarioActivity(activity.Activity): self.prioridad = (_('Priority')) self.estado = (_('Status')) #for activities - self.columna = gtk.TreeViewColumn('', self.celda, text = 0, cell_background = 5) + self.columna = gtk.TreeViewColumn('', self.celda, text=0, cell_background=5) self.actividades.append_column(self.columna) - self.columna = gtk.TreeViewColumn(self.actividad, self.celda, text = 1, cell_background = 5) + self.columna = gtk.TreeViewColumn(self.actividad, self.celda, text=1, cell_background=5) self.columna.set_min_width(365) self.actividades.append_column(self.columna) - self.columna = gtk.TreeViewColumn(self.categoria, self.celda, text = 2, cell_background = 5) + self.columna = gtk.TreeViewColumn(self.categoria, self.celda, text=2, cell_background=5) self.actividades.append_column(self.columna) - self.columna = gtk.TreeViewColumn(self.prioridad, self.icono, stock_id = 3, cell_background = 5) + self.columna = gtk.TreeViewColumn(self.prioridad, self.icono, stock_id=3, cell_background=5) self.actividades.append_column(self.columna) - self.columna = gtk.TreeViewColumn(self.estado, self.icono, stock_id = 4, cell_background = 5) + self.columna = gtk.TreeViewColumn(self.estado, self.icono, stock_id=4, cell_background=5) self.actividades.append_column(self.columna) #for pending task - self.columna = gtk.TreeViewColumn(self.actividad, self.celda, text = 0, cell_background = 1) + self.columna = gtk.TreeViewColumn(self.actividad, self.celda, text=0, cell_background=1) self.pendientes.append_column(self.columna) def guardar(self): @@ -452,9 +452,9 @@ class CalendarioActivity(activity.Activity): #if the buffer is not empty or does not have space if self.cadena is not ' ' and self.cadena is not '' and self.cadena is not ' ': self.lista_fecha = self.calendario.get_date() - self.indice_dia = FechaUnix(self.lista_fecha) #id for save the date + self.indice_dia = FechaUnix(self.lista_fecha) # id for save the date self.indice = self.indice_dia.fecha_unix() - self.marcar_dia = self.indice_dia.indice_unix(self.indice)#id for mark the day + self.marcar_dia = self.indice_dia.indice_unix(self.indice) # id for mark the day self.modelocombo = self.combo.get_model() self.index = self.combo.get_active() self.categoria = self.modelocombo[self.index][0] diff --git a/fecha.py b/fecha.py index abb3878..ea55808 100644 --- a/fecha.py +++ b/fecha.py @@ -19,6 +19,7 @@ from time import localtime, strftime, mktime from datetime import datetime, date from gettext import gettext as _ + class FechaUnix(object): '''for get, convert and return dates based on the unix date''' @@ -38,7 +39,8 @@ class FechaUnix(object): self.fecha_unix = fecha_unix self.fecha_unix = int(self.fecha_unix) return strftime("%y%m%d", localtime(self.fecha_unix)) - + + class FechaNormal(object): '''Get, convert and return dates in our popular format''' def __init__(self): -- cgit v0.9.1