some code beautifying: __waitForPrompt
[pygdb.git] / pygdb.py
index e6c1dbccb64a0d29ada143869b91c4917fcce1aa..6b6f5d3d2953a45b2ec603e2d4eef31ffc850b9d 100755 (executable)
--- a/pygdb.py
+++ b/pygdb.py
@@ -4,33 +4,49 @@
 __author__ = "shuber"
 
 import gtk
+import os
 import string
 import sys
 
+import Configuration
 import GdbTerminal
 import MainControlWindow
 import StatusWindow
 
 
-if __name__ == "__main__":
-
-       #Check if enough arguments are given
-       if len(sys.argv) <= 1:
-               print "Please give executeable to debug."
-               sys.exit(-1)
+def launchDebugger(clientCmd):
 
-       #Create the terminals
-       clientCmd = string.join(sys.argv[1:])
+       #Create Terminal
        dbgterm = GdbTerminal.GdbTerminal(clientCmd)
 
        #Create windows
        mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm)
        statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm)
+       dbgterm.initialize()
 
-       #Register callback function for new positions
-       mainCtrlWnd.newPosCbs += [statusWnd.updateValues]
-
+       #Load configuration
+       conf = Configuration.Configuration()
+       conf.load(".pygdb.conf")
+       statusWnd.applyConfiguration(conf)
+       
        gtk.main()
 
+       #Store config
+       conf = Configuration.Configuration()
+       statusWnd.fillConfiguration(conf)
+       conf.store(".pygdb.conf")
+
+
+
+if __name__ == "__main__":
+
+       #Check if enough arguments are given
+       if len(sys.argv) <= 1:
+               print "Please give executeable to debug."
+               sys.exit(-1)
+
+       #Create the terminals
+       clientCmd = string.join(sys.argv[1:])
+       launchDebugger(clientCmd)