DanC / palmagent

originally semantic web sync code for palm devices, but since then a grab-bag of personal information management tools

Clone this repository (size: 591.9 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/DanC/palmagent/
commit 416: 7c2b6b72cff9
parent 415: 911681e11f9d
branch: default
convert postal addresses
Dan Connolly
13 months ago

Changed (Δ321 bytes):

raw changeset »

hipg.py (11 lines added, 0 lines removed)

Up to file-list hipg.py:

@@ -110,6 +110,12 @@ def gcontact(d):
110
110
                label=item['label'],
111
111
                rel=find_rel(item['label'])))
112
112
113
    for item in d['addresses']:
114
        g.postal_address.append(gdata.contacts.PostalAddress(
115
                text=postal(item),
116
                rel=find_rel(item['label'])))
117
118
113
119
    if 'bday' in vcard:
114
120
        g.extended_property.append(gdata.ExtendedProperty(
115
121
                name='bday', value=vcard['bday']))
@@ -119,6 +125,11 @@ def gcontact(d):
119
125
120
126
    return g
121
127
128
def postal(item):
129
    return "%s\n%s, %s %s %s" % (
130
        item['street'],
131
        item['city'], item['state'], item['zip'], item['country'])
132
122
133
if __name__ == '__main__':
123
134
    import sys
124
135
    main(sys.argv)