/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/util/simplemapi.py

  • Committer: James Westby
  • Date: 2007-09-18 18:55:00 UTC
  • mto: (2866.1.1 james.westby)
  • mto: This revision was merged to the branch mainline in revision 2867.
  • Revision ID: jw+debian@jameswestby.net-20070918185500-91alkjx8zolds1v8
Fix log against smart server branches that don't support tags. (#140615)

Add get_reverse_tag_dict to DisabledTags for branches that falsely
claim that they support tags (namely smart server branches). When the
remote branch was an old format without tags this caused log to fail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
Origin  : Based on the original script by Ian Cook
29
29
          http://www.kirbyfooty.com/simplemapi.py
30
30
Comments: Works (and tested) with:
31
 
          Outlook Express, Outlook 97 and 2000,
 
31
          Outlook Express, Outlook 97 and 2000, 
32
32
          Eudora, Incredimail and Mozilla Thunderbird (1.5.0.2)
33
33
Thanks  : Werner F. Bruhin and Michele Petrazzo on the ctypes list.
34
34
 
35
 
If you have any bug-fixes, enhancements or suggestions regarding this
 
35
If you have any bug-fixes, enhancements or suggestions regarding this 
36
36
software, please contact me at the above email address.
37
37
"""
38
38
 
181
181
 
182
182
def _sendMail(session, recipient, subject, body, attach):
183
183
    nFileCount = len(attach)
184
 
    if attach:
185
 
        MapiFileDesc_A = MapiFileDesc * len(attach)
186
 
        fda = MapiFileDesc_A()
187
 
        for fd, fa in zip(fda, attach):
188
 
            fd.ulReserved = 0
189
 
            fd.flFlags = 0
190
 
            fd.nPosition = -1
191
 
            fd.lpszPathName = fa
192
 
            fd.lpszFileName = None
193
 
            fd.lpFileType = None
 
184
    if attach: 
 
185
        MapiFileDesc_A = MapiFileDesc * len(attach) 
 
186
        fda = MapiFileDesc_A() 
 
187
        for fd, fa in zip(fda, attach): 
 
188
            fd.ulReserved = 0 
 
189
            fd.flFlags = 0 
 
190
            fd.nPosition = -1 
 
191
            fd.lpszPathName = fa 
 
192
            fd.lpszFileName = None 
 
193
            fd.lpFileType = None 
194
194
        lpFiles = fda
195
195
    else:
196
196
        lpFiles = lpMapiFileDesc()
197
197
 
198
198
    RecipWork = recipient.split(';')
199
199
    RecipCnt = len(RecipWork)
200
 
    MapiRecipDesc_A = MapiRecipDesc * len(RecipWork)
201
 
    rda = MapiRecipDesc_A()
 
200
    MapiRecipDesc_A = MapiRecipDesc * len(RecipWork) 
 
201
    rda = MapiRecipDesc_A() 
202
202
    for rd, ra in zip(rda, RecipWork):
203
 
        rd.ulReserved = 0
 
203
        rd.ulReserved = 0 
204
204
        rd.ulRecipClass = MAPI_TO
205
205
        try:
206
206
            rd.lpszName, rd.lpszAddress = _resolveName(session, ra)
222
222
 
223
223
def SendMail(recipient, subject="", body="", attachfiles=""):
224
224
    """Post an e-mail message using Simple MAPI
225
 
 
 
225
    
226
226
    recipient - string: address to send to (multiple addresses separated with a semicolon)
227
227
    subject   - string: subject header
228
228
    body      - string: message text