Import VCF contacts into Paroli
Rui Miguel Silva Seabra
rms at 1407.org
Fri Jun 12 15:20:21 CEST 2009
Hi,
Thanks for the information.
I just wanted to import all those contacts and as such I needed something
that works. Fortunately it was easy enough to hack that existing script.
I know practically zero of Python, I'm more of a C or Perl guy :)
so integrating with paroli-settings or whatever is probably not gonna happen
from me, sadly :(
Rui
On Fri, Jun 12, 2009 at 01:08:04PM +0200, Laszlo KREKACS wrote:
> On Fri, Jun 12, 2009 at 9:14 AM, Rui Miguel Silva Seabra<rms at 1407.org> wrote:
> > Hi,
> >
> > I fixed a python script that imports VCF files into Paroli.
> >
> > I'd like to make it do a better job, but I'd need Paroli's
> > contacts DB structure, Mirko, do you have a description somewhere?
>
>
> Paroli Contacts format is cPickle. I think you use the same in your script.
>
> The actual saving happens in paroli-core/tichy/persistance.py:61
> def save(self, data):
> ....
> file = self._open('w')
> pickle.dump(data, file, pickle.HIGHEST_PROTOCOL
>
> Its just a dump of cPickle module.
>
>
> The question is, how data is prepared. The data (to be saved) is prepared at
> paroli-services/phone/contact.py:251
> def save(cls):
> """Save all the phone contacts"""
> logger.info("Saving phone contacts")
> contacts = tichy.Service.get('Contacts').contacts
> data = [c.to_dict() for c in contacts if isinstance(c, PhoneContact)]
> tichy.Persistance('contacts/phone').save(data)
> yield None
>
> Now the question is what is "c" and where is the to_dict() method:
> The to_dict() method is at contact.py:212, and the c is a Contact
> instance of Contact class (line 140).
>
> So if you place some print here and there it should reveal anything you want
> to know. For developing paroli (how to set up), please see this wiki page:
> http://wiki.openmoko.org/wiki/Paroli-developer-setup
>
> Hope it helps. If you have any question or want to discuss more, please
> drop in #paroli channel, we are usually there.
>
> We could also integrate this import thingy in paroli->settings application.
> So if you are persevering enough, everyone will benefit from it;)
>
> And we are exploring opimd integration, once it is stable enough,
> it is likely paroli contacts will be migrated over. So integrating this
> vcf importer is required at some stage anyway.
>
> I urge you to start contributing to paroli!;)
>
> Laszlo
>
> ps: Maybe Mirko can add a bit more info. But he is very busy these days
> with his personal life. I hope the dust will settle really soon.
>
> _______________________________________________
> Openmoko community mailing list
> community at lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
--
More information about the community
mailing list