[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: tragesym
User: werner
Date: 06/05/17 13:13:46
Modified: . tragesym
Log:
added OOo template, accept tab as option delimiter
Revision Changes Path
1.6 +11 -2 eda/geda/devel/utils/scripts/tragesym
(In the diff below, changes in quantity of whitespace are not shown.)
Index: tragesym
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/utils/scripts/tragesym,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- tragesym 26 Mar 2006 10:47:35 -0000 1.5
+++ tragesym 17 May 2006 17:13:46 -0000 1.6
@@ -101,6 +101,15 @@
str="pas"
return str
+## split a string at the first tab or equal char
+def split_tab_equal(str,n=1):
+ list_tab=string.split(str,'\t',n)
+ list_equal=string.split(str,'=',n)
+ if len(list_tab[0]) < len(list_equal[0]):
+ return list_tab
+ else:
+ return list_equal
+
## returns 2 dicts: (options, attr) and 2 arrays: (devices, pins)
def readsrc(filename):
geda_attr={}
@@ -119,11 +128,11 @@
or len(string.strip(line)) == 0: # comment, empty line or no section
continue
if section=="options":
- element=string.split(line,"=",1)
+ element=split_tab_equal(line,1)
if len(element) > 1:
options[string.strip(element[0])]=string.strip(element[1])
elif section=="geda_attr":
- element=string.split(line,"=",1)
+ element=split_tab_equal(line,1)
nr=1
while geda_attr.has_key((element[0],nr)):
nr=nr+1