|
From: Stas Z. <sta...@us...> - 2005-06-16 13:19:13
|
Update of /cvsroot/gmailagent/GA-libgmail2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv416 Modified Files: libgmail2.py testlibgmail2.py Log Message: Removed more hard tabs Index: libgmail2.py =================================================================== RCS file: /cvsroot/gmailagent/GA-libgmail2/libgmail2.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libgmail2.py 16 Jun 2005 05:09:05 -0000 1.7 --- libgmail2.py 16 Jun 2005 13:19:04 -0000 1.8 *************** *** 900,919 **** def getVCard(self): """Returns a vCard 3.0 for this ! contact, as a string""" ! vcard = "BEGIN:VCARD\n" ! vcard += "VERSION:3.0\n" ! # Deal with multiline notes ! vcard += "NOTE:%s\n" % self.getNotes().replace("\n","\\n") ! # Fake-out N by splitting up whatever we get out of getName ! # This might not always do 'the right thing' ! # but it's a *reasonable* compromise ! fullname = self.getName().split() ! fullname.reverse() ! vcard += "N:%s" % ';'.join(fullname) + "\n" ! vcard += "FN:%s\n" % self.getName() ! vcard += "EMAIL;TYPE=INTERNET:%s\n" % self.getEmail() ! vcard += "END:VCARD\n" ! # Final newline in case we want to put more than one in a file? ! return vcard class GmailContactList: --- 900,919 ---- def getVCard(self): """Returns a vCard 3.0 for this ! contact, as a string""" ! vcard = "BEGIN:VCARD\n" ! vcard += "VERSION:3.0\n" ! # Deal with multiline notes ! vcard += "NOTE:%s\n" % self.getNotes().replace("\n","\\n") ! # Fake-out N by splitting up whatever we get out of getName ! # This might not always do 'the right thing' ! # but it's a *reasonable* compromise ! fullname = self.getName().split() ! fullname.reverse() ! vcard += "N:%s" % ';'.join(fullname) + "\n" ! vcard += "FN:%s\n" % self.getName() ! vcard += "EMAIL;TYPE=INTERNET:%s\n" % self.getEmail() ! vcard += "END:VCARD\n" ! # Final newline in case we want to put more than one in a file? ! return vcard class GmailContactList: Index: testlibgmail2.py =================================================================== RCS file: /cvsroot/gmailagent/GA-libgmail2/testlibgmail2.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testlibgmail2.py 16 Jun 2005 13:03:47 -0000 1.7 --- testlibgmail2.py 16 Jun 2005 13:19:04 -0000 1.8 *************** *** 155,161 **** def test9_vCard(self): """Test vCard export""" ! waseem = GmailContact("0", "Waseem Daher", "wd...@mi...", "GmailAgent developer") ! vcard = waseem.getVCard() ! expectedVCard="""BEGIN:VCARD VERSION:3.0 NOTE:GmailAgent developer --- 155,161 ---- def test9_vCard(self): """Test vCard export""" ! waseem = GmailContact("0", "Waseem Daher", "wd...@mi...", "GmailAgent developer") ! vcard = waseem.getVCard() ! expectedVCard="""BEGIN:VCARD VERSION:3.0 NOTE:GmailAgent developer *************** *** 167,174 **** self.assertEqual(vcard, expectedVCard, "getVCard() did not export what we expected for Waseem") ! # Test multi-line NOTEs ! bob = GmailContact("0", "BillyJo", "bi...@jo...", "I like multilines\nwoo") ! bobvcard=bob.getVCard() ! bobexpectedVCard="""BEGIN:VCARD VERSION:3.0 NOTE:I like multilines\\nwoo --- 167,174 ---- self.assertEqual(vcard, expectedVCard, "getVCard() did not export what we expected for Waseem") ! # Test multi-line NOTEs ! bob = GmailContact("0", "BillyJo", "bi...@jo...", "I like multilines\nwoo") ! bobvcard=bob.getVCard() ! bobexpectedVCard="""BEGIN:VCARD VERSION:3.0 NOTE:I like multilines\\nwoo *************** *** 179,183 **** """ self.assertEqual(vcard, expectedVCard, "getVCard() didn't export what we expected for BillyJo") ! if __name__ == '__main__': #unittest.main() --- 179,183 ---- """ self.assertEqual(vcard, expectedVCard, "getVCard() didn't export what we expected for BillyJo") ! if __name__ == '__main__': #unittest.main() |