<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">---------- Messaggio inoltrato ----------<br>From: Richard Dale &lt;<a href="mailto:richard.j.dale@gmail.com">richard.j.dale@gmail.com</a>&gt;<br>
To: <a href="mailto:plasma-devel@kde.org">plasma-devel@kde.org</a><br>Date: Fri, 12 Feb 2010 23:59:06 +0000<br>Subject: Re: Subject: Re: [PATCH] Support for arbitrary main script names in Python plasmoids<br>On Fri, Feb 12, 2010 at 10:17 AM, Richard Dale &lt;<a href="mailto:richard.j.dale@gmail.com">richard.j.dale@gmail.com</a>&gt; wrote:<br>

&gt; On Thu, Feb 11, 2010 at 11:34 PM, Diego Casella ([Po]lentino)<br>
&gt; &lt;<a href="mailto:polentino911@gmail.com">polentino911@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; ---------- Messaggio inoltrato ----------<br>
&gt;&gt;&gt; From: Richard Dale &lt;<a href="mailto:richard.j.dale@gmail.com">richard.j.dale@gmail.com</a>&gt;<br>
&gt;&gt;&gt; To: <a href="mailto:plasma-devel@kde.org">plasma-devel@kde.org</a><br>
&gt;&gt;&gt; Date: Thu, 11 Feb 2010 18:37:55 +0000<br>
&gt;&gt;&gt; Subject: Re: [PATCH] Support for arbitrary main script names in Python<br>
&gt;&gt;&gt; plasmoids<br>
&gt;&gt;&gt; On Thu, Feb 11, 2010 at 6:02 PM, Luca Beltrame &lt;<a href="mailto:einar@heavensinferno.net">einar@heavensinferno.net</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt; &gt; Hello,<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; currently if you use Python plasmoids the main script *must* be named<br>
&gt;&gt;&gt; &gt; &quot;main.py&quot; because it is hardcoded into pyappletscripts.py. When using a<br>
&gt;&gt;&gt; &gt; different mainscript in the .desktop file (like Plasmate does) this will<br>
&gt;&gt;&gt; &gt; ensure the plasmoid will not run (you get a NameError exception).<br>
&gt;&gt;&gt; Well currently in Plasmate there is not way to specifiy the main<br>
&gt;&gt;&gt; script (or main class).<br>
&gt;&gt;<br>
&gt;&gt; Actually, the main script and main class names are taken from the project<br>
&gt;&gt; name; if you create a<br>
&gt;&gt; RubyClock project, Plasmate will create a rubyclock.rb file, with a<br>
&gt;&gt; MainRubyClock class inside it :)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The Ruby plasmoid implementation doesn&#39;t use the Ruby equivalent of<br>
&gt;&gt;&gt; __dict__, but simply derives the main class name from the main script<br>
&gt;&gt;&gt; name. So I wasn&#39;t sure is you should specifiy a main *class* name in<br>
&gt;&gt;&gt; Plasmate like FooBar which would give a main script name of<br>
&gt;&gt;&gt; foo_bar.rb. Or whether you should give a main script name of<br>
&gt;&gt;&gt; foo_bar.rb the Plasmate form from which the class &#39;FooBar&#39; is then<br>
&gt;&gt;&gt; derived.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Currently in Plasmate the name of the applet is used to derive both<br>
&gt;&gt;&gt; the module (like a namespace), and the name of the class, which I<br>
&gt;&gt;&gt; think is wrong. For example, if you call your applet FooBar you get:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; module FooBar<br>
&gt;&gt;&gt;  class FooBar&lt; PlasmaScripting::Applet<br>
&gt;&gt;&gt; ...<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I would rather the class was called &#39;Main&#39; if you don&#39;t specifiy a main<br>
&gt;&gt;&gt; script.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m sorry, but this is wrong: I&#39;ve taken care of avoiding it since the<br>
&gt;&gt; beginning<br>
&gt;&gt; (I also reverted, a couple of days ago, a commit[1] that did exactly what<br>
&gt;&gt; you just<br>
&gt;&gt; described ).<br>
&gt; Ah OK - I was testing what the &#39;The_User&#39; had just commited, which you<br>
&gt; have reverted. I think the name of the main script was wrong for<br>
&gt; MainForBar - it should be code/main_foo_bar.rb, and fixing that was<br>
&gt; why he made the change. Personally if a main script isn&#39;t specified I<br>
&gt; would prefer a class name of &#39;Main&#39; and main script of &#39;main.rb&#39; for<br>
&gt; Ruby.<br>
I&#39;ve just commited some changes to the Ruby folder and main script<br>
name generation in Ruby so that it now works correctly. If you name<br>
you project FooBar it will be put in a folder called &#39;foo_bar&#39; and the<br>
main script will be called &#39;main_foo_bar.rb&#39;. If you don&#39;t follow this<br>
convention the correct module and class name will not be generated<br>
when the Ruby script engine tries to load the applet. I also enabled<br>
creating Ruby Data Engines, as the Ruby api works file.<br>
<br>
-- Richard<br>
<br>
</blockquote><div>That&#39;s great, thanks :)<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">_______________________________________________<br>

Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
<br></blockquote></div><br>