Re: gEDA-user: Using tragesym with Emacs org-mode tables almost successful

2008-07-18 Thread Werner Hoch
Hi there,

On Dienstag, 15. Juli 2008, Csányi Pál wrote:
 I tried to use tragesym with my favorite text editor Emacs.
 I'm using org-mode in Emacs in which one can to create tables.

 So I edited the tragesym template.src and made in it the tables for
 [options], [geda_attr] and [pins]. I saved the file as template.org .

 I fill the tables with approppriate values and saved it as
 dual_pho_tran_optocoupler.org .

 I send these tables in the same file to tab-separated lines.

 Finally I run tragesym on this file:

 tragesym dual_pho_tran_optocoupler.org dual_pho_tran_optocoupler.sch

 and I get an error message:

 Traceback (most recent call last):
   File /usr/local/geda-0.0.2/bin/.scripts/tragesym.py, line 586, in
 module opts,attr,pins=readsrc(file_in)
   File /usr/local/geda-0.0.2/bin/.scripts/tragesym.py, line 143, in
 readsrc
 geda_attr[(string.strip(element[0]),nr)]=string.strip(element[1])
 IndexError: list index out of range

You had lines in the attribute section that had only 1 element.
The elements are splitted either with the equal sign = or TAB.
If you look at one of your lines:

| version   | 20080127 1  |
| name  | MCT6|

There's no tragesym seperator in it.

 I half solve the problem so so I edited again the template.org file
 and hash the beginning of the lines at on tables, the [geda_attr]
 tables. I send then again this table to tab-separated lines in the
 same file. Now I get the dual_pho_tran_optocoupler.sch file without a
 problem.

 Why get I this error message?

Your files contains lines that are not part of the file format 
description. The org tables start with | and have no field delimiter.

If you like to use the org tables you've to mark them as comments (for 
tragesym) and prefix them with #.

Regards
Werner


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Using tragesym with Emacs org-mode tables almost successful

2008-07-18 Thread Csányi Pál
Werner Hoch [EMAIL PROTECTED] writes:

Hi,

 Hi there,

 On Dienstag, 15. Juli 2008, Csányi Pál wrote:

 I tried to use tragesym with my favorite text editor Emacs.
 I'm using org-mode in Emacs in which one can to create tables.

 and I get an error message:

 Traceback (most recent call last):
   File /usr/local/geda-0.0.2/bin/.scripts/tragesym.py, line 586, in
 module opts,attr,pins=readsrc(file_in)
   File /usr/local/geda-0.0.2/bin/.scripts/tragesym.py, line 143, in
 readsrc
 geda_attr[(string.strip(element[0]),nr)]=string.strip(element[1])
 IndexError: list index out of range

 You had lines in the attribute section that had only 1 element.
 The elements are splitted either with the equal sign = or TAB.
 If you look at one of your lines:
 
 | version   | 20080127 1  |
 | name  | MCT6|
 
 There's no tragesym seperator in it.

OK It's clear for me now.

 Your files contains lines that are not part of the file format 
 description. The org tables start with | and have no field delimiter.

OK

 If you like to use the org tables you've to mark them as comments (for 
 tragesym) and prefix them with #.

Yes, but then I can't to use it in org-mode as org-table! :(

However I find the solution! :)

I edit the tragesym.py file at line 130 and 131:

elif section== or line[0]==# or line[0]==|  \ 

or len(string.strip(line)) == 0: # comment, empty line, org-table or no section

so now the tragesym do its job well! :)

I wish that that this small 'patch' shall to be in the official
tragesym.py too, if it is possible! :) 

What do you think about it?

-- 
Regards, Paul Csanyi
http://www.freewebs.com/csanyi-pal/index.htm



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user