Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Hermes
Summary Lists News SCM
authorAndrew Flegg <andrew@bleb.org>
Tue, 13 Oct 2009 19:35:41 +0000 (20:35 +0100)
committerAndrew Flegg <andrew@bleb.org>
Tue, 13 Oct 2009 19:35:41 +0000 (20:35 +0100)
12 files changed:
package/Makefile
package/debian/changelog
package/debian/control
package/share/hermes-256.png
package/share/hermes-48.png
package/share/hermes-64.png
package/src/contact-update.c [deleted file]
package/src/contacts.py
package/src/contactview.py
package/src/gui.py
package/src/hermes.py
package/src/pygobject.py [new file with mode: 0644]

index 78f40e8..6501e47 100644 (file)
@@ -3,12 +3,10 @@ compile:
        uuencode -m share/hermes-48.png - | perl -ne 'print " $$_" unless $$. == 1 or /^====$$/' >>debian/control
        py_compilefiles src/*.py
        mkdir bin
-       gcc -o bin/contact-update -std=c99 `pkg-config --cflags --libs libebook-1.2 glib-2.0` src/contact-update.c
 
 install:
        mkdir -p ${DESTDIR}/opt/hermes/lib ${DESTDIR}/opt/hermes/bin
        ln -s ../lib/gui.py ${DESTDIR}/opt/hermes/bin/hermes
-       install -D -m 0755 -o root -g root bin/contact-update ${DESTDIR}/opt/hermes/bin/contact-update
        install -D -m 0644 -o root -g root src/*.py* ${DESTDIR}/opt/hermes/lib/
        install -D -m 0644 -o root -g root share/hermes-64.png ${DESTDIR}/usr/share/icons/hicolor/scalable/hildon/hermes.png
        install -D -m 0644 -o root -g root share/hermes-48.png ${DESTDIR}/usr/share/icons/hicolor/48x48/hildon/hermes.png
index 1dc476b..a3cef84 100644 (file)
@@ -1,3 +1,16 @@
+hermes (0.0.6) unstable; urgency=low
+
+  * New icons from Tim Samoff.
+  * Set Facebook and Twitter URLs into profiles (increases data
+    enrichment, and will be used for resyncing).
+  * Manipulate contact photos directly from Python, rather than
+    using external C program.
+  * Remove "Back" buttons from contact views - not consistent with
+    Maemo 5 HIG.
+  * Implement birthday adding.
+
+ -- Andrew Flegg <andrew@bleb.org>  Tue,  6 Oct 2009 22:49:22 +0100
+
 hermes (0.0.5) unstable; urgency=low
 
   * Fix gnome-python dependency (re-reported by Andrew Smith &
index 352db09..1861bab 100644 (file)
@@ -2,12 +2,11 @@ Source: hermes
 Section: user/utilities
 Priority: extra
 Maintainer: Andrew Flegg <andrew@bleb.org>
-Build-Depends: debhelper (>= 5), python-runtime | python2.5-runtime, libebook-dev,
- sharutils, libosso-abook-dev
+Build-Depends: debhelper (>= 5), python-runtime | python2.5-runtime, sharutils
 Standards-Version: 3.7.2
 
 Package: hermes
-Architecture: any
+Architecture: all
 Depends: ${shlibs:Depends}, ${misc:Depends}, python-imaging |
  python2.5-imaging, python-osso | python2.5-osso, python-hildon |
  python2.5-hildon, python-twitter, python-facebook, python-evolution, gnome-python
@@ -19,112 +18,118 @@ Description: Enrich contacts' information from social networks.
 XB-Maemo-Display-Name: Hermes
 XB-Maemo-Icon-26:
  iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0
- d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEtxJREFUeNrsWgmUXGWV/v63
- 1+tauru6ek/vS9JL0lk6AUlAASVwIICKCANkEFxHkBkNIwzicVgEYZRVGMcj
- ODoEAWUTRZaACSELBNKmSdIL3el0Or1317695Z/7XlcSDMQDjOOM51g5f1e9
- qvf+d5fv3vvd+8I45/hrfrG/KfB//JJ6tj/qfjCzBhqXtWNydtbRCmXBQkRi
- 85iujYoQ0iYHO+YmAvtzmxWwLb9o2yKPp3SEimP2tdddzehG/DvrrkUynTqi
- wFHe4CFdx1QEGqDLmjamCbIqMWhZw4pMs7+QVUWxVGBCukS0Le7FdAbwGRdf
- +LXUgpZ5ZnRq9I89YBiG+8E2LW7aXr8sZpOymtAy3K4RBFEhvfxkkYQiFeyw
- rNnsX0IBbicKGBPn24xDUuRoOhqJFwfVt2FJesZQoMrZ5GEFGtob5xQAh5VJ
- 6KLPV6uZVlIE2iFKftotBCaGKVIm6bT+v0RcgkktH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2Y4B5RRukcYNGD2MYryEWhIVTXoSg3mgWvHXL3hV
+ HTDm60bzgcMw9Y90rX3Rt5RulpvpZMYXLX8hGFF+MXje7Gu6965elGmP12ba
+ 0gtaGn90WyNlA9UvONIZOlwY3ClsGqSkvJSqeCDQgeIYcqFy72E1MrYd0WGb
+ pSFX/0yP76uyfv/QysD42x/m3vJnmId4iv3R3l7du/yHF1fgTCvtvo9ltq0L
+ J7OqbOrXVgWHjI1ou54e37vnlVpvxdRK4SkrFtlk2DF6I0S4VSp2tqIGM3Ig
+ mJJ94aTT8nKcB8e0sP7XNKB62j5ic536oVcJtFS39uihCXdcq1SO3m61HSHt
+ /7a3uPKHmnX2toUnCSK3ErvY76uZFVFiA/sg0xZDpjMGW/cxWbHgLU4iUNwN
+ b3mcd+9uF46VJdhKUcOTFew0pSjEdxvF6sk/042/8bWUEP+Ft3L/Cx6O/+PP
+ PxT4hwL/3xX4TwEGAON+0/6T7Ga2AAAAAElFTkSuQmCC
index 524cd5d..e3b774f 100644 (file)
Binary files a/package/share/hermes-256.png and b/package/share/hermes-256.png differ
index d6240ca..b8dd00f 100644 (file)
Binary files a/package/share/hermes-48.png and b/package/share/hermes-48.png differ
index 9f4d645..0cec6ae 100644 (file)
Binary files a/package/share/hermes-64.png and b/package/share/hermes-64.png differ
diff --git a/package/src/contact-update.c b/package/src/contact-update.c
deleted file mode 100644 (file)
index 47b6a74..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
- * contact-update                          (c) Andrew Flegg 2009
- * ~~~~~~~~~~~~~~                          Released under the Artistic Licence.
- *
- * A very quick and dirty program to modify an EDS contact's photo and
- * birthday. This is necessary because evolution-python only exposes the two
- * structs GBoxed, which cannot be created or manipulated in Python (AFAICT).
- *
- * Error handling: limited
- * Syntax: contact-update <name> --photo <mime-type> <file>
- *         contact-update <name> --birthday <year> <month> <day>
- */
-#include <libebook/e-book.h>
-#include <libebook/e-contact.h>
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <string.h>
-
-// gcc -o contact-update -std=c99 `pkg-config --cflags --libs libebook-1.2 glib-2.0` contact-update.c
-
-GError *error = NULL;
-
-
-/**
- * Simple error handling.
- *
- * @param result Result of an expression. If false, <var>message</var> will be shown
- *               and the process terminated.
- * @param message Message to display if <var>result</var> is false.
- */
-void* try(gboolean result, char* message) {
-        if (!result) {
-                fprintf(stderr, "Error %s: %s\n", message, error ? error->message : "");
-                exit(EXIT_FAILURE);
-        }
-}
-
-
-/**
- * Load a photo from disk into an EContactPhoto record.
- *
- * @param mime_type MIME type to store in the photo record.
- * @param filename Filename on disk to load.
- */
-EContactPhoto load_photo(char* mime_type, char* filename) {
-        struct stat stbuf;
-        stat(filename, &stbuf);
-        char* photo_data = malloc(stbuf.st_size);
-        try(photo_data != NULL, "allocating memory for photo");
-        FILE *file = fopen(filename, "r");
-        try(file != NULL, "opening file");
-        int read;
-        char* current = photo_data;
-        while ((read = fread(current, 1, stbuf.st_size, file)) > 0) {
-          current += read;
-        }
-        fclose(file);
-        
-        EContactPhoto photo;
-        photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
-        photo.data.inlined.mime_type = mime_type;
-        photo.data.inlined.length = stbuf.st_size;
-        photo.data.inlined.data = photo_data;
-        
-        return photo;
-}
-
-
-/**
- * Create a date record corresponding to the given strings.
- *
- * @param year Character representation of the year.
- * @param month Character representation of the month.
- * @param day Character representation of the day.
- */
-EContactDate read_date(char* year, char* month, char* day) {
-        EContactDate date;
-        date.year  = atoi(year);
-        date.month = atoi(month);
-        date.day   = atoi(day);
-        return date;
-}
-
-
-/**
- * Main entry point: do the work of updating matched records.
- */
-int main(int argc, char* argv[]) {
-        g_type_init();
-        
-        try(argc > 2, "\nsyntax: <name> --photo <mime-type> <file>\n        <name> --birthday <year> <month> <day>");
-
-        // -- Data structures we'll use later...
-        //
-        gboolean is_photo;
-        gboolean is_birthday;
-        EContactPhoto photo;
-        EContactDate  birthday;
-        if (strcmp(argv[2], "--photo") == 0) {
-          try(argc == 5, "syntax: <name> --photo <mime-type> <file>");
-          photo = load_photo(argv[3], argv[4]);
-          is_photo = 1;
-          
-        } else if (strcmp(argv[2], "--birthday") == 0) {
-          try(argc == 6, "syntax: <name> --birthday <year> <month> <day>");
-          birthday = read_date(argv[3], argv[4], argv[5]);
-          is_birthday = 1;
-          
-        } else {
-          try(1 == 0, "\nsyntax: <name> --photo <mime-type> <file>\n        <name> --birthday <year> <month> <day>");
-        }
-        
-        // -- Open the address book...
-        //
-        EBook *book = e_book_new_system_addressbook(&error);
-        try(book != NULL, "finding address book");
-        try(e_book_open(book, FALSE, &error), "opening address book");
-        try(e_book_is_writable(book), "book is writable");
-
-        // -- Find the list of contacts...
-        //
-        GList *contacts = NULL;
-        EBookQuery *query = e_book_query_field_test(E_CONTACT_FULL_NAME, E_BOOK_QUERY_IS, argv[1]);
-        try(e_book_get_contacts(book, query, &contacts, &error), "listing contacts");
-        e_book_query_unref(query);
-        
-        // -- Update the contacts...
-        //
-        int i = 0;
-        for (GList* node = g_list_first(contacts); node != NULL; node = g_list_next(node)) {
-          EContact *contact = E_CONTACT(node->data);
-          if (is_photo)    e_contact_set(contact, E_CONTACT_PHOTO, &photo);
-          if (is_birthday) e_contact_set(contact, E_CONTACT_BIRTH_DATE, &birthday);
-            
-          if (is_photo || is_birthday) {
-            try(e_book_commit_contact(book, contact, &error), "committing contact");
-            i++;
-          }
-        }
-        printf("Modified %d records\n", i);
-
-        return EXIT_SUCCESS;
-}
-
index 0b7a1e9..4963191 100644 (file)
@@ -3,6 +3,17 @@ import os.path
 import urllib
 import Image
 import ImageOps
