View Single Post
Old 09-23-2011, 11:07 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,462
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Arco Witter View Post
Could you please give me the definition for this function? (correct parameters are enough, I think)
Currently I have this:
Code:
def evaluate(self, formatter, kwargs, mi, locals, val, genretext, serietext, number_in_series, max_number_in_series, aantal_menu_items):
I am not sure what you mean by definition. I suspect you mean the prototype for how you call it.

That function requires six arguments: val, genretext, serietext, number_in_series, max_number_in_series, aantal_menu_items. The example in your first post implies that 'val' is really title. Using this assumption, and further assuming template program mode, you would call it something like
Code:
{title:folderOnDevice($, field('#genre'), field('series'), field('series_index'), field('#max_number_in_series'),10)'}
You would call it in general program mode using
Code:
program: folderOnDevice(field('title'), field('#genre'), field('series'), field('series_index'), field('#max_number_in_series'),10)
Quote:
btw: I got this information from here: http://manual.calibre-ebook.com/temp...late-functions
so this is the manual for Calibre itself, right?
yes
Quote:
If you can point me to any place where the construction 'program:' is used, please do so!
It is documented in the same manual section. See http://manual.calibre-ebook.com/temp...l-program-mode
chaley is offline   Reply With Quote