prepare for packaging
[retroconv] / bak / contactsServ.py
diff --git a/bak/contactsServ.py b/bak/contactsServ.py
deleted file mode 100644 (file)
index 95aa7f9..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-import evolution
-from pygobject import *
-from ctypes import *
-#from wrapper import *
-
-
-ebook = CDLL('libebook-1.2.so.5')
-E_CONTACT_HOMEPAGE_URL = 42
-E_CONTACT_PHOTO = 94
-E_CONTACT_EMAIL = 97
-E_CONTACT_BIRTHDAY_DATE = 107
-
-class address_book:
-               
-       def getContactNameFromPhone(self, phoneNum):
-               
-
-               addresses = evolution.ebook.open_addressbook('default')
-               contacts = addresses.get_all_contacts()
-
-
-                #ai = GList.new(ebook.e_contact_get_attributes(hash(self._contact), E_CONTACT_EMAIL))
-
-               for econtact in contacts:
-                       
-                       try: 
-                               #print econtact.get_name()
-                               phones = econtact.get_property('phone') 
-                               
-                               phones_p=int(str(phones)[13:-1],16)
-                               phoneList = GList.new(phones_p)
-                               
-                               while phoneList.has_next():
-                                       currPhone = string_at(phoneList.next())
-                                       
-                                       if currPhone == phoneNum:
-                                               return econtact.get_name()
-                       except:
-                               continue
-                               
-                               
-                               
-       
-       def populateNames(self, recvLst, sentLst):
-               
-               addresses = evolution.ebook.open_addressbook('default')
-               contacts = addresses.get_all_contacts()
-               
-               listX=[]
-               
-               
-               """"for msg in recvLst:
-                       for contact in contacts:
-                               try:
-                                       phones = contact.get_property('phone')  
-                                       phones_p=int(str(phones)[13:-1],16)
-                               except:
-                                       continue
-                                       
-                               phoneList = GList.new(phones_p)
-                               
-                               while phoneList.has_next():
-                                       currPhone = string_at(phoneList.next())
-                                       if currPhone[-7:] == msg.fromNum[-7:]:
-                                               msg.setSenderName(contact.get_name())
-                                               break
-               """
-               
-               for contact in contacts:
-               
-                       try:
-                               phones = contact.get_property('phone')  
-                               phones_p=int(str(phones)[13:-1],16)
-                               phoneList = GList.new(phones_p)
-                               
-                               
-                               
-                                       
-                               
-                               
-                               
-                               
-                               
-                               while phoneList.has_next():
-                                       currPhone = string_at(phoneList.next())
-                                       for msg in recvLst:
-                                               if currPhone[-7:] == msg.fromNum[-7:]:
-                                                       msg.setSenderName(contact.get_name())
-                                               
-                                       for msg in sentLst:
-                                               if currPhone[-7:] == msg.toNum[-7:]:
-                                                       msg.setRecName(contact.get_name())
-                                                       photo = contact.get_property('photo')
-                                                       pi = cast(c_void_p(hash(photo)), POINTER(EContactPhoto))
-                                                       
-                                                       if pi.contents.data.uri.startswith("image/"):
-                                                               #data = string_at(pi.contents.data.inlined.data)
-                                                               data = string_at(pi.contents.data.inlined.data, pi.contents.data.inlined.length)
-                                                               length = pi.contents.data.inlined.length
-                                                               msg.setImageData(data, length)
-                                                               
-                                                       
-                       except:
-                               continue