From 2aa54209673021004e51c5ba1f0a1695bf49b2de Mon Sep 17 00:00:00 2001 From: Armin Wieser Date: Wed, 28 Mar 2012 20:25:27 +0200 Subject: [PATCH] Bugfix: mailparser - ID Signed-off-by: Armin Wieser --- memacs/lib/mailparser.py | 6 +++--- memacs/lib/tests/mailparser_test.py | 6 +++--- memacs/photos.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/memacs/lib/mailparser.py b/memacs/lib/mailparser.py index 9c268c8..130b019 100644 --- a/memacs/lib/mailparser.py +++ b/memacs/lib/mailparser.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Time-stamp: <2012-03-13 11:11:29 armin> +# Time-stamp: <2012-03-28 20:12:09 armin> import time import logging @@ -103,8 +103,8 @@ def parse_message(message, add_body=False): except TypeError: logging.error("could not parse dateime from msg %s", dt) - properties.set_id(time_tupel+"_"+msg_id) - + properties.add_data_for_hashing(timestamp + "_" + msg_id) + if "Newsgroups" in headers: ng_list = [] for ng in headers["Newsgroups"].split(","): diff --git a/memacs/lib/tests/mailparser_test.py b/memacs/lib/tests/mailparser_test.py index f0ac243..c48f5d6 100644 --- a/memacs/lib/tests/mailparser_test.py +++ b/memacs/lib/tests/mailparser_test.py @@ -31,7 +31,7 @@ def test_parse_mail_without_body(self): self.assertEqual(notes, "") p = """ :PROPERTIES: :TO: Bob Bobby - :ID: f2c1165a321d0e0@foo.com + :ID: 8fd560c32d51c455744df7abd26ea545924ba632 :END:""" self.assertEqual(unicode(properties), p) @@ -61,7 +61,7 @@ def test_parse_mail_with_body(self): "\nkind reagards,\nBob") p = """ :PROPERTIES: :TO: Bob Bobby - :ID: f2c1165a321d0e0@foo.com + :ID: 8fd560c32d51c455744df7abd26ea545924ba632 :END:""" self.assertEqual(unicode(properties), p) @@ -90,7 +90,7 @@ def test_parse_ng_with_body(self): self.assertEqual(notes, "i just want to say that i love Memacs\n") p = """ :PROPERTIES:\n :REPLY-TO: news@ally.com :NEWSGROUPS: tu-graz.betriebssysteme.linux - :ID: <2011-11-17T21-58-27@ally.com> + :ID: 53e60f934645301478db6c9d5d3df71a043f9851 :END:""" self.assertEqual(unicode(properties), p) diff --git a/memacs/photos.py b/memacs/photos.py index ce1a9ba..45d89b1 100755 --- a/memacs/photos.py +++ b/memacs/photos.py @@ -9,7 +9,7 @@ from lib.memacs import Memacs from lib.orgproperty import OrgProperties import imghdr # TODO add to requirements -from PIL import Image # TODO add to requirements +from PIL import Image # TODO add to requirements from PIL.ExifTags import TAGS