+import StringIO
+import datetime
+from pygobject import *
+from ctypes import *
+
+# Constants from http://library.gnome.org/devel/libebook/stable/EContact.html#EContactField
+ebook = CDLL('libebook-1.2.so.5')
+E_CONTACT_HOMEPAGE_URL = 42
+E_CONTACT_PHOTO = 94
+E_CONTACT_BIRTHDAY_DATE = 107
+
 
 class ContactStore:
   """Provide an API for changing contact data. Abstracts limitations
@@ -17,7 +28,6 @@ class ContactStore:
     """Create a new contact store for modifying contacts in the given
        EBook."""
 
-    self.temp_file = os.tmpnam()
     self.book = book
 
  
@@ -25,8 +35,7 @@ class ContactStore:
   def close(self):
     """Close the store and tidy-up any resources."""
 
-    if (os.path.isfile(self.temp_file)):
-      os.unlink(self.temp_file)
+    pass
 
 
   # -----------------------------------------------------------------------
@@ -35,13 +44,91 @@ class ContactStore:
        photo is wider than it is tall, it will be cropped with a bias towards
        the top of the photo."""
 
-    urllib.urlretrieve(url, self.temp_file)
-    im = Image.open(self.temp_file)
+    f = urllib.urlopen(url)
+    data = ''
+    while True:
+      read_data = f.read()
+      data += read_data
+      if not read_data:
+        break
+
+    im = Image.open(StringIO.StringIO(data))
     (w, h) = im.size
     if (h > w):
       print "Shrinking photo for %s as it's %d x %d" % (contact.get_name(), w, h)
       im = ImageOps.fit(im, (w, w), Image.NEAREST, 0, (0, 0.1))
