Mail Archives: geda-user/2016/01/02/13:14:40
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.
- Raw text -