Package buildbot :: Package scripts :: Module sendchange
[frames] | no frames]

Source Code for Module buildbot.scripts.sendchange

 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  import sys 
17  import traceback 
18  from twisted.internet import defer 
19  from buildbot.clients import sendchange as sendchange_client 
20  from buildbot.util import in_reactor 
21 22 @in_reactor 23 @defer.inlineCallbacks 24 -def sendchange(config):
25 encoding = config.get('encoding', 'utf8') 26 who = config.get('who') 27 auth = config.get('auth') 28 master = config.get('master') 29 branch = config.get('branch') 30 category = config.get('category') 31 revision = config.get('revision') 32 properties = config.get('properties', {}) 33 repository = config.get('repository', '') 34 vc = config.get('vc', None) 35 project = config.get('project', '') 36 revlink = config.get('revlink', '') 37 when = config.get('when') 38 comments = config.get('comments') 39 files = config.get('files', ()) 40 codebase = config.get('codebase', None) 41 42 s = sendchange_client.Sender(master, auth, encoding=encoding) 43 try: 44 yield s.send(branch, revision, comments, files, who=who, 45 category=category, when=when, properties=properties, 46 repository=repository, vc=vc, project=project, revlink=revlink, 47 codebase=codebase) 48 except: 49 print "change not sent:" 50 traceback.print_exc(file=sys.stdout) 51 defer.returnValue(1) 52 else: 53 print "change sent successfully" 54 defer.returnValue(0)
55