X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Date: Sat, 2 Jan 2016 19:14:28 +0100 (CET) From: Roland Lutz To: geda-user AT delorie DOT com Subject: Re: [geda-user] What Xorn does, and why it does it like that In-Reply-To: <20160102162101.75D72809D79A@turkos.aspodata.se> Message-ID: References: <20160102162101 DOT 75D72809D79A AT turkos DOT aspodata DOT se> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 2 Jan 2016, karl AT aspodata DOT se wrote: > I would like to test xorn, I did "git pull -a" and found that > there are two xorn branches. Which one should I use ? > > $ git branch -a | grep xorn > remotes/origin/home/rlutz/xorn-integration > remotes/origin/xorn Xorn has already been merged into the master banch. The branch 'xorn' reflects the current 'master' branch of the xorn repository, and 'home/rlutz/xorn-integration' was a temporary branch which should be deleted. > And for the exercise, I have an program I'd like to implement as you > probably have seen in the mail thread of 'should we broaden scope of > libgeda': > > Given a sch file, collect all sym files to a save directory. > > So, in xorn, which bindings are available, c and python, any more ? For this program, you'll want to load a schematic file including all referenced and embedded symbol files. This means you need: * libxornstorage (a C library for which Python bindings exist) * the symbol library mechanism (a Python module called 'xorn.geda.clib') * the function 'read' from the Python module 'xorn.geda.read' Right now, you'll either have to write the program in Python or embed a Python interpreter into your C program in order to call the necessary Python functions. I'm planning to add a back-binding library so you can call the functions implemented in Python as C functions (or in any other language for which there are bindings), but I didn't find the time to do so yet. The process would be about as follows: * Add a DirectorySource for each directory to the symbol library (you might want to re-use the function 'symbol_library_search' from xorn/src/command/netlist.py). * Load the schematic while passing 'load_symbols = True' to the function 'xorn.geda.read.read'. * Iterate over all Component objects, writing the prim_objs of each unique symbol to the target directory.