From 47f26d90e01454c105e1b74188c0f746e5941037 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 22 Jun 2011 01:28:38 -0400 Subject: Another ciabot update. --- repo/hooks/ciabot.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'repo') diff --git a/repo/hooks/ciabot.py b/repo/hooks/ciabot.py index 72f13ca5..8ac06fb1 100755 --- a/repo/hooks/ciabot.py +++ b/repo/hooks/ciabot.py @@ -32,7 +32,7 @@ # ciabot.xmlrpc = if true, ship notifications via XML-RPC # ciabot.revformat = format in which the revision is shown # -# The ciabot.repo defaults to ciabot.project lowercased. +# The ciabot.repo value defaults to ciabot.project lowercased. # # The revformat variable may have the following values # raw -> full hex ID of commit @@ -110,7 +110,7 @@ version = "3.5" def do(command): return commands.getstatusoutput(command)[1] -def report(refname, merged): +def report(refname, merged, xmlrpc=False): "Generate a commit notification to be reported to CIA" # Try to tinyfy a reference to a web view for this commit. @@ -151,8 +151,7 @@ def report(refname, merged): context.update(globals()) out = xml % context - - message = '''\ + mail = '''\ Message-ID: <%(merged)s.%(author)s@%(project)s> From: %(fromaddr)s To: %(toaddr)s @@ -161,7 +160,10 @@ Subject: DeliverXML %(out)s''' % locals() - return message + if xmlrpc: + return out + else: + return mail if __name__ == "__main__": import getopt @@ -222,7 +224,7 @@ if __name__ == "__main__": server = smtplib.SMTP('localhost') for merged in merges: - message = report(refname, merged) + message = report(refname, merged, xmlrpc) if not notify: print message elif xmlrpc: -- cgit v1.2.1