"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildbot/reporters/message.py" between
buildbot-3.0.2.tar.gz and buildbot-3.1.0.tar.gz

About: Buildbot is a continuous integration testing framework (Python-based). It supports also automation of complex build systems, application deployment, and management of sophisticated software-release processes.

message.py  (buildbot-3.0.2):message.py  (buildbot-3.1.0)
skipping to change at line 106 skipping to change at line 106
for ss in source_stamps: for ss in source_stamps:
if ss['project']: if ss['project']:
projects.add(ss['project']) projects.add(ss['project'])
if not projects: if not projects:
projects = [master.config.title] projects = [master.config.title]
return ', '.join(list(projects)) return ', '.join(list(projects))
def create_context_for_build(mode, buildername, build, master, blamelist): def create_context_for_build(mode, build, master, blamelist):
buildset = build['buildset'] buildset = build['buildset']
ss_list = buildset['sourcestamps'] ss_list = buildset['sourcestamps']
results = build['results'] results = build['results']
if 'prev_build' in build and build['prev_build'] is not None: if 'prev_build' in build and build['prev_build'] is not None:
previous_results = build['prev_build']['results'] previous_results = build['prev_build']['results']
else: else:
previous_results = None previous_results = None
return { return {
'results': build['results'], 'results': build['results'],
'mode': mode, 'mode': mode,
'buildername': buildername, 'buildername': build['builder']['name'],
'workername': build['properties'].get('workername', ["<unknown>"])[0], 'workername': build['properties'].get('workername', ["<unknown>"])[0],
'buildset': buildset, 'buildset': buildset,
'build': build, 'build': build,
'projects': get_projects_text(ss_list, master), 'projects': get_projects_text(ss_list, master),
'previous_results': previous_results, 'previous_results': previous_results,
'status_detected': get_detected_status_text(mode, results, previous_resu lts), 'status_detected': get_detected_status_text(mode, results, previous_resu lts),
'build_url': utils.getURLForBuild(master, build['builder']['builderid'], build['number']), 'build_url': utils.getURLForBuild(master, build['builder']['builderid'], build['number']),
'buildbot_url': master.config.buildbotURL, 'buildbot_url': master.config.buildbotURL,
'blamelist': blamelist, 'blamelist': blamelist,
'summary': get_message_summary_text(build, results), 'summary': get_message_summary_text(build, results),
skipping to change at line 201 skipping to change at line 201
'type': self.template_type, 'type': self.template_type,
'subject': (yield self.render_message_subject(context)) 'subject': (yield self.render_message_subject(context))
} }
def render_message_body(self, context): def render_message_body(self, context):
return None return None
def render_message_subject(self, context): def render_message_subject(self, context):
return None return None
def format_message_for_build(self, master, build, **kwargs):
# Known kwargs keys: mode, users
raise NotImplementedError
class MessageFormatterEmpty(MessageFormatterBase): class MessageFormatterEmpty(MessageFormatterBase):
def format_message_for_build(self, mode, buildername, build, master, blameli st): def format_message_for_build(self, master, build, **kwargs):
return { return {
'body': None, 'body': None,
'type': 'plain', 'type': 'plain',
'subject': None 'subject': None
} }
class MessageFormatterFunction(MessageFormatterBase): class MessageFormatterFunction(MessageFormatterBase):
def __init__(self, function, template_type, **kwargs): def __init__(self, function, template_type, **kwargs):
super().__init__(**kwargs) super().__init__(**kwargs)
self.template_type = template_type self.template_type = template_type
self._function = function self._function = function
@defer.inlineCallbacks @defer.inlineCallbacks
def format_message_for_build(self, mode, buildername, build, master, blameli st): def format_message_for_build(self, master, build, **kwargs):
msgdict = yield self.render_message_dict(master, {'build': build}) msgdict = yield self.render_message_dict(master, {'build': build})
return msgdict return msgdict
def render_message_body(self, context): def render_message_body(self, context):
return self._function(context) return self._function(context)
def render_message_subject(self, context): def render_message_subject(self, context):
return None return None
class MessageFormatterRenderable(MessageFormatterBase): class MessageFormatterRenderable(MessageFormatterBase):
template_type = 'plain' template_type = 'plain'
def __init__(self, template, subject=None): def __init__(self, template, subject=None):
super().__init__() super().__init__()
self.template = template self.template = template
self.subject = subject self.subject = subject
@defer.inlineCallbacks @defer.inlineCallbacks
def format_message_for_build(self, mode, buildername, build, master, blameli st): def format_message_for_build(self, master, build, **kwargs):
msgdict = yield self.render_message_dict(master, {'build': build, 'maste r': master}) msgdict = yield self.render_message_dict(master, {'build': build, 'maste r': master})
return msgdict return msgdict
@defer.inlineCallbacks @defer.inlineCallbacks
def render_message_body(self, context): def render_message_body(self, context):
props = Properties.fromDict(context['build']['properties']) props = Properties.fromDict(context['build']['properties'])
props.master = context['master'] props.master = context['master']
body = yield props.render(self.template) body = yield props.render(self.template)
return body return body
skipping to change at line 307 skipping to change at line 311
def render_message_body(self, context): def render_message_body(self, context):
return self.body_template.render(context) return self.body_template.render(context)
def render_message_subject(self, context): def render_message_subject(self, context):
if self.subject_template is None: if self.subject_template is None:
return None return None
return self.subject_template.render(context) return self.subject_template.render(context)
class MessageFormatter(MessageFormatterBaseJinja): class MessageFormatter(MessageFormatterBaseJinja):
@defer.inlineCallbacks @defer.inlineCallbacks
def format_message_for_build(self, mode, buildername, build, master, blameli def format_message_for_build(self, master, build, users=None, mode=None):
st): ctx = create_context_for_build(mode, build, master, users)
ctx = create_context_for_build(mode, buildername, build, master, blameli
st)
msgdict = yield self.render_message_dict(master, ctx) msgdict = yield self.render_message_dict(master, ctx)
return msgdict return msgdict
default_missing_template = '''\ default_missing_template = '''\
The Buildbot working for '{{buildbot_title}}' has noticed that the worker named {{worker.name}} went away. The Buildbot working for '{{buildbot_title}}' has noticed that the worker named {{worker.name}} went away.
It last disconnected at {{worker.last_connection}}. It last disconnected at {{worker.last_connection}}.
{% if 'admin' in worker['workerinfo'] %} {% if 'admin' in worker['workerinfo'] %}
The admin on record (as reported by WORKER:info/admin) was {{worker.workerinfo.a dmin}}. The admin on record (as reported by WORKER:info/admin) was {{worker.workerinfo.a dmin}}.
 End of changes. 7 change blocks. 
9 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)