Mail Archives: geda-user/2011/12/01/10:04:01
--0016364183adc4a35104b3092595
Content-Type: multipart/alternative; boundary=0016364183adc4a34904b3092593
--0016364183adc4a34904b3092593
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi Karl,
your script looks good but you have to manage the growing of the gafrc file=
.
Following your way, i'm making the scheme in attachment.
Now the needed lines to start the guile script from gafrc are only as
follow:
;
(define geda-rchome-path (build-path (getenv "HOME") ".gEDA"))
(load (build-path geda-rchome-path "local-symbols-library.scm"))
;
;
(component-library-add-tree "personal" "/usr/local/share/symbols")
;
;
At this point the folder name will be used as description in the tree:
+Generic\ capacitors/
cap-1.sym
+AVX\ Capacitors/
idc.sym
I notice an interesting feature if the subfolders are named like:
Generic\ capacitors/
Generic\ capacitors - AVX/
Generic\ capacitors - AVX - IDC/
The items will be displayed sequentially in the tree.
Regards,
Luigi
On Wed, Nov 30, 2011 at 10:10 PM, Karl Hammar <karl AT aspodata DOT se> wrote:
> Luigi:
> ...
> > The procedure in attachment is composed by a bash script and a guile
> > script.
> ...
>
> ///////
> Attachment "build-local-symbols-list":
>
> SYMPATH=3D"/usr/local/share/symbols"
> SYMSUB=3D"personal/"
> cd $SYMPATH ; echo > local-symbols-list ;
> IFS=3D$'\n'
>
> You could do (in case you don't have a .desc in every directory):
>
> for file in `find dir -name .desc -type f`; do
> d=3D`dirname $file`
> desc=3D`cat $file`
> ...
>
>
> for d in `find ./$SYMSUB -type d` ; do
> desc=3D"`cat $d/.desc`"
> echo "$d" >> local-symbols-list
> echo "$desc" >> local-symbols-list
> done
>
> echo "Coping local-symbols-list to ~/.gEDA folder..."
> cp local-symbols-list ~/.gEDA/
>
> ///////
> Attachment "README":
>
> cd my-symbols-path ; mkdir personal ;
> mv * personal
> cp build-local-symbols-list my-symbols-path
>
> # for each path in personal:
> echo "One Line Description" > .desc
>
> ------------------------------------------------------------------
> Examples path:
> capacitors/
> .desc <--onelinecontent-- "Generic capacitors"
> cap-1.sym
> avx/
> .desc <--onelinecontent- "AVX Capacitors"
> idc.sym
>
>
> become -->
>
> geda symbols tree+
> >capacitors Generic capacitors
> cap-1.sym
> >avx AVX Capacitors
> idc.sym
>
> Why do you have a .desc file when you could as easily use the
> directory name as the description. E.g. why don't you instead use:
>
> Examples path:
> Generic\ capacitors/
> cap-1.sym
> AVX\ Capacitors/
> idc.sym
>
> Why use a file (.desc) when you can store it directly in the directory
> structure, and if you instead use the directory name as description,
> you can use the attached script.
>
> ///////
>
> Overall it seems you build a file "local-symbols-list" with the
> shell script "build-local-symbols-list", then you process that list
> with the scheme script "local-symbols-library.scm".
>
> Wouldn't it be great if you didn't have to run the shell script, if
> the scheme script took care about that part? So you could use:
>
> (component-library-add-tree "cvs" "${HOME}/Net/cvs/
> cvs.gedasymbols.org/www/user")
>
> or
>
> (component-library-add-tree "personal" "/usr/local/share/symbols")
>
> in your .gEDA/gafrc file, and it swalloped the whole tree.
>
> If you write such a script, I'll be happy to test it.
>
> Regards,
> /Karl Hammar
>
> -----------------------------------------------------------------------
> Asp=F6 Data
> Lilla Asp=F6 148
> S-742 94 =D6sthammar
> Sweden
> +46 173 140 57
>
>
--0016364183adc4a34904b3092593
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi Karl,<br>your script looks good but you have to manage the growing of th=
e gafrc file.<br>Following your way, i'm making the scheme in attachmen=
t.<br>Now the needed lines to start the guile script from gafrc are only as=
follow:<br>
;<br>(define geda-rchome-path (build-path (getenv "HOME") ".=
gEDA"))<br>(load (build-path geda-rchome-path "local-symbols-libr=
ary.scm"))<br>;<br>;<br>(component-library-add-tree "personal&quo=
t; "/usr/local/share/symbols")<br>
;<br>;<br><br>At this point the folder name will be used as description in =
the tree:<br><br>+Generic\ capacitors/<br>=A0=A0=A0=A0=A0=A0=A0=A0 cap-1.sy=
m<br>=A0+AVX\ Capacitors/<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0 idc.sym<br><br>I notice an interesting feature if the subfolders are na=
med like:<br>
Generic\ capacitors/<br>=A0=A0=A0 Generic\ capacitors - AVX/<br>=A0=A0=A0=
=A0=A0=A0=A0 Generic\ capacitors - AVX - IDC/<br><br>The items will be disp=
layed sequentially in the tree.<br><br><br>Regards,<br>Luigi<br><br><br><br=
><br><div class=3D"gmail_quote">
On Wed, Nov 30, 2011 at 10:10 PM, Karl Hammar <span dir=3D"ltr"><<a href=
=3D"mailto:karl AT aspodata DOT se">karl AT aspodata DOT se</a>></span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex;">
Luigi:<br>
...<br>
<div class=3D"im">> The procedure in attachment is composed by a bash sc=
ript and a guile<br>
> script.<br>
</div>...<br>
<br>
///////<br>
Attachment "build-local-symbols-list":<br>
<br>
=A0SYMPATH=3D"/usr/local/share/symbols"<br>
=A0SYMSUB=3D"personal/"<br>
=A0cd $SYMPATH ; echo > local-symbols-list ;<br>
=A0IFS=3D$'\n'<br>
<br>
You could do (in case you don't have a .desc in every directory):<br>
<br>
for file in `find dir -name .desc -type f`; do<br>
=A0 d=3D`dirname $file`<br>
=A0 desc=3D`cat $file`<br>
...<br>
<br>
<br>
=A0for d in `find ./$SYMSUB -type d` ; do<br>
=A0 =A0 =A0 =A0 =A0desc=3D"`cat $d/.desc`"<br>
=A0 =A0 =A0 =A0 =A0echo "$d" >> local-symbols-list<br>
=A0 =A0 =A0 =A0 =A0echo "$desc" >> local-symbols-list<br>
=A0done<br>
<br>
=A0echo "Coping local-symbols-list to ~/.gEDA folder..."<br>
=A0cp local-symbols-list =A0~/.gEDA/<br>
<br>
///////<br>
Attachment "README":<br>
<br>
=A0cd my-symbols-path ; mkdir personal ;<br>
=A0mv * personal<br>
=A0cp build-local-symbols-list my-symbols-path<br>
<br>
=A0# for each path in personal:<br>
=A0echo "One Line Description" > .desc<br>
<br>
=A0------------------------------------------------------------------<br>
=A0Examples path:<br>
=A0capacitors/<br>
=A0 =A0 =A0 =A0 =A0.desc <--onelinecontent-- "Generic capacitors&q=
uot;<br>
=A0 =A0 =A0 =A0 =A0cap-1.sym<br>
=A0 =A0 =A0 =A0 =A0avx/<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.desc <--onelinecontent- "AVX C=
apacitors"<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0idc.sym<br>
<br>
<br>
=A0become --><br>
<br>
=A0geda symbols tree+<br>
=A0 =A0 =A0 =A0 =A0>capacitors Generic capacitors<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cap-1.sym<br>
=A0 =A0 =A0 =A0 =A0>avx AVX Capacitors<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0idc.sym<br>
<br>
Why do you have a .desc file when you could as easily use the<br>
directory name as the description. E.g. why don't you instead use:<br>
<br>
=A0Examples path:<br>
=A0Generic\ capacitors/<br>
=A0 =A0 =A0 =A0 =A0cap-1.sym<br>
=A0 =A0 =A0 =A0 =A0AVX\ Capacitors/<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0idc.sym<br>
<br>
Why use a file (.desc) when you can store it directly in the directory<br>
structure, and if you instead use the directory name as description,<br>
you can use the attached script.<br>
<br>
///////<br>
<br>
Overall it seems you build a file "local-symbols-list" with the<b=
r>
shell script "build-local-symbols-list", then you process that li=
st<br>
with the scheme script "local-symbols-library.scm".<br>
<br>
Wouldn't it be great if you didn't have to run the shell script, if=
<br>
the scheme script took care about that part? So you could use:<br>
<br>
(component-library-add-tree "cvs" "${HOME}/Net/cvs/<a href=
=3D"http://cvs.gedasymbols.org/www/user" target=3D"_blank">cvs.gedasymbols.=
org/www/user</a>")<br>
<br>
=A0or<br>
<br>
(component-library-add-tree "personal" "/usr/local/share/sym=
bols")<br>
<br>
in your .gEDA/gafrc file, and it swalloped the whole tree.<br>
<br>
If you write such a script, I'll be happy to test it.<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
Regards,<br>
/Karl Hammar<br>
<br>
-----------------------------------------------------------------------<br>
Asp=F6 Data<br>
Lilla Asp=F6 148<br>
S-742 94 =D6sthammar<br>
Sweden<br>
<a href=3D"tel:%2B46%20173%20140%2057" value=3D"+4617314057">+46 173 140 57=
</a><br>
<br>
</div></div></blockquote></div><br>
--0016364183adc4a34904b3092593--
--0016364183adc4a35104b3092595
Content-Type: text/x-scheme; charset=US-ASCII; name="local-symbols-library.scm"
Content-Disposition: attachment; filename="local-symbols-library.scm"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gvnw7x9z1
OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IC0qLVNjaGVtZS0qLQo7ICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2Fu
IHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5CjsgICAgaXQgdW5kZXIgdGhlIHRlcm1zIG9m
IHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkKOyAgICB0aGUg
RnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBlaXRoZXIgdmVyc2lvbiAzIG9mIHRoZSBMaWNlbnNl
LCBvcgo7ICAgIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCjsKOyAgICBUaGlz
IHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1
bCwKOyAgICBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGll
ZCB3YXJyYW50eSBvZgo7ICAgIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJ
Q1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUKOyAg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gICAgKGFwcGVuZCBm
b2xkZXJsaXN0CiAgICAgICAgICAgICAgICAgICAgICAgIChsaXN0IChsaXN0IGZpbGVuYW1lIChj
YXIgKHJldmVyc2UgKHN0cmluZy1zcGxpdCBmaWxlbmFtZSAjXC8pKSkpKSkpCiAgICAgICAgICAg
ICAgICAgICAgICAgICkpCiAgICAgICAgICAgICAgICAoZXE/ICN0ICN0KSkKKQooZGVmaW5lIGNv
bXBvbmVudC1saWJyYXJ5LWFkZC10cmVlCgkobGFtYmRhIChzdWJmb2xkZXIgbWFpbmZvbGRlcikK
CQk7IEJ1aWxkaW5nIHRoZSBsaXN0IG9mIGZvbGRlcnMKICAgICAgICAJKGZ0dyAoYnVpbGQtcGF0
aCBtYWluZm9sZGVyIHN1YmZvbGRlcikgYnVpbGQtc3ltYm9scy1saXN0KQoJKGZvci1lYWNoCgkJ
KGxhbWJkYSAoZGlyKQoJCQkoY29tcG9uZW50LWxpYnJhcnkgKGJ1aWxkLXBhdGggKGNhciBkaXIp
KSAoY2FkciBkaXIpKSkKCSBmb2xkZXJsaXN0KQoJKQopCgo=
--0016364183adc4a35104b3092595--
- Raw text -