def google(self, qs): """CSV format suitable for importing into google GMail """ csvf = writer(sys.stdout) csvf.writerow(['Name', 'Email']) for ent in qs: csvf.writerow([full_name(**ent), ent['email']])
def linkedin(self, qs): """CSV format suitable for importing into linkedin Groups. perfect for pre-approving members of a linkedin group. """ csvf = writer(sys.stdout) csvf.writerow(['First Name', 'Last Name', 'Email']) for ent in qs: csvf.writerow([ent['first_name'], ent['last_name'], ent['email']])
def outlook(self, qs): """CSV format suitable for importing into outlook""" csvf = writer(sys.stdout) columns = ['Name', 'E-mail Address', 'Notes', 'E-mail 2 Address', 'E-mail 3 Address', 'Mobile Phone', 'Pager', 'Company', 'Job Title', 'Home Phone', 'Home Phone 2', 'Home Fax', 'Home Address', 'Business Phone', 'Business Phone 2', 'Business Fax', 'Business Address', 'Other Phone', 'Other Fax', 'Other Address'] csvf.writerow(columns) empty = [''] * (len(columns) - 2) for ent in qs: csvf.writerow([self.full_name(**ent), ent.get('email', '')] + empty)
def outlook(self, qs): """CSV format suitable for importing into outlook""" csvf = writer(sys.stdout) columns = ['Name', 'E-mail Address', 'Notes', 'E-mail 2 Address', 'E-mail 3 Address', 'Mobile Phone', 'Pager', 'Company', 'Job Title', 'Home Phone', 'Home Phone 2', 'Home Fax', 'Home Address', 'Business Phone', 'Business Phone 2', 'Business Fax', 'Business Address', 'Other Phone', 'Other Fax', 'Other Address'] csvf.writerow(columns) empty = [''] * (len(columns) - 2) for ent in qs: csvf.writerow([full_name(**ent), ent['email']] + empty)