+def relToAbsPath(absfile, relfile):
+ """When an absfile is given and a relfile is given by
+ relative paths relative to absfile, determine the abs
+ path of relfile"""
+
+ #Get directories except for "." parts
+ relsplit = filter(lambda x: x!=".", string.split(relfile, os.sep))
+ #Get the directories of absfile withouth the trailing filename
+ abssplit = string.split(absfile, os.sep)[:-1]
+
+ #Determine number of ".." and remove them
+ up=0
+ while relsplit[0] == "..":
+ up += 1
+ del relsplit[0]
+ del abssplit[-1]
+
+ return string.join(abssplit + relsplit, os.sep)
+
+
+class DbgWindow (gtk.Window):
+
+ clientIOWnd = None
+
+
+ def __init__(self, terminal):
+
+ #Set up some members
+ self.terminal = terminal
+
+ #Set up GTK stuff
+ gtk.Window.__init__(self)
+ self.connect("destroy", quitHandler)
+
+ #Set title and add terminal
+ self.set_title("Debugger I/O")
+ self.terminal.history = []
+ self.terminal.history_length = 5
+ self.add(self.terminal)
+
+ #Show the window
+ self.show_all()
+
+ def toggleClientIOWindow(self):
+ if not self.clientIOWnd:
+ self.clientIOWnd = ClientIOTerminal.ClientIOWindow(self, \
+ self.terminal.client_ptymaster)
+ else:
+ self.clientIOWnd.destroy()
+ self.clientIOWnd = None
+
+ def isClientIOWindowExisting(self):
+ return self.clientIOWnd != None
+