<br><br><div class="gmail_quote">2008/11/3 Aaron J. Seigo <span dir="ltr">&lt;<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Monday 03 November 2008, Richard Dale wrote:</div></div></blockquote><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; One little thing that would be nice, is to be able to specify a different<br><div class="Ih2E3d">
&gt; name for the main file in a plasmoid so that we can have main.rb, main.py<br>
&gt; etc without needing to have a new package structure plugin just to be able<br>
&gt; to do that.<br>
<br>
</div>i thought that was why we added the virtual mainScript method to ScriptEngine,<br>
but evidently that&#39;s not good enough.</blockquote><div>No the problem is that in Plasma::Package::isValid() there is this test:<br><br>&nbsp;&nbsp;&nbsp; foreach (const char *file, d-&gt;structure-&gt;requiredFiles()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!QFile::exists(d-&gt;basePath + d-&gt;structure-&gt;contentsPrefix() + d-&gt;structure-&gt;path(file))) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kWarning() &lt;&lt; &quot;Could not find required file&quot; &lt;&lt; file &lt;&lt; &quot;, look in&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; d-&gt;basePath + d-&gt;structure-&gt;contentsPrefix() + d-&gt;structure-&gt;path(file) &lt;&lt; endl;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;valid = false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>And it doesn&#39;t use the mainScript() method to get the name of the file to check, so you get this error:<br><br>plasmoidviewer(12281)/libplasma Plasma::Applet::load: we have a script using the &quot;ruby-script&quot; API<br>
plasmoidviewer(12281)/libplasma Plasma::Package::isValid: Could not find required file mainscript , look in &quot;/home/rdale/.kde/share/apps/plasma/plasmoids/test_ruby/contents/code/main&quot;<br><br>There is a space after &#39;mainscript&#39; before the comma in the error text, which looks like a bug.<br>
&nbsp;<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>
<br>
something that occured to me is that you could always use the mainscript file<br>
to load &#39;main.py&#39;, no? one more bit of indirection, but you get your syntax<br>
highlighting that way ..<br>
<br>
not overly elegant of course ... i&#39;m seriously not impressed that we&#39;re<br>
looking at such complexity because of syntax highlighting in editors. =/</blockquote><div>&nbsp;I think that&#39;s uglier than needing special package subclasses though. But the big problem with custom packages for ruby and python is that they&#39;re supposed to be translated and we will need to duplicate the i18n strings from the default plasmoid package .desktop file.<br>
<br>-- Richard<br></div></div><br>