Handle strangely-named files
This commit is contained in:
parent
289de6576e
commit
dffaca087f
|
@ -89,11 +89,11 @@ class Maildir(GObject.GObject,
|
||||||
|
|
||||||
# Implants e-mail-related attributes into a file's columns
|
# Implants e-mail-related attributes into a file's columns
|
||||||
def update_file_info(self, file):
|
def update_file_info(self, file):
|
||||||
if not file.is_mime_type("message/rfc822"):
|
if file.get_uri_scheme() == 'file' and not file.is_mime_type("message/rfc822"):
|
||||||
return
|
return
|
||||||
|
|
||||||
filename = file.get_uri()[7:]
|
filepath = file.get_location().get_path()
|
||||||
message = email.message_from_file(open(filename))
|
message = email.message_from_file(open(filepath))
|
||||||
|
|
||||||
sender = message.get("From")
|
sender = message.get("From")
|
||||||
to = message.get("To")
|
to = message.get("To")
|
||||||
|
|
Ŝarĝante…
Reference in New Issue