Пример #1
0
    def test_event_delegated(self):
        e = kolabformat.Event()
        e.setSummary("test")
        e.setStart(kolabformat.cDateTime(2014,7,1, 12,30,0))

        att1 = kolabformat.Attendee(kolabformat.ContactReference("*****@*****.**"))
        att1.setRole(kolabformat.NonParticipant)
        att1.setPartStat(kolabformat.PartDelegated)
        att1.setDelegatedTo([kolabformat.ContactReference("*****@*****.**")])

        att2 = kolabformat.Attendee(kolabformat.ContactReference("*****@*****.**"))
        att2.setRole(kolabformat.Required)
        att2.setPartStat(kolabformat.PartNeedsAction)
        att2.setDelegatedFrom([kolabformat.ContactReference("*****@*****.**")])

        e.setAttendees([att1, att2])
        self.assertEqual(len(att1.delegatedTo()), 1)
        self.assertEqual(len(att2.delegatedFrom()), 1)

        xml = kolabformat.writeEvent(e)
        e1 = kolabformat.readEvent(xml, False)
        # print xml

        attendees_ = e1.attendees()
        self.assertEqual(len(attendees_), 2)
        self.assertEqual(len(attendees_[0].delegatedTo()), 1)
        self.assertEqual(len(attendees_[1].delegatedFrom()), 1)

        delegatees = attendees_[0].delegatedTo()
        self.assertEqual(delegatees[0].email(), "*****@*****.**")
Пример #2
0
    def test_event_delegated(self):
        e = kolabformat.Event()
        e.setSummary("test")
        e.setStart(kolabformat.cDateTime(2014, 7, 1, 12, 30, 0))

        att1 = kolabformat.Attendee(
            kolabformat.ContactReference("*****@*****.**"))
        att1.setRole(kolabformat.NonParticipant)
        att1.setPartStat(kolabformat.PartDelegated)
        att1.setDelegatedTo([kolabformat.ContactReference("*****@*****.**")])

        att2 = kolabformat.Attendee(
            kolabformat.ContactReference("*****@*****.**"))
        att2.setRole(kolabformat.Required)
        att2.setPartStat(kolabformat.PartNeedsAction)
        att2.setDelegatedFrom([kolabformat.ContactReference("*****@*****.**")])

        e.setAttendees([att1, att2])
        self.assertEqual(len(att1.delegatedTo()), 1)
        self.assertEqual(len(att2.delegatedFrom()), 1)

        xml = kolabformat.writeEvent(e)
        e1 = kolabformat.readEvent(xml, False)
        # print xml

        attendees_ = e1.attendees()
        self.assertEqual(len(attendees_), 2)
        self.assertEqual(len(attendees_[0].delegatedTo()), 1)
        self.assertEqual(len(attendees_[1].delegatedFrom()), 1)

        delegatees = attendees_[0].delegatedTo()
        self.assertEqual(delegatees[0].email(), "*****@*****.**")
Пример #3
0
    def __init__(self, from_ical="", from_string=""):
        self._attendees = []

        if from_ical == "":
            if from_string == "":
                self.event = kolabformat.Event()
            else:
                self.event = kolabformat.readEvent(from_string, False)
        else:
            self.from_ical(from_ical)

        self.uid = self.get_uid()
Пример #4
0
    def __init__(self, from_ical="", from_string=""):
        self._attendees = []
        self._categories = []
        self._attachment_parts = []

        if from_ical == "":
            if from_string == "":
                self.event = kolabformat.Event()
            else:
                self.event = kolabformat.readEvent(from_string, False)
                self._load_attendees()
        else:
            self.from_ical(from_ical)

        self.uid = self.get_uid()
Пример #5
0
    def test_event_basic(self):
        e = kolabformat.Event()
        e.setSummary("test")

        start = kolabformat.cDateTime(2014,7,1, 12,30,0)
        start.setTimezone("Europe/London")
        e.setStart(start)

        ex = e.exceptionDates()
        ex.size()
        ex.push_back(kolabformat.cDateTime(2014,7,5))
        ex.size()
        e.exceptionDates().size()
        e.setExceptionDates(ex)
        e.exceptionDates().size()

        xml = kolabformat.writeEvent(e)
        e1 = kolabformat.readEvent(xml, False)
        xml1 = kolabformat.writeEvent(e1)
        self.assertEqual(xml, xml1)
Пример #6
0
    def test_event_basic(self):
        e = kolabformat.Event()
        e.setSummary("test")

        start = kolabformat.cDateTime(2014, 7, 1, 12, 30, 0)
        start.setTimezone("Europe/London")
        e.setStart(start)

        ex = e.exceptionDates()
        ex.size()
        ex.push_back(kolabformat.cDateTime(2014, 7, 5))
        ex.size()
        e.exceptionDates().size()
        e.setExceptionDates(ex)
        e.exceptionDates().size()

        xml = kolabformat.writeEvent(e)
        e1 = kolabformat.readEvent(xml, False)
        xml1 = kolabformat.writeEvent(e1)
        self.assertEqual(xml, xml1)
Пример #7
0
import kolabformat
e = kolabformat.Event()

ex = e.exceptionDates()
ex.size()
ex.push_back(kolabformat.cDateTime(1,1,1))
ex.size()
e.exceptionDates().size()
e.setExceptionDates(ex)
e.exceptionDates().size()

string = kolabformat.writeEvent(e);
print string;
e1 = kolabformat.readEvent(string, False);
string = kolabformat.writeEvent(e1);
print string;