Naming conventions for scripting applets and data engines

Richard Dale richard.j.dale at gmail.com
Fri Nov 14 21:02:56 CET 2008


2008/11/14 Aaron J. Seigo <aseigo at kde.org>

> On Friday 14 November 2008, Richard Dale wrote:
> > I think 'examples' is a better place than 'test', and that we are better
> > off dividing them into 'applets' and 'dataengine' directories like the
> ruby
> > ones.
>
> agreed ... it also follows other places in kde better.
>
> > I prefer the python names like 'pyclock' or 'rbclock' to 'python_clock'
> or
> > 'ruby_clock'.
> >
> > Do we need to include 'plasma_applet' or 'plasma_dataengine' in all the
> > names?
> >
> > Should the names contain hyphens or underscores instead?
>
> it depends on which names. =)
>
> * in the file system: ruby/examples/applets/clock should be clear?


>
> * installation dir: python_<appletname>, ruby_<appletname>
>
> * .desktop file: pasma-applet-python-<appletname>.desktop

OK, just tried that. I have my engine in dataengines/time, the name in the
metadata.desktop file is 'ruby-time', and I install with this command:

plasmapkg --install time --type dataengine

I get:

/home/rdale/.kde/share/apps/plasma/dataengines/ruby-time
/home/rdale/.kde/share/kde4/services/plasma-dataengine-ruby-time.desktop

So it looks like plasmapkg goes on the name inside the metadata.desktop file
for the destination directory, and so dataengines/ruby-time has a hyphen in
it, rather than an underscore.



>
>
> this just follows the conventions we already have in place and follow for
> the
> c++ side of life.
>
> the rational for all of it is to make it easy to use traditional command
> line
> tools to sort through things, e.g.:
>
>         ls ~/.kde/share/kde4/services/plasma-applet*

Yes, I certainly agree with that - this is an example of 'Convention over
Configuration' as long as we can establish the conventions before we have
too many applets.

-- Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20081114/5e7eb0e7/attachment.htm 


More information about the Plasma-devel mailing list