From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Crotti Subject: Re: [Org-contacts] 3 2 1 go? Date: Sun, 06 Mar 2011 08:31:00 +0100 Message-ID: References: <87pqq5dkf6.fsf@phenom.fritz.box> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=47843 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pw8Ql-0006pl-8v for emacs-orgmode@gnu.org; Sun, 06 Mar 2011 02:31:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pw8Qk-0004BO-3Y for emacs-orgmode@gnu.org; Sun, 06 Mar 2011 02:31:07 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:39546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pw8Qj-0004BI-T4 for emacs-orgmode@gnu.org; Sun, 06 Mar 2011 02:31:06 -0500 Received: by bwz17 with SMTP id 17so3561276bwz.0 for ; Sat, 05 Mar 2011 23:31:04 -0800 (PST) In-Reply-To: <87pqq5dkf6.fsf@phenom.fritz.box> ("Michael =?utf-8?Q?K=C3=A4?= =?utf-8?Q?ufl=22's?= message of "Sun, 06 Mar 2011 03:58:37 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael =?utf-8?Q?K=C3=A4ufl?= Cc: emacs-orgmode@gnu.org Michael K=C3=A4ufl writes: > No it's not. As you can see here [1], Julien Danjou has already started > to inlucde more features. For now org-contacts supportes mail addresses > and irc nicknames. And I'm sure a lot more will follow. > Good to know :) So I think I will avoid trying BBDB after all, I can start with this alread= y. I have a first thing working well enough for the translation, I use contacts to get the fields: http://gnufoo.org/contacts/contacts.html It's very stupid now since it only takes one email and no other fields, but it's ready for enhancements. Anyway it=20 --8<---------------cut here---------------start------------->8--- #!/usr/bin/env python """ Get the contacts with http://gnufoo.org/contacts/contacts.html and print out a org-contacts valid output """ import subprocess FMT =3D [("first name", "fn"), ("last name", "ln"), ("home mail", "he"), ("work mail", "we"), ("other mail", "oe"), ("birthday", "b")] cmd =3D "contacts -H -S -f '%s'" % (';'.join('%' + x[1] for x in FMT)) proc =3D subprocess.Popen(cmd, shell=3DTrue, stdout=3Dsubprocess.PIPE) out, err =3D proc.communicate() org_contact_template =3D """* %s :PROPERTIES: :EMAIL: %s :END: """ for line in out.splitlines(): s =3D line.split(';') if s[2]: print org_contact_template % (' '.join((s[0], s[1])), s[2]) --8<---------------cut here---------------end--------------->8---