-      im.save(self.temp_file, "JPEG")
       
     print "Updating photo for %s" % (contact.get_name())
-    os.spawnl(os.P_WAIT, '/opt/hermes/bin/contact-update', 'contact-update', contact.get_name(), '--photo', 'image/jpeg', self.temp_file)
+    f = StringIO.StringIO()
+    im.save(f, "JPEG")
+    image_data = f.getvalue()
+    photo = EContactPhoto()
+    photo.type = 0
+    photo.data = EContactPhoto_data()
+    photo.data.inlined = EContactPhoto_inlined()
+    photo.data.inlined.mime_type = cast(create_string_buffer("image/jpeg"), c_char_p)
+    photo.data.inlined.length = len(image_data)
+    photo.data.inlined.data = cast(create_string_buffer(image_data), c_void_p)
+    ebook.e_contact_set(hash(contact), E_CONTACT_PHOTO, addressof(photo))
+    return True
+    
+    
+  # -----------------------------------------------------------------------
+  def set_birthday(self, contact, day, month, year = 0):
+    if year == 0:
+      year = datetime.date.today().year
+      
+    birthday = EContactDate()
+    birthday.year = year
+    birthday.month = month
+    birthday.day = day
+    print "Setting birthday for [%s] to %d-%d-%d" % (contact.get_name(), year, month, day)
+    ebook.e_contact_set(hash(contact), E_CONTACT_BIRTHDAY_DATE, addressof(birthday))
+    return True
+    
+    
+  # -----------------------------------------------------------------------
+  def get_urls(self, contact):
+    """Return a list of URLs which are associated with this contact."""
+
+    urls = []
+    ai = GList.new(ebook.e_contact_get_attributes(hash(contact), E_CONTACT_HOMEPAGE_URL))
+    while ai.has_next():
+      attr = ai.next(as_a = EVCardAttribute)
+      if not attr:
+        raise Exception("Unexpected null attribute for [" + contact.get_name() + "] with URLs " + urls)
+      urls.append(string_at(attr.value().next()))
+      
+    return urls
+
+    
+  # -----------------------------------------------------------------------
+  def add_url(self, contact, url, unique = ''):
+    """Add a new URL to the set of URLs for the given contact."""
+
+    unique = unique or url
+    url_attr = None
+    ai = GList.new(ebook.e_contact_get_attributes(hash(contact), E_CONTACT_HOMEPAGE_URL))
+    while ai.has_next():
+      attr = ai.next(as_a = EVCardAttribute)
+      existing = string_at(attr.value().next())
+      if existing == unique or existing == url:
+        return False
+      elif existing.find(unique) > -1:
+        url_attr = attr
+        break
+    
+    if not url_attr:
+      ai.add()
+      url_attr = EVCardAttribute()
+      url_attr.group = ''
+      url_attr.name = 'URL'
+      
+    val = GList()
+    print "Setting URL for [%s] to [%s]" % (contact.get_name(), url)
+    val.set(create_string_buffer(url))
+    ai.set(addressof(url_attr))
+    url_attr.values = cast(addressof(val), POINTER(GList))
+    ebook.e_contact_set_attributes(hash(contact), E_CONTACT_HOMEPAGE_URL, addressof(ai))
+    return True
+
index 6488cc5..e6db658 100644 (file)
@@ -1,6 +1,7 @@
 import gtk
 import hildon
 from ctypes import *
