Skip to content

Commit

Permalink
Merge pull request #63 from da4089/issue-62-for-0.9
Browse files Browse the repository at this point in the history
Fixes #62.
  • Loading branch information
da4089 authored Oct 8, 2024
2 parents 4d1d74e + b4a5cf2 commit fe20d37
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test_files/radicale-1587.vcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BEGIN:VCARD
VERSION:3.0
FN:Given Family
N:Family;Given;Additional;Prefix;Suffix
GEO:37.386013;-122.082932
END:VCARD
10 changes: 10 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,16 @@ def test_radicale_1238_3(self):
self.assertIsNotNone(vo)
return

def test_radicale_1587(self):
vcf_str = get_test_file("radicale-1587.vcf")
vobjs = base.readComponents(vcf_str)
for vo in vobjs:
self.assertIsNotNone(vo)
lines = vo.serialize().split("\r\n")
for line in lines:
if line.startswith("GEO"):
self.assertEqual(line, "GEO:37.386013;-122.082932")
return

if __name__ == '__main__':
unittest.main()
10 changes: 9 additions & 1 deletion vobject/vcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class VCard3_0(VCardBehavior):
'ADR': (0, None, None),
'ORG': (0, None, None),
'PHOTO': (0, None, None),
'CATEGORIES': (0, None, None)
'CATEGORIES': (0, None, None),
'GEO': (0, None, None)
}

@classmethod
Expand All @@ -207,6 +208,13 @@ class Label(VCardTextBehavior):
description = 'Formatted address'
registerBehavior(Label)


class GEO(VCardBehavior):
name = "GEO"
description = "Geographical location"
registerBehavior(GEO)


wacky_apple_photo_serialize = True
REALLY_LARGE = 1E50

Expand Down

0 comments on commit fe20d37

Please sign in to comment.