-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathechowrap.py
More file actions
40 lines (35 loc) · 1.19 KB
/
echowrap.py
File metadata and controls
40 lines (35 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from buildbot.process import buildstep
from buildbot.process import remotecommand
from buildbot.status.results import FAILURE
from buildbot.status.results import SUCCESS
import sourcecache
reload(sourcecache)
from sourcecache import SourceCachePackage
class EchoWrap(buildstep.BuildStep):
name = 'Echo Wrap'
pkgName = "com.example.test"
renderables = ['msg']
haltOnFailure = True
flunkOnFailure = True
def __init__(self, msg, **k):
buildstep.BuildStep.__init__(self,**k)
self.msg = msg
def start(self):
pkg = SourceCachePackage(self.pkgName)
#self.step_status.setText(str(dir(pkg)))
#self.finished(SUCCESS)
#return
cmd = remotecommand.RemoteCommand('wrapCache',{
'msg':self.msg,
'_package':pkg})
d = self.runCommand(cmd)
d.addCallback(lambda res: self.commandComplete(cmd))
d.addErrback(self.failed)
def commandComplete(self, cmd):
if cmd.didFail():
self.descriptionDone = ["ECHO Failed (?)"]
self.finished(FAILURE)
return
s = cmd.updates["pong"]
self.step_status.setText(str(s))
self.finished(SUCCESS)