+from pygobject import *
 
 class ContactView(hildon.PannableArea):
   """Widget which shows a list of contacts in a pannable area.
@@ -50,18 +51,3 @@ class ContactView(hildon.PannableArea):
     self.add(self.treeview)
     self.set_size_request(600, 380)
 
-
-class EContactPhoto_inlined(Structure):
-  _fields_ = [('mime_type', c_char_p),
-              ('length', c_uint),
-              ('data', c_void_p)]
-
-class EContactPhoto_data(Union):
-  _fields_ = [('inlined', EContactPhoto_inlined),
-              ('uri', c_char_p)]
-
-class EContactPhoto(Structure):
-  _fields_ = [('type', c_int),
-              ('data', EContactPhoto_data)]
-
-
index 37e843b..64fa675 100755 (executable)
@@ -83,7 +83,6 @@ class HermesGUI:
     view = contactview.ContactView(contacts)
 
     dialog = gtk.Dialog('Contacts', self.window)
-    dialog.add_button('Back', gtk.RESPONSE_OK)
     #view.connect('contact-activated', self.map_contact)
     dialog.vbox.add(view)
     dialog.show_all()
index 45bb05f..81faeac 100644 (file)
@@ -116,7 +116,7 @@ class Hermes:
         self.do_fb_login()
 
       # Get the list of friends...
-      attrs = ['uid', 'name', 'pic_big', 'birthday_date']
+      attrs = ['uid', 'name', 'pic_big', 'birthday_date', 'profile_url']
       for friend in self.fb.users.getInfo(self.fb.friends.get(), attrs):
         friend['pic'] = friend[attrs[2]]
         self.friends[friend['name']] = friend
@@ -130,8 +130,10 @@ class Hermes:
       api = twitter.Api(username=user, password=passwd)
       users = api.GetFriends()
       for friend in api.GetFriends():
-        self.friends[friend.name] = {'name': friend.name, 'pic': friend.profile_image_url, 'birthday_date': None}
+        self.friends[friend.name] = {'name': friend.name, 'pic': friend.profile_image_url, 'birthday_date': None, 'twitter_url': 'http://twitter.com/%s' % (friend.screen_name), 'homepage' : friend.url}
   
+    # TODO What if the user has *no* contacts?
+
   
   # -----------------------------------------------------------------------
   def sync_contacts(self, resync = False):
@@ -160,15 +162,32 @@ class Hermes:
         if name in self.friends:
           friend = self.friends[name]
           found = True
+          updated = False
       
           if friend['pic'] and (resync or contact.get_property('photo') is None):
-            print "Picture for %s is [%s]" % (name, friend['pic'])
-            store.set_photo(contact, friend['pic'])
-            self.updated.append(contact)
+            updated = store.set_photo(contact, friend['pic']) or updated
         
           if friend['birthday_date'] and (resync or contact.get_property('birth-date') is None):
-            print "Birthday for %s is [%s]" % (name, friend['birthday_date'])
+            date_str = friend['birthday_date'].split('/')
+            date_str.append('0')
+            updated = store.set_birthday(contact, int(date_str[1]),
+                                                  int(date_str[0]),
+                                                  int(date_str[2])) or updated
+
+          if 'profile_url' in friend and friend['profile_url']:
+            updated = store.add_url(contact, friend['profile_url'], unique='facebook.com') or updated
+            
+          if 'twitter_url' in friend and friend['twitter_url']:
+            updated = store.add_url(contact, friend['twitter_url'], unique='twitter.com') or updated
+            
+          if 'homepage' in friend and friend['homepage']:
+            updated = store.add_url(contact, friend['homepage']) or updated
     
+          if updated:
+            self.updated.append(contact)
+            addresses.commit_contact(contact)
+            print "Saved changes to [%s]" % (contact.get_name())
+            
           break
       
       if found:
diff --git a/package/src/pygobject.py b/package/src/pygobject.py
new file mode 100644 (file)
index 0000000..d095b6f
--- /dev/null
@@ -0,0 +1,156 @@
+from ctypes import *
+import sys
+import ctypes
+
+import gobject
+
+# -------------------------------------------------------------------------
+class _PyGObject_Functions(ctypes.Structure):
+    """GObject <-> Python mapping from http://faq.pygtk.org/index.py?req=show&file=faq23.041.htp"""
+    _fields_ = [
+        ('register_class',
+         ctypes.PYFUNCTYPE(ctypes.c_void_p, ctypes.c_char_p,
+                           ctypes.c_int, ctypes.py_object,
+                           ctypes.py_object)),
+        ('register_wrapper',
+         ctypes.PYFUNCTYPE(ctypes.c_void_p, ctypes.py_object)),
+        ('register_sinkfunc',
+         ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
+        ('lookupclass',
+         ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_int)),
+        ('newgobj',
+         ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
+        ]
+
+
+# -------------------------------------------------------------------------
+class PyGObjectCAPI(object):
+    """GObject <-> Python mapping from http://faq.pygtk.org/index.py?req=show&file=faq23.041.htp"""
+    
+    def __init__(self):
+        addr = ctypes.pythonapi.PyCObject_AsVoidPtr(
+            ctypes.py_object(gobject._PyGObject_API))
+        self._api = _PyGObject_Functions.from_address(addr)
+
+    def pygobject_new(self, addr):
+        return self._api.newgobj(addr)
+
+
+# -------------------------------------------------------------------------
+class GList(Structure):
+  """GList representation and convenience functions, based on Java's Iterable.
+  
+     Copyright (c) Andrew Flegg <andrew@bleb.org> 2009.
+     Released under the Artistic Licence."""
+
+
+  # -----------------------------------------------------------------------
+  @classmethod
+  def new(clazz, ptr = None):
+    """Return a reference to an empty, or valid, GList at the
+       given pointer address."""
+       
+    if ptr:
+      return cast(c_void_p(ptr), POINTER(GList)).contents
+    else:
+      return GList()
+
+
+  # -----------------------------------------------------------------------
+  _fields_ = [('_data', c_void_p),
+              ('_next', c_void_p),
+              ('_prev', c_void_p)]
+              
+  _ptr = None # Initialises to before the list for `while(has_next)...'
+
+  
+  # -----------------------------------------------------------------------
+  def reset(self):
+    """Rewind the iterable to the start of the list."""
+    
+    self._ptr = None
+    
+  # -----------------------------------------------------------------------
+  def has_next(self):
+    """Return True if the list has an item on which next can be called."""
+    
+    return (not self._ptr and self._data) or (self._ptr and self._ptr._next)
+
+
+  # -----------------------------------------------------------------------
+  def next(self, as_a = None):
+    """Move the pointer on to the next item in the list and return its value, or
+       raise an exception if already on the last."""
+       
+    if self._ptr and not self._ptr._next:
+      raise Exception("IndexOutOfBounds")
+
+    self._ptr = self._ptr and cast(self._ptr._next, POINTER(GList)).contents or self
+    if not self._ptr._data:
+      return None
+    elif as_a:
+      return cast(self._ptr._data, POINTER(as_a)).contents
+    else:
+      return self._ptr._data
+      
+      
+  # -----------------------------------------------------------------------
+  def set(self, value):
+    """Set the data in the current position in the list."""
+    
+    if not self._ptr:
+      self._ptr = self
+      
+    self._ptr._data = cast(value, c_void_p);
+    
+    
+    
+  # -----------------------------------------------------------------------
+  def add(self):
+    """Add a new entry on to the end of the list, ready to be "set"."""
+    
+    self.reset()
+    while self.has_next():
+      self.next()
+      
+    if not self._ptr:
+      self._ptr = self
+    else:      
+      new = GList()
+      new._prev = addressof(self._ptr)
+      self._ptr._next = addressof(new)
+      self._ptr = new
+
+
+# -------------------------------------------------------------------------
+class EContactPhoto_inlined(Structure):
+  _fields_ = [('mime_type', c_char_p),
+              ('length', c_uint),
+              ('data', c_void_p)]
+
+class EContactPhoto_data(Union):
+  _fields_ = [('inlined', EContactPhoto_inlined),
+              ('uri', c_char_p)]
+
+class EContactPhoto(Structure):
+  _fields_ = [('type', c_int),
+              ('data', EContactPhoto_data)]
+
+class EContactDate(Structure):
+  _fields_ = [('year', c_uint),
+              ('month', c_uint),
+              ('day', c_uint)]
+
+# -------------------------------------------------------------------------
+class EVCardAttribute(Structure):
+ _fields_ = [('group', c_char_p),
+            ('name', c_char_p),
+            ('params', POINTER(GList)),
+            ('values', POINTER(GList)),]
+            
+ def value(self):
+   if not self.values:
+     return None
+     
+   return self.values.contents
+

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment