hey,

yes, feel free to ask question on IRC

right now I'm the only one that I know of with some lua programming
experience, but Hal_from_2001 and hanatos have been playing a little with
lua.

A little update while i'm at it. Since my introductory message


* I have added support for groups, you can group/ungroup images, find what
images are grouped together and change group leaders
* I have added support for tags, you can create/delete/attach/detach tags
from lua.

* there is support for DT events in the lua_review branch. This will allow
you to register functions that will be called on a given lua event. For the
purpose of the pull-request there are only two events
** a shortcut event : you register a shortcut, the user binds it to a key
in the preferences, your callback is called on keypress
** an import evnet : called just after an image has been added in the
database

* the PR branch also have adde a way to find the image under the cursor,
and the set on image to act on (either the hovered image or the selection,
consistant with the way the DT UI works). This should probably be in master
rather than the PR itself, but it's no big deal since i'll merge that
soonish


LUA TIP OF THE DAY

while i'm at it....

Lua has quite a bit of syntactic sugar, some of which can make your code
murch more readable.

One such syntactic sugar is the ":" convention to index table.

writing a:b() is syntactically equivalent to writing a.b(a)

in other word it adds a first argument to the function call with whatever
is left of the ":"

you will notice that lots of functions in the documentation take a first
parameter of the same type as the object they are part of. i.e these are
methods. Using that will greatly simplify your code

an example of that is the attach_tag function. This function takes two
parameters attach_tag(A,B) and will attach a tag to an image.
* either A is an image and B is a tag
* or A is a tag and B is an image

what makes this interesting is that their is three way to access that
function. Through an image object, through a tag object or as a global
variable (with slightly dfferent names). In other word

<image>:attach_tag(<tag>)
<tag>:attach(<image>)
darktable.tags.attach(<image>,<tag>)
darktable.tags.attach(<tag>,<image>)

will all call the same function correctly, but depending on the surrounding
code you can choose the most readable way to call it.



Cheers
Boucman


On Mon, May 20, 2013 at 6:43 PM, Ivan Tarozzi <[email protected]> wrote:

> Il 16/05/2013 19:17, jeremy rosen ha scritto:
> > Hello everybody
> >
> > I recently merged in master a first set of lua code that makes it
> > usefull for real-life usage
> >
> > The general philosophy of lua in DT (for 1.4 at least) is that it is
> > here to help you automate your DAM.
> [cut]
>
>
> Hi Jérémy,
> so great news from LUA side :)
>
> Sorry for delay, in this period I don't have much time to "play" with
> darktable, but I'm really excited about the current state of LUA
> implementation.
>
> Now I think the features all really improved and the wiki linked should
> help LUA beginner (as me) to learn the use of scripts inside dt.
>
> In the next days I'm going to deep read your documentation, and I hope
> one day I'll have some interesting script to share :)
>
> Thanks for your great work!
>
> Ivan
>
>
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> darktable-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/darktable-devel
>
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
darktable-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/darktable-devel

Reply via email to