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