From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1FJdhB-0005X3-Hs for garchives@archives.gentoo.org; Wed, 15 Mar 2006 21:38:17 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5.20060308/8.13.5) with SMTP id k2FLbAiq002018; Wed, 15 Mar 2006 21:37:10 GMT Received: from mail01.emarketsouth.com (mail01.emarketsouth.com [208.247.233.6]) by robin.gentoo.org (8.13.5.20060308/8.13.5) with SMTP id k2FLb8vS012497 for ; Wed, 15 Mar 2006 21:37:09 GMT Received: (qmail 13549 invoked by uid 399); 15 Mar 2006 21:38:47 -0000 Received: from unknown (HELO onyx) (64.192.54.4) by mail01.emarketsouth.com with SMTP; 15 Mar 2006 21:38:47 -0000 Subject: Re: portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI) From: solar To: gentoo-portage-dev@lists.gentoo.org In-Reply-To: <20060315214248.5ef51202@c1358217.kevquinn.com> References: <4416DEAF.30008@gentoo.org> <200603151051.32777.pauldv@gentoo.org> <1142434334.25069.110.camel@onyx> <20060315214248.5ef51202@c1358217.kevquinn.com> Content-Type: text/plain Organization: Gentoo Linux Date: Wed, 15 Mar 2006 16:37:05 -0500 Message-Id: <1142458625.10619.131.camel@onyx> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 Content-Transfer-Encoding: 7bit X-Archives-Salt: 2d337b50-b8a0-4991-9d4f-ed23ee02c81a X-Archives-Hash: defe82cb3e08e06e2f0bb2af130e76b0 On Wed, 2006-03-15 at 21:42 +0100, Kevin F. Quinn (Gentoo) wrote: > On Wed, 15 Mar 2006 09:52:13 -0500 > solar wrote: > > > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote: > > > > [snip] > > > > > Actually, C++ being strongly related to C, can just use the C > > > python api's. As such it could directly interface with python, and > > > use the python portage api. > > > > If you could demonstrate an 'import portage' and a simple > > printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested. > > Try attached :) Had a go 'coz I was curious. Compile with: > > gcc -o getportdir getportdir.c -lpython2.4 > > Does the equivalent of: > > #!/usr/bin/portage > import portage; > print portage.settings["PORTDIR"]; > > (more or less). Docs on the API itself (which comes with Python) are at > http://docs.python.org/api/api.html thanks Kevin, marienz also put 3 examples together to demonstrate it. /me feels like a kid in a candy store. thanks guys. -- solar Gentoo Linux -- gentoo-portage-dev@gentoo.org mailing list