コード例 #1
0
    def test_readComponents(self):
        """
        Test if reading components correctly
        """
        cal = next(readComponents(self.simple_test_cal))

        self.assertEqual(str(cal), "<VCALENDAR| [<VEVENT| [<SUMMARY{'BLAH': ['hi!']}Bastille Day Party>]>]>")
        self.assertEqual(str(cal.vevent.summary), "<SUMMARY{'BLAH': ['hi!']}Bastille Day Party>")
コード例 #2
0
ファイル: tests.py プロジェクト: ciprianmiclaus/vobject
    def test_readComponents(self):
        """
        Test if reading components correctly
        """
        cal = next(readComponents(self.simple_test_cal))

        self.assertEqual(str(cal), "<VCALENDAR| [<VEVENT| [<SUMMARY{'BLAH': ['hi!']}Bastille Day Party>]>]>")
        self.assertEqual(str(cal.vevent.summary), "<SUMMARY{'BLAH': ['hi!']}Bastille Day Party>")
コード例 #3
0
ファイル: vcard.py プロジェクト: larsimmisch/aculab
def vcard_find(tel):
    f = codecs.open(addresses, 'r', encoding='UTF-8')
    try:
        vcards = readComponents(f)

        tel = tel_normalize(tel)
        for vc in vcards:
            t = getattr(vc, 'tel_list', None)
            if t:
                for i in t:
                    if tel == tel_normalize(i.value):
                        return vc
    finally:
        f.close()