提交 676881f2 编写于 作者: J Joerg Jaspert

Merge commit 'lamby/master' into merge

* commit 'lamby/master':
  Refactor Upload.package_info.
  Prefer interpolation over concatenation here.
  Add more spacing for reject messages/notes etc.
Signed-off-by: NJoerg Jaspert <joerg@debian.org>
...@@ -287,19 +287,20 @@ class Upload(object): ...@@ -287,19 +287,20 @@ class Upload(object):
self.pkg.reset() self.pkg.reset()
def package_info(self): def package_info(self):
msg = '' """
Format various messages from this Upload to send to the maintainer.
if len(self.rejects) > 0: """
msg += "Reject Reasons:\n"
msg += "\n".join(self.rejects)
if len(self.warnings) > 0: msgs = (
msg += "Warnings:\n" ('Reject Reasons', self.rejects),
msg += "\n".join(self.warnings) ('Warnings', self.warnings),
('Notes', self.notes),
)
if len(self.notes) > 0: msg = ''
msg += "Notes:\n" for title, messages in reasons:
msg += "\n".join(self.notes) if messages:
msg += '\n\n%s:\n%s' % (title, '\n'.join(messages))
return msg return msg
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册