Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Garcia <cristian99garcia@gmail.com>2013-05-24 19:13:23 (GMT)
committer Cristian Garcia <cristian99garcia@gmail.com>2013-05-24 19:13:23 (GMT)
commitd6cd8706103624da13734e54d1874c93d8847a1f (patch)
tree529cd68c581f2d8ac90c9bbd91ef2bdc9e4e7274
parentea46e64ee9a843eee7bc1e785ce826bf6921d763 (diff)
Agregando la terminal y la clase 'DebugNotebook'
-rw-r--r--WorkPanel.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/WorkPanel.py b/WorkPanel.py
index 77e7474..516db70 100644
--- a/WorkPanel.py
+++ b/WorkPanel.py
@@ -27,6 +27,8 @@ import gi
from gi.repository import Gtk
from gi.repository import GObject
from gi.repository import GtkSource
+from gi.repository import Vte
+from gi.repository import GLib
class WorkPanel(Gtk.Paned):
"""
@@ -48,6 +50,7 @@ class WorkPanel(Gtk.Paned):
self.notebook_sourceview = Notebook_SourceView()
self.pack1(self.notebook_sourceview, resize = False, shrink = False)
+ self.pack2(DebugNotebook())
self.show_all()
@@ -421,3 +424,50 @@ class AutoCompletado(GObject.Object, GtkSource.CompletionProvider):
modulo = modulo.rpartition("-")
modulos_nuevos.append(modulo[0])
return modulos_nuevos
+
+
+class Terminal(Vte.Terminal):
+
+ def __init__(self):
+
+ Vte.Terminal.__init__(self)
+
+ self.fork_command_full(Vte.PtyFlags(0),
+ os.environ["HOME"],
+ ('/bin/bash',),
+ [],
+ GLib.SpawnFlags(0),
+ self.abriendo,
+ 'algo')
+
+ self.connect('child-exited', self.reabrir)
+
+ def abriendo(self, widget):
+ """
+ Cuando reciƩn abre la terminal.
+ """
+
+ print '\n'
+
+ def reabrir(self, widget):
+ """
+ Reinicia la Terminal para que se pueda seguir usando.
+ """
+
+ self.fork_command_full(Vte.PtyFlags(0),
+ os.environ["HOME"],
+ ('/bin/bash',),
+ [],
+ GLib.SpawnFlags(0),
+ self.abriendo,
+ 'algo')
+
+class DebugNotebook(Gtk.Notebook):
+
+ def __init__(self):
+
+ Gtk.Notebook.__init__(self)
+
+ scrolled = Gtk.ScrolledWindow()
+ scrolled.add(Terminal())
+ self.append_page(scrolled, Gtk.Label('Terminal'))