Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: third_party/buildbot_7_12/buildbot/clients/sendchange.py

Issue 12207158: Bye bye buildbot 0.7.12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2 from twisted.spread import pb
3 from twisted.cred import credentials
4 from twisted.internet import reactor
5
6 class Sender:
7 def __init__(self, master, user=None):
8 self.user = user
9 self.host, self.port = master.split(":")
10 self.port = int(self.port)
11 self.num_changes = 0
12
13 def send(self, branch, revision, comments, files, user=None, category=None,
14 when=None, properties={}):
15 if user is None:
16 user = self.user
17 change = {'who': user, 'files': files, 'comments': comments,
18 'branch': branch, 'revision': revision, 'category': category,
19 'when': when, 'properties': properties}
20 self.num_changes += 1
21
22 f = pb.PBClientFactory()
23 d = f.login(credentials.UsernamePassword("change", "changepw"))
24 reactor.connectTCP(self.host, self.port, f)
25 d.addCallback(self.addChange, change)
26 return d
27
28 def addChange(self, remote, change):
29 d = remote.callRemote('addChange', change)
30 d.addCallback(lambda res: remote.broker.transport.loseConnection())
31 return d
32
33 def printSuccess(self, res):
34 if self.num_changes > 1:
35 print "%d changes sent successfully" % self.num_changes
36 elif self.num_changes == 1:
37 print "change sent successfully"
38 else:
39 print "no changes to send"
40
41 def printFailure(self, why):
42 print "change(s) NOT sent, something went wrong:"
43 print why
44
45 def stop(self, res):
46 reactor.stop()
47 return res
48
49 def run(self):
50 reactor.run()
OLDNEW
« no previous file with comments | « third_party/buildbot_7_12/buildbot/clients/gtkPanes.py ('k') | third_party/buildbot_7_12/buildbot/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698