|
From: Stas Z <sta...@gm...> - 2005-09-13 11:22:20
|
Waseem,
First things first:
We don't have support for multiple lines in the contacts notes because
the part of
the page we parse only gets the first partial line from the original
contacts notes.
A solution comes from the SF user "posey_p"
(Taken from the forum)
By: Posey - posey_p
Contacts Notes =20
2005-09-13 01:38
Hi. Is there a way to read all of the "Notes" information under a Contact?=
=20
=20
When my contacts have a long Notes field, it reads part of the field,
and the trailing ellipses (...), rather than reading the whole field.
By: Posey - posey_p
RE: Contacts Notes =20
2005-09-13 02:17
Sort of figured it out ...=20
add this to class GmailAccount:=20
=20
def getSpecInfo(self,id):=20
"""=20
Return some cool notes data.=20
"""=20
myURL =3D _buildURL(search=3D'contacts',ct_id=3Did,c=3Did,at=3Dself._=
cookieJar._cookies['GMAIL_AT'],view=3D'ct')
pageData =3D self._retrievePage(myURL)=20
myData =3D self._parsePage(myURL)=20
for x in myData['cov']:=20
print x=20
print=20
=20
# myData contains values other than 'cov'=20
I have implemented this into libgmail to provide multiline support.
I paste the relevant pieces from the CVS diff.
@@ -731,7 +733,10 @@ class GmailAccount:
# if they change, chances are that something *bigger* in
gmail changed
# that we're not ready to deal with
if len(entry) >=3D 6:
- newGmailContact =3D GmailContact(entry[1], entry[2],
entry[4], entry[5])
+ ##newGmailContact =3D GmailContact(entry[1], entry[2],
entry[4], entry[5])
+ rawnotes =3D self._getSpecInfo(entry[1])
+ #print rawnotes
+ newGmailContact =3D GmailContact(entry[1], entry[2],
entry[4],rawnotes)
contactList.append(newGmailContact)
.......
.......
+ def _getSpecInfo(self,id):
+ """
+ Return some cool notes data.
+ """
+ myURL =3D_buildURL(search=3D'contacts',ct_id=3Did,c=3Did,\
+ at=3Dself._cookieJar._cookies['GMAIL_AT'],view=3D'=
ct')
+ pageData =3D self._retrievePage(myURL)
+ myData =3D self._parsePage(myURL)
+ #print "myData",myData
+ rawnotes =3D myData['cov'][7]
+ return rawnotes[1]
Stas
--=20
A nation that continues year after year to spend more money on military def=
ense
than on programs of social uplift is approaching spiritual doom.
Martin Luther King, Jr.
|