I'm writing a Python script that will automatically merge all contacts
with the same name (title). I had added my cell phone contacts to
Google contacts, and now i have many people listed twice: one with an
email only and a second time with a phone number only! I'm near the
end of the script where I have all of the contacts feed loaded,
sorted, and ready to be merged for a given contact person (i.e. 1
name, but potentially multiple contacts) but I am having trouble. I
borrowed from Google's example code below, and I see that there's the
if-statement. I don't really understand what's going with that
statement - why is selected_entry.title = atom.Title()? Also, what
should I put for other attributes that I am wanting to update within
my contact object? For example, if I want to update the Organization
org_title and org_name, for selected_entry in the code below, how
would I modify the if statement?
It appears to me that the atom class is a lower level class that the
gdata class borrows a lot from. perhaps I need clarification on this
relationship so i can finish up the script!
Thanks!
def UpdateContactMenu(self):
selected_entry = self._SelectContact()
new_name = raw_input('Enter a new name for the contact: ')
if not selected_entry.title:
selected_entry.title = atom.Title()
selected_entry.title.text = new_name
self.gd_client.UpdateContact(selected_entry.GetEditLink().href,
selected_entry)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---