/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: Vincent Ladeuil
  • Date: 2008-11-21 16:43:53 UTC
  • mto: (3855.1.1 bzr.integration)
  • mto: This revision was merged to the branch mainline in revision 3856.
  • Revision ID: v.ladeuil+lp@free.fr-20081121164353-8d07go33ycibzbwl
Better fix for bug #300055.

* bzrlib/tests/test_log.py:
(TestGetViewRevisions.make_tree_with_many_merges): Hijack the
helper to test for revisions touching file on a more significant
tree.
(TestGetViewRevisions.test_file_id_for_range): Better test to
highlight bug #300055: starting revision is a dotted revno and the
log should start right there, not at the mainline revision where
merging occured. But that uncovers yet another bug...
(TestGetRevisionsTouchingFileID.assertAllRevisionsForFileID):
_filter_revisions_touching_file_id doesn't have a 'direction'
parameter anymore.

* bzrlib/tests/blackbox/test_log.py:
(TestCaseWithoutPropsHandler): Fix line too long.
(TestLog.test_log_with_tags,
TestLogMerges.test_merges_partial_range): Fix whitespaces.

* bzrlib/log.py:
(calculate_view_revisions): Delete gratuitous split line. Push
direction handling closer to the needed point. Delete 'direction'
parameter when calling _filter_revisions_touching_file_id.
(_filter_revisions_touching_file_id): Delete 'direction'
parameter. This was used for calling reverse_by_depth which can't
handle an already reversed list.

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