[Buildbot-commits] buildbot/buildbot/scripts runner.py,1.8,1.9

Brian Warner warner at users.sourceforge.net
Fri Apr 22 02:57:23 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4617/buildbot/scripts

Modified Files:
	runner.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-61
Creator:  Brian Warner <warner at monolith.lothar.com>

move debugclient and status client into 'buildbot' command

* buildbot/scripts/runner.py (Options.debugclient, Options.statusgui):
add sub-commands to launch the debug client (formerly in
contrib/debugclient.py) and the Gtk status application (currently broken)
* buildbot/clients/debug.py: move from contrib/debugclient.py
* buildbot/clients/debug.glade: same


Index: runner.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- runner.py	21 Apr 2005 20:56:22 -0000	1.8
+++ runner.py	22 Apr 2005 02:57:21 -0000	1.9
@@ -1,5 +1,7 @@
 #! /usr/bin/python
 
+# N.B.: don't import anything that might pull in a reactor yet. Some of our
+# subcommands want to load modules that need the gtk reactor.
 import os, os.path, sys, shutil
 from twisted.python import usage, util
 
@@ -167,6 +169,51 @@
     def getSynopsis(self):
         return "Usage:    buildbot stop <basedir>"
 
+class DebugClientOptions(usage.Options):
+    optFlags = [
+        ['help', 'h', "Display this message"],
+        ]
+    optParameters = [
+        ["master", "m", "localhost:8007",
+         "Location of the buildmaster's slaveport (host:port)"],
+        ["passwd", "p", "debugpw", "Debug password to use"],
+        ]
+
+    def parseArgs(self, *args):
+        if len(args) > 0:
+            self['master'] = args[0]
+        if len(args) > 1:
+            self['passwd'] = args[1]
+        if len(args) > 2:
+            raise usage.UsageError("I wasn't expecting so many arguments")
+
+def debugclient(config):
+    from buildbot.clients import debug
+    print "config is", config
+    d = debug.DebugWidget(config['master'], config['passwd'])
+    d.run()
+
+class StatusGuiClientOptions(usage.Options):
+    optFlags = [
+        ['help', 'h', "Display this message"],
+        ]
+    optParameters = [
+        ["master", "m", "localhost:8007",
+         "Location of the buildmaster's status port (host:port)"],
+        ]
+
+    def parseArgs(self, *args):
+        if len(args) > 0:
+            self['master'] = args[0]
+        if len(args) > 1:
+            raise usage.UsageError("I wasn't expecting so many arguments")
+
+def statusgui(config):
+    from buildbot.clients import gtkPanes
+    c = gtkPanes.CompactGtkClient()
+    c.startConnecting(config['master'])
+    reactor.run()
+
 class Options(usage.Options):
     synopsis = "Usage:    buildbot <command> [command options]"
 
@@ -181,6 +228,12 @@
         ['sighup', None, StopOptions,
          "SIGHUP a buildmaster to make it re-read the config file"],
 
+        ['debugclient', None, DebugClientOptions,
+         "Launch a small debug panel GUI"],
+
+        ['status_gui', None, StatusGuiClientOptions,
+         "Display a small window showing current builder status"],
+
         # TODO: 'try', 'watch'
         ]
 
@@ -213,3 +266,7 @@
         stop(so)
     elif command == "sighup":
         stop(so, "-HUP")
+    elif command == "debugclient":
+        debugclient(so)
+    elif command == "status_gui":
+        statusgui(so)





More information about the Commits mailing list