From e121071e53c5ed61a785e078c15e6578bb5f866a Mon Sep 17 00:00:00 2001 From: Martin Abente Date: Mon, 28 Mar 2011 14:20:44 +0000 Subject: Report name in email body and TODO update --- diff --git a/TODO b/TODO index db2af71..71dba66 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ * Improve unique name generator. -* Improve config loader (not using global variables?) -* Improve logging usage (setting a default logs path at config?) +* Make sure the mailer can't run more than 1 instance at once. +* Extract report file at last, in case the mailer runs at the exact time + before it extracts all the logs. diff --git a/reports_mailer.py b/reports_mailer.py index 8b61840..55c443a 100755 --- a/reports_mailer.py +++ b/reports_mailer.py @@ -41,7 +41,8 @@ CUSTOM_SUBJECT = '[custom.feedback.report]' UNKNOWN_SUBJECT = '???' CUSTOM_BODY = ''' -Reported: %s +Report: %s +Received: %s Nickname: %s Serial number: %s Jabber server: %s @@ -52,7 +53,8 @@ Message: ''' AUTOMATIC_BODY = ''' -Reported: %s +Report: %s +Received: %s Component: %s Type: %s Ocurrences: %s @@ -96,11 +98,12 @@ def prepare_message(subject, body, report_path): return message -def generate_body(info, report_info_path): +def generate_body(info, report_info_path, report_name): report_time = time.ctime(os.path.getctime(report_info_path)) if 'serial_number' in info: body = CUSTOM_BODY % ( + report_name, report_time, info.get('nick', ''), info.get('serial_number', ''), @@ -112,6 +115,7 @@ def generate_body(info, report_info_path): for bugtype in info[component]: ocurrences = info[component][bugtype] body += AUTOMATIC_BODY % ( + report_name, report_time, component, bugtype, @@ -153,7 +157,7 @@ def check_reports(): logging.info('Empty report %s.' % report_info_path) continue - body = generate_body(report_info, report_info_path) + body = generate_body(report_info, report_info_path, report) subject = generate_subject(report_info) message = prepare_message(subject, body, report_path) diff --git a/sugar-fbserver.spec b/sugar-fbserver.spec index 0908da4..19a2ad7 100644 --- a/sugar-fbserver.spec +++ b/sugar-fbserver.spec @@ -1,6 +1,6 @@ Name: sugar-fbserver Version: 0.2 -Release: 5 +Release: 6 Vendor: Activity Central Summary: Sugar debugging feedback server Group: Applications/Internet @@ -59,6 +59,10 @@ chkconfig --level 345 fbserverd off %changelog +* Mon Mar 28 2011 Martin Abente. +- Add report name to mail body. +- Update TODO. + * Fri Mar 25 2011 Martin Abente. - Add custom log to mailer. -- cgit v0.9.1