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
def ics(self, charset="UTF-8"): mic = icalmapi.CreateMapiToICal(self.server.ab, charset) mic.AddMessage(self.mapiobj, "", 0) _, data = mic.Finalize(0) return data
def mapitoical(ab): return icalmapi.CreateMapiToICal(ab, 'utf-8')
def test_convertmapiobjectall_null(): with pytest.raises(MAPIError) as excinfo: icalmapi.CreateMapiToICal(None, '') assert 'MAPI_E_INVALID_PARAMETER' in str(excinfo)