srbodkhe / google-shared-contacts-client

Automatically exported from code.google.com/p/google-shared-contacts-client
Apache License 2.0
0 stars 0 forks source link

Error in script if exported user profile contains more than 8 email addresses #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
You can easily reach 8 addresses in cases of nicknames and domain 
aliases. Each nickname gets an additional "thenickname@domain-
alias.mydomain.com" address (these are not shown in the control panel UI 
but do get email delivered by the Gmail infrastructure). So the number of 
actual email addresses for an Apps profile is: 

NumberOfEmailAddresses = NumberOfDomainAliases * (1 + 
NumberOfNicknames) 

Please change the script to better handle errors when more than 8 email 
addresses are found for user profiles. I guess there are a few options: a 
MAX_EMAIL_ADDRS constant; an option/handler to ignore errors; 
combination of these etc.

What steps will reproduce the problem?
1. Add nicknames/domain aliases to an Apps user so they have more than 
8 email addresses (use the formula above).
2. Do an export (python shared_contacts_profiles.py --admin=XXXX --
export=export-file.csv) 
3. An error will occur as below:
Traceback (most recent call last): 
File "shared_contacts_profiles.py", line 956, in <module> 
main() 
File "shared_contacts_profiles.py", line 951, in main 
contacts_manager.ExportMsOutlookCsv(contact_entries, profile_entries, 
export_csv_file) 
File "shared_contacts_profiles.py", line 504, in ExportMsOutlookCsv 
profile_entries)) 
File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python
2.6/csv.py", line 148, in writerows 
for rowdict in rowdicts: 
File "shared_contacts_profiles.py", line 807, in ContactEntryToFields 
while email.rel in email_addresses[i]: 
IndexError: list index out of range 

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by peter.he...@gmail.com on 16 Feb 2010 at 9:57

GoogleCodeExporter commented 9 years ago
Now it supports up to 23 of each kind (work,home,other), is on the Svn until 
next 
release.

Original comment by julian10...@gmail.com on 19 Feb 2010 at 10:46