Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio Rodríguez <ignaciorodriguez@sugarlabs.org>2013-05-11 00:16:14 (GMT)
committer Ignacio Rodríguez <ignaciorodriguez@sugarlabs.org>2013-05-11 00:16:14 (GMT)
commit17eec6711f5cf34642241cac96571ab8c6641c25 (patch)
treed936068f4160c9cc846dc824b39a5ec3fd874d61
parentbdbd52dee5f9cbae5846f3d75fdc6b49f9e19239 (diff)
Se actualiza el nombre de la lengueta del notebook.
Signed-off-by: Ignacio Rodríguez <ignaciorodriguez@sugarlabs.org>
-rw-r--r--InfoNotebook.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/InfoNotebook.py b/InfoNotebook.py
index c8d2647..877d228 100644
--- a/InfoNotebook.py
+++ b/InfoNotebook.py
@@ -49,7 +49,8 @@ class InfoNotebook(Gtk.Notebook):
scroll.add_with_viewport(self.introspeccion)
- self.append_page(scroll, Gtk.Label("Nombre de Archivo"))
+ self.page_label = Gtk.Label("Nombre de Archivo")
+ self.append_page(scroll, self.page_label)
scroll = Gtk.ScrolledWindow()
@@ -77,7 +78,7 @@ class InfoNotebook(Gtk.Notebook):
realizar introspeccion sobre él.
"""
- self.introspeccion.set_introspeccion(nombre, texto)
+ self.introspeccion.set_introspeccion(nombre, texto, self)
class Introspeccion(Gtk.TreeView):
"""
@@ -93,7 +94,7 @@ class Introspeccion(Gtk.TreeView):
self.__set_columnas()
self.show_all()
- def set_introspeccion(self, nombre, texto):
+ def set_introspeccion(self, nombre, texto, notebook):
"""
Recibe nombre y contenido de archivo para
realizar introspeccion sobre él.
@@ -102,6 +103,8 @@ class Introspeccion(Gtk.TreeView):
if not texto:
return
+ notebook.set_tab_label_text(notebook.get_nth_page(0), nombre)
+
analisis = re.compile(r'(^[ \t]*?class\s.*[(:])|(^[ \t]*?def\s.*[(:])|(^[\t]*?import\s.*$)|(^[ \t]*?from\s.*$)|(^\s*#---.+)', re.MULTILINE)
datos, posiciones = self.__get_datos_introspeccion(texto, analisis)
@@ -122,7 +125,6 @@ class Introspeccion(Gtk.TreeView):
Gdk.color_parse("purple")])
if dato[0:13] == "-Tabulacion- " and dato[14] != "T":
nuevodato = dato.replace("-Tabulacion- ", "")
- print dato
self.ultimodef = modelo.append(self.iteractual, [nuevodato,
posiciones[actual],
Gdk.color_parse("#FF0D00")])