diff options
author | Olav Vitters <ovitters@mageia.org> | 2012-03-11 13:15:23 +0000 |
---|---|---|
committer | Olav Vitters <ovitters@mageia.org> | 2012-03-11 13:15:23 +0000 |
commit | 7e545849b96b40a6854433d6ad69af0b75df269a (patch) | |
tree | 84819e79a04afbbd3a5de31f831df38a30ce67fb /mgagnome | |
parent | 291c0c098e13211b62fc210453cbcf156ed4e1e8 (diff) | |
download | mgagnome-7e545849b96b40a6854433d6ad69af0b75df269a.tar mgagnome-7e545849b96b40a6854433d6ad69af0b75df269a.tar.gz mgagnome-7e545849b96b40a6854433d6ad69af0b75df269a.tar.bz2 mgagnome-7e545849b96b40a6854433d6ad69af0b75df269a.tar.xz mgagnome-7e545849b96b40a6854433d6ad69af0b75df269a.zip |
put better error message in subject line
Diffstat (limited to 'mgagnome')
-rwxr-xr-x | mgagnome | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -628,7 +628,16 @@ def cmd_parse_ftp_release_list(options, parser): """Send an reply email""" contents.seek(0) msg = MIMEText(contents.read(), _charset='utf-8') - msg['Subject'] = "Re: %s%s" % (orig_msg['Subject'], " (ERROR)" if error else "") + if error: + # XXX - ugly + contents.seek(0) + lastline = contents.read().splitlines()[-1] + # Remove things like "ERROR: " and so on from the last line + lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline) + subjecterrror = " (ERROR: %s)" % lastline if lastline else " (ERROR)" + else: + subjecterror = "" + msg['Subject'] = "Re: %s%s" (orig_msg['Subject'], subjecterror) msg['To'] = to msg["In-Reply-To"] = orig_msg["Message-ID"] msg["References"] = orig_msg["Message-ID"] |