www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2014/05/08/08:11:56

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Thu, 8 May 2014 14:07:14 +0200 (CEST)
From: Roland Lutz <rlutz AT hedmen DOT org>
To: geda-user AT delorie DOT com
Subject: [geda-user] Object access and manipulation library
Message-ID: <alpine.DEB.2.10.1405081406560.22756@home.local>
User-Agent: Alpine 2.10 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1399905839-1399550834=:22756
Content-Type: TEXT/PLAIN; format=flowed; charset=UTF-8
Content-Transfer-Encoding: 8BIT

Hi,

check out this new library I made:
   http://hedmen.org/xorn/xorn-0.0.tar.gz

On the surface, it's just a library to read and write gEDA files.  The 
interesting part however is that it allows different programs—e.g., Python 
scripts and a GUI application—to work on the same objects.  In an 
application that is based on Xorn, you could just run your favorite script 
in a Python console and watch the objects being moved around.  I designed 
it to work with Xi, but it should be possible to integrate it with gschem, 
too.

There is also a command-line utility with two sub-commands:
   xorn extract - extract embedded symbols or pixmaps from a schematic
   xorn find-symbol-by-pinout - pretty much self-explaining

Here is an example how a Python script using Xorn looks like:

> from xorn.geda.read import read
> from xorn.geda.write import write
> from xorn.geda.attrib import search_attached
>
> sch = read('example.sch')
>
> for ob in sch.toplevel_objects():
>     if 'R1' in search_attached(ob, 'refdes'):
>         sch.delete_object(ob)
>
> write(sch, 'example-without-R1.sch')

The API documentation is available here:
   http://hedmen.org/xorn/doc/api/html/

For a list of known bugs and issues, see:
   http://bugs.hedmen.org/?project=2

Roland

--8323329-1399905839-1399550834=:22756--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019