~tsarev/taskcoach/1.3

« back to all changes in this revision

Viewing changes to taskcoachlib/mailer/outlook.py

  • Committer: fniessink
  • Date: 2011-07-20 19:23:17 UTC
  • Revision ID: svn-v4:648457a2-254a-0410-87ef-a9f7caebb725:branches/Release1_3_Branch/taskcoach:4582
Merge from 1.2 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
 
23
23
if os.name == 'nt':
24
 
    from win32com.client import GetActiveObject
 
24
    from win32com.client import GetActiveObject # pylint: disable-msg=F0401
25
25
 
26
26
    def getCurrentSelection():
27
27
        selection = GetActiveObject('Outlook.Application').ActiveExplorer().Selection
41
41
            encoding = 'utf-8'
42
42
        mailFile = codecs.open(filename, 'wb', encoding)
43
43
        try:
44
 
            mailFile.write(headers(item) + body)
 
44
            mailFile.write(emailHeaders(item) + body)
45
45
        finally:
46
46
            mailFile.close()
47
47
            os.chmod(filename, stat.S_IREAD)
48
48
 
49
 
    def headers(item, lineSep=u'\r\n'):
 
49
    def emailHeaders(item, lineSep=u'\r\n'):
50
50
        headers = []
51
51
        headers.append(u'subject: %s'%item.Subject)
52
52
        headers.append(u'X-Outlook-ID: %s'%item.EntryID)