aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/autobuilder/YoctoMailer.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/autobuilder/YoctoMailer.py')
-rw-r--r--lib/python2.7/site-packages/autobuilder/YoctoMailer.py109
1 files changed, 0 insertions, 109 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/YoctoMailer.py b/lib/python2.7/site-packages/autobuilder/YoctoMailer.py
deleted file mode 100644
index 1e435a0b..00000000
--- a/lib/python2.7/site-packages/autobuilder/YoctoMailer.py
+++ /dev/null
@@ -1,109 +0,0 @@
-'''
-Created on June 28, 2013
-
-__author__ = "Elizabeth 'pidge' Flanagan"
-__copyright__ = "Copyright 2012-2013, Intel Corp."
-__credits__ = ["Elizabeth Flanagan"]
-__license__ = "GPL"
-__version__ = "2.0"
-__maintainer__ = "Elizabeth Flanagan"
-__email__ = "pidge@toganlabs.com"
-'''
-from buildbot.status.mail import MailNotifier
-from buildbot.status.mail import *
-from buildbot import interfaces, util, config
-from buildbot.process.users import users
-from buildbot.status import base
-from buildbot.status.results import FAILURE, SUCCESS, WARNINGS, EXCEPTION, Results
-from twisted.python import log
-
-class YoctoMailNotifier(MailNotifier):
- def __init__(self, fromaddr, mode=("failing"),
- categories=None, branches=None, yoctorepos=None, builders=None, addLogs=False,
- relayhost="localhost", buildSetSummary=False,
- subject="buildbot %(result)s in %(title)s on %(builder)s",
- lookup=None, extraRecipients=[],
- sendToInterestedUsers=True, customMesg=None,
- messageFormatter=defaultMessage, extraHeaders=None,
- addPatch=True, useTls=False,
- smtpUser=None, smtpPassword=None, smtpPort=25):
- self.fromaddr = fromaddr
- self.mode=mode
- self.categories = categories
- self.branches = branches
- self.yoctorepos = yoctorepos
- self.builders = builders
- self.addLogs = addLogs
- self.relayhost = relayhost
- self.buildSetSummary = buildSetSummary
- self.subject = subject
- self.lookup = lookup
- self.extraRecipients = extraRecipients
- self.sendToInterestedUsers = sendToInterestedUsers
- self.customMesg = customMesg
- self.messageFormatter = messageFormatter
- self.extraHeaders = extraHeaders
- self.addPatch = addPatch
- self.useTls = useTls
- self.smtpUser = smtpUser
- self.smtpPassword = smtpPassword
- self.smtpPort = smtpPort
- MailNotifier.__init__(self, fromaddr, mode=self.mode,
- categories = self.categories, builders = self.builders,
- addLogs = self.addLogs, relayhost = self.relayhost,
- buildSetSummary = self.buildSetSummary,
- subject = self.subject,
- lookup = self.lookup,
- extraRecipients = self.extraRecipients,
- sendToInterestedUsers = self.sendToInterestedUsers,
- customMesg = self.customMesg,
- messageFormatter = self.messageFormatter,
- extraHeaders = self.extraHeaders, addPatch = self.addPatch,
- useTls = self.useTls, smtpUser = self.smtpUser,
- smtpPassword = self.smtpPassword, smtpPort = self.smtpPort)
-
- def isMailNeeded(self, build, results):
- # here is where we actually do something.
- builder = build.getBuilder()
- repo=build.getProperty("repository")
- branch=build.getProperty("branch")
- log.msg(repo)
- log.msg(branch)
- buildme = False
- if self.builders is not None and builder.name not in self.builders:
- return False # ignore this build
- if self.categories is not None and \
- builder.category not in self.categories:
- return False # ignore this build
-
- if self.yoctorepos is not None and repo in self.yoctorepos:
- if self.branches is not None:
- if branch in self.branches:
- buildme = True
- else:
- return False # ignore this build
- elif self.yoctorepos is None:
- if self.branches is not None and branch in self.branches:
- buildme = True
- elif self.branches is not None and branch not in self.branches:
- return False # ignore this build
- else:
- buildme = True
-
- if buildme is True:
- prev = build.getPreviousBuild()
- if "change" in self.mode:
- if prev and prev.getResults() != results:
- return True
- if "failing" in self.mode and results == FAILURE:
- return True
- if "passing" in self.mode and results == SUCCESS:
- return True
- if "problem" in self.mode and results == FAILURE:
- if prev and prev.getResults() != FAILURE:
- return True
- if "warnings" in self.mode and results == WARNINGS:
- return True
- if "exception" in self.mode and results == EXCEPTION:
- return True
- return False