Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2012-04-24 03:15:12 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2012-04-24 03:15:12 (GMT)
commit3bf48373789fdcd44bef3bbffc44b1d561463a00 (patch)
treee3f59308db0baa86b4cda1aa288713bc22c05582
parent49c217933a96a9880f15094086528ac7419111ef (diff)
arreglos de estilo
-rw-r--r--CeibalNotifica.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/CeibalNotifica.py b/CeibalNotifica.py
index 57da2c4..6393c28 100644
--- a/CeibalNotifica.py
+++ b/CeibalNotifica.py
@@ -11,7 +11,7 @@ La aplicación se llevará a cabo tanto en sugar como en Gnome y
debe ser capaz de:
- Mostrar todos los mensajes activos.
- Filtrar y ordenar los mensajes por prioridad,
- fecha o tipo de mensajes.
+fecha o tipo de mensajes.
'''
import shelve
@@ -24,7 +24,9 @@ from store import *
BASE = os.path.dirname(__file__)
+
class CeibalNotifica(gtk.Window):
+
def __init__(self):
super(CeibalNotifica, self).__init__()
self.set_title("Ceibal Notifica")
@@ -57,19 +59,19 @@ class CeibalNotifica(gtk.Window):
self.notify_store = Notify_Store(self.modelsort)
self.text_buffer = gtk.TextBuffer()
- self.text_view = gtk.TextView(buffer = self.text_buffer)
+ self.text_view = gtk.TextView(buffer=self.text_buffer)
hpanel = gtk.HPaned()
- self.store = Store(db_filename = "prueba.db")
+ self.store = Store(db_filename="prueba.db")
scroll = gtk.ScrolledWindow()
scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
scroll.add_with_viewport(self.notify_store)
- hpanel.pack1(scroll, resize = False, shrink = True)
+ hpanel.pack1(scroll, resize=False, shrink=True)
scroll = gtk.ScrolledWindow()
scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
scroll.add_with_viewport(self.text_view)
- hpanel.pack2(scroll, resize = False, shrink = False)
+ hpanel.pack2(scroll, resize=False, shrink=False)
hpanel.show_all()
self.add(hpanel)
@@ -99,9 +101,11 @@ class CeibalNotifica(gtk.Window):
def delete_event(self, widget, event):
self.salir()
return False
- def salir(self, widget = None):
+
+ def salir(self, widget=None):
sys.exit(0)
+
class ListoreModel(gtk.ListStore):
def __init__(self):
gtk.ListStore.__init__(self, gobject.TYPE_STRING,
@@ -113,12 +117,15 @@ class ListoreModel(gtk.ListStore):
'''
set_fav(self, id_msg, fav=True) marcará favorito.
remove_message(self, id_msg) borra un registro en la base.'''
+
+
class Notify_Store(gtk.TreeView):
- __gsignals__ = {"show_notify":(gobject.SIGNAL_RUN_FIRST,
+ __gsignals__ = {"show_notify": (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE, (gobject.TYPE_STRING, )),
- "delete_notify":(gobject.SIGNAL_RUN_FIRST,
+ "delete_notify": (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT, ))}
- def __init__(self, model):
+
+ def __init__(self, model):
gtk.TreeView.__init__(self, model)
self.set_property("rules-hint", True)
self.add_events(gtk.gdk.BUTTON2_MASK)
@@ -158,7 +165,7 @@ class Notify_Store(gtk.TreeView):
boton = event.button
pos = (int(event.x), int(event.y))
tiempo = event.time
- path, col, x, y = widget.get_path_at_pos( pos[0], pos[1])
+ path, col, x, y = widget.get_path_at_pos(pos[0], pos[1])
if boton == 1:
return
elif boton == 3:
@@ -178,7 +185,7 @@ class Notify_Store(gtk.TreeView):
def emit_delete_notify(self, path):
self.emit("delete_notify", path)
-if __name__=="__main__":
+if __name__ == "__main__":
CeibalNotifica()
gtk.main()