Changeset 2320
- Timestamp:
- 07/12/07 12:31:06 (1 year ago)
- Files:
-
- plugins/moto-sync/motosync.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/moto-sync/motosync.py
r2318 r2320 1850 1850 1851 1851 # process addresses, create a hash from contacttype to address 1852 # FIXME:addresses that don't map to moto contact types are dropped1852 # addresses that don't map to moto contact types are dropped 1853 1853 addresses = {} 1854 1854 for adr in doc.getElementsByTagName('Address'): 1855 1855 address = [getXMLField(adr, p) for p in XML_ADDRESS_PARTS] 1856 1856 ical_types = adr.getAttribute('Location').split(';') 1857 # XXX: HACK: if it has no type, assume it's a home address 1858 if ical_types == [] or ical_types == ['']: 1859 ical_types = ['Home'] 1857 1860 for t in ical_types: 1858 1861 t = t.lower() … … 1863 1866 1864 1867 # create a child for each telephone/address pair or email 1868 # addresses for which there is no phone number are dropped 1865 1869 for (moto_type, contact, is_pref) in contacts: 1866 1870 if moto_type == MOTO_CONTACT_EMAIL: … … 1957 1961 if e.hasChildNodes(): 1958 1962 if MOTO_ADDRESS_TYPES.has_key(self.contacttype): 1959 e.setAttribute('Location', MOTO_ADDRESS_TYPES[self.contacttype] .upper())1963 e.setAttribute('Location', MOTO_ADDRESS_TYPES[self.contacttype]) 1960 1964 ret.append(e) 1961 1965
