<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[QElectroTech — Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
		<link>https://qelectrotech.org/forum/viewtopic.php?id=1599</link>
		<atom:link href="https://qelectrotech.org/forum/extern.php?action=feed&amp;tid=1599&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python).]]></description>
		<lastBuildDate>Sun, 19 Oct 2025 16:47:10 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22208#p22208</link>
			<description><![CDATA[<p> Vielen Dank noch einmal an Volker für das Skript.&nbsp; Hier ist der aktuelle Link, der nach Rücksprache veröffentlich werden darf.</p><p><a href="https://gitlab.com/iamvohegg/qelectrotech_labels_to_file">https://gitlab.com/iamvohegg/qelectrote … ls_to_file</a> </p>]]></description>
			<author><![CDATA[null@example.com (bollweg)]]></author>
			<pubDate>Sun, 19 Oct 2025 16:47:10 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22208#p22208</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22108#p22108</link>
			<description><![CDATA[<p> Hallo,</p><p>ist das noch aktuell? Würde mich interessieren, wie das bei einem Windowsrechner aussehen muss. Wahrscheinlich muss der Pfad geändert werden? </p>]]></description>
			<author><![CDATA[null@example.com (bollweg)]]></author>
			<pubDate>Mon, 22 Sep 2025 11:34:38 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22108#p22108</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=11380#p11380</link>
			<description><![CDATA[<p> Great, <br />thanks vohegg for this vidéo Howto and Github source. <img src="https://qelectrotech.org/forum/img/smilies/nomicons/smile.png" width="20" alt="nomicons/smile" /> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sat, 14 Mar 2020 15:05:54 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=11380#p11380</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=11379#p11379</link>
			<description><![CDATA[<p> Done,<br />here a short video on what could happend....<br /><a href="https://vimeo.com/397627826">https://vimeo.com/397627826</a></p><p>For anyone can use it, you can download Elementsym_tofile.py on my Github account.<br /><a href="https://github.com/vohe/qelectrotech_labels_to_file">https://github.com/vohe/qelectrotech_labels_to_file</a></p><p>How does this work?<br />For each folder of the user - collection it is possible to set a language description. <br />So - you add a &#039;virtual&#039; language description for language &#039;sy&#039; which contains the symbols label.</p><p>This little tool fetch all the labels you set (and possible you can set the labels right in the tool)<br />After you click on the &gt;&gt;save&lt;&lt; button in the tool, it generates the qet_labels.xml file for you and after a <br />restart of qelectrotech you could use the symbols with labels.</p><p>Feel free to send me your suggestion about this</p><p>regards </p>]]></description>
			<author><![CDATA[null@example.com (vohegg)]]></author>
			<pubDate>Sat, 14 Mar 2020 14:29:57 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=11379#p11379</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=11373#p11373</link>
			<description><![CDATA[<p> Thx for your answer..</p><p>but, i&#039;m fooling around with this, there must be a better way to give Letters to the emements (-folders).<br />And i found&nbsp; a solution.<br />Give me some more hours, and i upload another piece of python code.</p><p>regards<br />Volker </p>]]></description>
			<author><![CDATA[null@example.com (vohegg)]]></author>
			<pubDate>Sat, 14 Mar 2020 08:18:42 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=11373#p11373</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=11337#p11337</link>
			<description><![CDATA[<p> Hallo vohegg,</p><p>good job, thanks. <img src="https://qelectrotech.org/forum/img/smilies/nomicons/wink.png" width="20" alt="nomicons/wink" /></p><p><a href="http://micheles.github.io/plac/">http://micheles.github.io/plac/</a> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Wed, 11 Mar 2020 21:56:00 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=11337#p11337</guid>
		</item>
		<item>
			<title><![CDATA[Re: Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=11336#p11336</link>
			<description><![CDATA[<p> Beispiel:<br />Mein Verzeichnis sieht so aus (find&nbsp; /home/user/.qet/elements * -type d )<br /></p><div class="codebox"><pre><code>/home/user/.qet/elements
/home/user/.qet/elements/hersteller
/home/user/.qet/elements/hersteller/eltako   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;K&#039; abgespeichert
/home/user/.qet/elements/netzwerk
/home/user/.qet/elements/netzwerk/netze
/home/user/.qet/elements/netzwerk/telefonie
/home/user/.qet/elements/netzwerk/wlan
/home/user/.qet/elements/10_elektrik
/home/user/.qet/elements/10_elektrik/ueberspannung  # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;F&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/schutzschalter   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt Q&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/netze   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;E&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/adern   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;W&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/kontakte   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;S&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/installation   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;X&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/klemmen   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;X&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/sicherungen   # hier habe ich eine Textdatei tagfile.txt mit dem Inhalt &#039;F&#039; abgespeichert
/home/user/.qet/elements/10_elektrik/netzwerk
/home/user/.qet/elements/10_elektrik/verweise
/home/user/.qet/elements/10_elektrik/potentialausgleich</code></pre></div><p>Aufruf mit :python3 qelectrotech_element.py<br />(benötigt plac : also vielleicht vorher noch ein:&nbsp; pip3 install plac)</p><p>dann entsteht die Datei demo.xml mit folgendem Inhalt:<br /></p><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;labels&gt;
&lt;category name=&quot;&quot;&gt;
   &lt;category name=&quot;hersteller&quot;&gt;
      &lt;category name=&quot;eltako&quot;&gt;
         &lt;prefix&gt;K&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;prefix&gt;&lt;/prefix&gt;
   &lt;/category&gt;
      
   &lt;category name=&quot;netzwerk&quot;&gt;
      &lt;category name=&quot;netze&quot;&gt;
         &lt;prefix&gt;&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;telefonie&quot;&gt;
         &lt;prefix&gt;&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;wlan&quot;&gt;
         &lt;prefix&gt;&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;prefix&gt;&lt;/prefix&gt;
   &lt;/category&gt;
      
   &lt;category name=&quot;10_elektrik&quot;&gt;
      &lt;category name=&quot;ueberspannung&quot;&gt;
         &lt;prefix&gt;F&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;schutzschalter&quot;&gt;
         &lt;prefix&gt;Q&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;netze&quot;&gt;
         &lt;prefix&gt;E&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;adern&quot;&gt;
         &lt;prefix&gt;W&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;kontakte&quot;&gt;
         &lt;prefix&gt;S&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;installation&quot;&gt;
         &lt;prefix&gt;X&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;klemmen&quot;&gt;
         &lt;prefix&gt;X&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;sicherungen&quot;&gt;
         &lt;prefix&gt;F&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;netzwerk&quot;&gt;
         &lt;prefix&gt;&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;verweise&quot;&gt;
         &lt;prefix&gt;&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;category name=&quot;potentialausgleich&quot;&gt;
         &lt;prefix&gt;&lt;/prefix&gt;
      &lt;/category&gt;
         
      &lt;prefix&gt;&lt;/prefix&gt;
   &lt;/category&gt;
      
   &lt;prefix&gt;&lt;/prefix&gt;
&lt;/category&gt;

&lt;/labels&gt;</code></pre></div><p> </p>]]></description>
			<author><![CDATA[null@example.com (vohegg)]]></author>
			<pubDate>Wed, 11 Mar 2020 21:38:10 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=11336#p11336</guid>
		</item>
		<item>
			<title><![CDATA[Kennzeichnung - der eigenen Bauteilsammlung - ein Tool (in Python)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=11335#p11335</link>
			<description><![CDATA[<p> Hallo,<br />Da mich die Bauteilekennzeichnung für meine eigenen Bauteil richtig nervt, habe ich die Prozedur jetzt automatisiert.<br />Es ist ja so das sich im Ordner der eigenen Bauteile (/home/user/.qet/elements ist das unter linux) die Datei qet_labels.xml befindet.<br />In dieser sind alle Unterordner aufgelistet und wenn es für die Ordner Bauteilekennzeichen geben soll, dann sind diese mit dem &lt;prefix&gt;&lt;/prefix&gt; Tag dort einzusetzen.<br />Es ist aber bei einer größeren Ordnerstruktur sehr mühsehlig, das Fehlerfrei einzugeben. Daher ein kleines Python&nbsp; skript,&nbsp; das im Verzeichnis /home/user/ die Datei Demo.xml anlegt, in der alle Unterordner schon eingetragen sind und ebenfalls ein das Prefix Tag.<br />Befindet sich in einem der Unterordner eine Datei mit dem Namen tagfile.txt wird deren erster Buchstabe als Prefix für die Dateien in diesem Ordner gesetzt.</p><p>Das ganze beschränkt sich also darauf, einen neuen Ordner in der Benutzersammlung zu erstellen (mit qelectrotech) und dann dort eine (Text-) Datei tagfile.txt (mit einem Editor) anzulegen, die einen Buchstaben enthält der für alle enthaltenen Dateien als Prefix gelten soll.<br />Danach wird das kleine Script hier gestartet und es entsteht eine Demo.xml Datei im Home Verzeichnis. Diese kann man kontrollieren und/oder in den Ordner /home/user/.qet/elements/ als qet_lables.xml kopieren.</p><div class="codebox"><pre><code>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# we saw thislike file structure
__author__ = &quot;Volker Heggemann, Melle, DE&quot;
__copyright__ = &quot;Copyright (C) 2020 Volker Heggemann&quot;
__license__ = &quot;CC BY 3.0 DE&quot;
__version__ = &quot;1.0&quot;

import os
from xml.sax.saxutils import quoteattr as xml_quoteattr

def make_xmlfile(path):

    #recursive function
    def DirAsLessXML(path):
        result = &#039;&lt;category name=%s&gt;\n&#039; % xml_quoteattr(os.path.basename(path))
        prefix = &#039;&#039;
        for item in os.listdir(path):
            itempath = os.path.join(path, item)
            if os.path.isdir(itempath):
                result += &#039;\n&#039;.join(&#039;   &#039; + line for line in
                                    DirAsLessXML(os.path.join(path, item)).split(&#039;\n&#039;))
                result += &#039;   \n&#039;
            elif os.path.isfile(itempath):
                if item == &#039;tagfile.txt&#039;:
                    x = open(itempath, &#039;r&#039;)
                    prefix = x.read(1)
            #     pass
            #     #result += &#039;  &lt;file name=%s /&gt;\n&#039; % xml_quoteattr(item)

        result += &#039;   &lt;prefix&gt;&#039; + prefix + &#039;&lt;/prefix&gt;\n&#039;
        result += &#039;&lt;/category&gt;\n&#039;
        return result

    xmltxtfile = &#039;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n&lt;labels&gt;\n&#039; + DirAsLessXML(path) + &#039;\n&lt;/labels&gt;&#039;
    return xmltxtfile


def main(inpath=&#039;&#039;, outfile=&#039;demo.xml&#039;, show=True):
    &quot;&quot;&quot; Main program &quot;&quot;&quot;
    if inpath == &#039;&#039;:
        inpath = os.path.expanduser(&#039;~&#039;)
    lookpath = inpath + &#039;/.qet/elements/&#039;
    outstr = make_xmlfile(lookpath)

    f = open(inpath + os.path.sep + outfile, &quot;w+&quot;)
    f.write(outstr)
    if show:
        print(outstr)

if __name__ == &#039;__main__&#039;:
    import plac
    plac.call(main)</code></pre></div><p> </p>]]></description>
			<author><![CDATA[null@example.com (vohegg)]]></author>
			<pubDate>Wed, 11 Mar 2020 21:18:44 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=11335#p11335</guid>
		</item>
	</channel>
</rss>
