Re: gmail plugin: display all contact data -- integrate patch?



2011/1/27 Karol Będkowski <karol bedkowski gmail com>:
>
> Hello,
>
> 2011-01-27 15:24:50 "Adi J. Sieker" <adi sieker info>:
>>On 23/01/11 20:04, Karol Be;dkowski wrote:
>>> So, if you replace GoogleContact(EmailContact) with
>>> GoogleContact(Leaf) this brake whole grouping for contacts from
>>> gmail (this leaves can't (shouldn't) be grouped).
>>>
>>I did replace GoogleContact(EmailContact) with GoogleContact(Leaf).
>
> As I said, drop EmailContact as a superclass for GoogleContact break
> whole grouping for this leaves, so you shouldn't do this.
>
>>What I now do is I use the EmailContact with the email and as the name
>>Is pass the label from google i.e. 'Home email' or 'Work email'. This
>>means I have around a 100 or so EmailContact instances which have the
>>grouped_slots NAME set to 'Work email'.
>
> For keeping email, this should work ok:
>
> EMAIL_TYPE_KEY = "KEY_EMAIL_TYPE"
>
> class GoogleContact(EmailContact):
>        def __init__(self, email, name, image, email_type):
>                EmailContact.__init__(self, email, name)
>                self.image = image
>                self.object[EMAIL_TYPE_KEY] = email
>
>        def get_description(self):
>                return '%s: %s' % (self.object[EMAIL_TYPE_KEY],
>                self.object[EMAIL_KEY])
>
> Of course, for grouping all leaves for particular contacts all leaves
> should have the same "name".
> Maybe type of email should be added directly to the EmailContact class.
I just want to summarize it to make sure I understand everything.

GoogleContact should be a EmailContact (inherited) with an image an an
additional 'type' (or the type should be part of EmailContact). By
inheriting from EmailContact the 'email actions' are valid for
GoogleContact as well.

Because Google's contacts offer much more than just email the gmail
plugin should also create leafs like

  PhoneContact(ContactLeaf) - for all home/fax/work phone numbers
  SmailContact(ContactLeaf) - for work/home/other addresses
  IMContact(ContactLeaf) - for IM contacts,

or use the already existing ContactLeafs in obj/contacts.py. By using
the same 'name' the different contacts get grouped. Right?

Does this mean that get_contacts() in the gmail plugin should create
different ContactLeafs (Phone*, IM*, etc) and return these to the
GoogleContactsSource?


Btw: I think a more appropriate name for GoogleContact would be
GoogleEmailContact. GoogleContact rathe sounts like something that
contains all the google contact data. So I'm suggesting a rename.


I'm really excited to see this plugin making progress!
 Stefan
>
>> From your explanation I would expect to have a Leaf in my index
>> called 'Work email' which I can navigate into have all the work
>> emails of my contacts listed. This is not the case. If I activate
>> kupfer and type work email I just get a the option to large type the
>> text.
>
> After this, you should have one leaf for each contact "name". When some
> contact have two or more addresses, they will be visible as sub-leaves.
>
>>> class ContactDetails (ContactLeaf):
>>> [...]
>>> And use this to keep additional information (yield this objects in
>>> source). I check this for simple example and seems to work ok. Of
>>> course this class may be extended or maybe there should be separate
>>> class for phones, addresses etc.
>>This is basically what I have been thinking of doing, wafter reading
>>your mail.
>
> I thinking about this and I almost sure, that we should have something
> like:
> PhoneContact(ContactLeaf) - for all home/fax/work phone numbers
> SmailContact(ContactLeaf) - for work/home/other addresses
> IMContact(ContactLeaf) - for IM contacts, but for existing (Jabber,
> Skype) you should use already created classes.
>
> Regards,
> Karol
>
> _______________________________________________
> kupfer-list mailing list
> kupfer-list gnome org
> http://mail.gnome.org/mailman/listinfo/kupfer-list
>
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]