示例#1
0
 def ics(self, charset="UTF-8"):
     """Export all calendar items in the folder to iCal data"""
     mic = icalmapi.CreateMapiToICal(self.server.ab, charset)
     for item in self.items():
         if item.message_class.startswith('IPM.Appointment'):
             mic.AddMessage(item.mapiobj, "", 0)
     data = mic.Finalize(0)[1]
     return data
示例#2
0
 def ics(self, charset="UTF-8"):
     mic = icalmapi.CreateMapiToICal(self.server.ab, charset)
     mic.AddMessage(self.mapiobj, "", 0)
     _, data = mic.Finalize(0)
     return data
示例#3
0
def mapitoical(ab):
    return icalmapi.CreateMapiToICal(ab, 'utf-8')
示例#4
0
def test_convertmapiobjectall_null():
    with pytest.raises(MAPIError) as excinfo:
        icalmapi.CreateMapiToICal(None, '')
    assert 'MAPI_E_INVALID_PARAMETER' in str(excinfo)