Package buildbot :: Package process :: Module debug
[frames] | no frames]

Source Code for Module buildbot.process.debug

 1  # This file is part of Buildbot.  Buildbot is free software: you can 
 2  # redistribute it and/or modify it under the terms of the GNU General Public 
 3  # License as published by the Free Software Foundation, version 2. 
 4  # 
 5  # This program is distributed in the hope that it will be useful, but WITHOUT 
 6  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
 8  # details. 
 9  # 
10  # You should have received a copy of the GNU General Public License along with 
11  # this program; if not, write to the Free Software Foundation, Inc., 51 
12  # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
13  # 
14  # Copyright Buildbot Team Members 
15   
16  from twisted.python import log 
17  from buildbot.pbutil import NewCredPerspective 
18  from buildbot import interfaces 
19  from buildbot.process.properties import Properties 
20   
21 -class DebugPerspective(NewCredPerspective):
22 - def attached(self, mind):
23 return self
24 - def detached(self, mind):
25 pass
26
27 - def perspective_requestBuild(self, buildername, reason, branch, revision, properties={}):
28 from buildbot.sourcestamp import SourceStamp 29 c = interfaces.IControl(self.master) 30 bc = c.getBuilder(buildername) 31 ss = SourceStamp(branch, revision) 32 bpr = Properties() 33 bpr.update(properties, "remote requestBuild") 34 return bc.submitBuildRequest(ss, reason, bpr)
35
36 - def perspective_pingBuilder(self, buildername):
37 c = interfaces.IControl(self.master) 38 bc = c.getBuilder(buildername) 39 bc.ping()
40
41 - def perspective_reload(self):
42 log.msg("doing reload of the config file") 43 self.master.loadTheConfigFile()
44
45 - def perspective_pokeIRC(self):
46 log.msg("saying something on IRC") 47 from buildbot.status import words 48 for s in self.master: 49 if isinstance(s, words.IRC): 50 bot = s.f 51 for channel in bot.channels: 52 print " channel", channel 53 bot.p.msg(channel, "Ow, quit it")
54
55 - def perspective_print(self, msg):
56 log.msg("debug %s" % msg)
57
58 -def registerDebugClient(master, slavePortnum, debugPassword, pbmanager):
59 def perspFactory(master, mind, username): 60 persp = DebugPerspective() 61 persp.master = master 62 persp.botmaster = master 63 return persp
64 return pbmanager.register( 65 slavePortnum, "debug", debugPassword, 66 lambda mind, username : perspFactory(master, mind, username)) 67