]> git.sthu.org Git - pygdb.git/commitdiff
adding a callable facade pygdb
authorStefan Huber <shuber2@gmail.com>
Sun, 8 Jun 2008 17:32:23 +0000 (19:32 +0200)
committerStefan Huber <shuber2@gmail.com>
Sun, 8 Jun 2008 17:32:23 +0000 (19:32 +0200)
MainControlWindow.py [changed mode: 0755->0644]
pygdb.py [new file with mode: 0755]

old mode 100755 (executable)
new mode 100644 (file)
index 42f8285..0a24f4c
@@ -120,21 +120,3 @@ class MainControlWindow (gtk.Window):
                        cb(pos)
 
 
                        cb(pos)
 
 
-
-
-if __name__ == "__main__":
-
-
-       import StatusWindow
-
-
-       clientCmd = string.join(sys.argv[1:])
-       dbgterm = GdbTerminal.GdbTerminal(clientCmd)
-       mainCtrlWnd = MainControlWindow(dbgterm)
-
-       statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm)
-       mainCtrlWnd.newPosCbs += [statusWnd.updateValues]
-
-       gtk.main()
-
-
diff --git a/pygdb.py b/pygdb.py
new file mode 100755 (executable)
index 0000000..e6c1dbc
--- /dev/null
+++ b/pygdb.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+#shuber, 2008-06-08
+
+__author__ = "shuber"
+
+import gtk
+import string
+import sys
+
+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)
+
+       #Create the terminals
+       clientCmd = string.join(sys.argv[1:])
+       dbgterm = GdbTerminal.GdbTerminal(clientCmd)
+
+       #Create windows
+       mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm)
+       statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm)
+
+       #Register callback function for new positions
+       mainCtrlWnd.newPosCbs += [statusWnd.updateValues]
+
+       gtk.main()
+
+
+