diff options
author | Pierre-Yves David <pierre-yves.david@logilab.fr> | 2008-06-23 14:54:50 +0200 |
---|---|---|
committer | Pierre-Yves David <pierre-yves.david@logilab.fr> | 2008-06-23 14:54:50 +0200 |
commit | 156df98848bcc383fd126d7649d45410f975ecca (patch) | |
tree | 1b42e304fb385c669c45183c0bc91be1f7427f3a /umessage.py | |
parent | 6348cf0813d3a95d3d7f0bccfde853211b17a1e7 (diff) | |
download | logilab-common-156df98848bcc383fd126d7649d45410f975ecca.tar.gz |
umessage.date() doesn't return the unprasable string by default
Diffstat (limited to 'umessage.py')
-rw-r--r-- | umessage.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/umessage.py b/umessage.py index fa1e57e..4129f00 100644 --- a/umessage.py +++ b/umessage.py @@ -110,7 +110,7 @@ class UMessage: persons.append((name, mail)) return persons - def date(self, alternative_source=False): + def date(self, alternative_source=False, return_str=False): """return a mx.DateTime object for the email's date or None if no date is set or if it can't be parsed """ @@ -126,6 +126,8 @@ class UMessage: datetuple = parsedate(value) if datetuple: return DateTime(*datetuple[:6]) + elif not return_str: + return None return value |