View Single Post
Old 04-11-2021, 09:14 AM   #516
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,203
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
PS: I am thinking about adding "return" to the template language, which would allow the above template to be written
That would be useful addition.

Quote:
Originally Posted by chaley View Post
On the plus side: in addition to checking for individual book vars, your suggestion has the advantage of being able to ask about more than one variable at once, as in
This is what I had in mind when thinking about this. The prefix thing is another good use for this.

Quote:
Originally Posted by chaley View Post
Another topic: while playing with actions today I noticed that some of the template dialogs, for example the Template Scope one, have extra fields related to stored templates, specifically the template name and the documentation. I am changing TemplateDialog to permit you to hide them.

With the changed TemplateDialog I tested this in Action Chains.templates.py and it works. Starting at line 404:
Code:
        TemplateDialog.__init__(self,
                                parent,
                                text,
                                mi=mi,
                                text_is_placeholder=text_is_placeholder,
                                all_functions=self.all_functions,
                                builtin_functions=builtin_functions,
                                global_vars=global_vars)
        self.setup_saved_template_editor(show_buttonbox=not dialog_is_st_editor,
                                         show_doc_and_name=False)
I will let you know when the changes are in calibre source.
Yes, would make it a lot better and less confusing. Will be waiting for the changes.
capink is offline   Reply With Quote