Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Abente <martin.abente.lahaye@gmail.com>2011-03-28 14:20:44 (GMT)
committer Martin Abente <martin.abente.lahaye@gmail.com>2011-03-28 14:20:44 (GMT)
commite121071e53c5ed61a785e078c15e6578bb5f866a (patch)
treedbe2472fd7f5edcaf3a745efa31d59b9c209e729
parentae9ddd306161a995b213d31003971fa20a15791c (diff)
Report name in email body and TODO update
-rw-r--r--TODO5
-rwxr-xr-xreports_mailer.py12
-rw-r--r--sugar-fbserver.spec6
3 files changed, 16 insertions, 7 deletions
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. <martin.abente.lahaye@gmail.com>
+- Add report name to mail body.
+- Update TODO.
+
* Fri Mar 25 2011 Martin Abente. <martin.abente.lahaye@gmail.com>
- Add custom log to mailer.