Use tabs instead of spaces in the template tester's sample python text. This makes indenting and outdenting in the tester consistent.

This commit is contained in:
Charles Haley 2023-04-21 11:55:59 +01:00
parent 46406ca9a7
commit 125c7bbf26

View File

@ -618,17 +618,17 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
def add_python_template_header_text(self): def add_python_template_header_text(self):
self.textbox.setPlainText('''python: self.textbox.setPlainText('''python:
def evaluate(book, context): def evaluate(book, context):
# book is a calibre metadata object \t# book is a calibre metadata object
# context is an instance of calibre.utils.formatter.PythonTemplateContext, \t# context is an instance of calibre.utils.formatter.PythonTemplateContext,
# which currently contains the following attributes: \t# which currently contains the following attributes:
# db: a calibre legacy database object. \t# db: a calibre legacy database object.
# globals: the template global variable dictionary. \t# globals: the template global variable dictionary.
# arguments: is a list of arguments if the template is called by a GPM template, otherwise None. \t# arguments: is a list of arguments if the template is called by a GPM template, otherwise None.
# funcs: used to call Built-in/User functions and Stored GPM/Python templates. \t# funcs: used to call Built-in/User functions and Stored GPM/Python templates.
# Example: context.funcs.list_re_group() \t# Example: context.funcs.list_re_group()
# your Python code goes here \t# your Python code goes here
return 'a string' \treturn 'a string'
''') ''')
def set_word_wrap(self, to_what): def set_word_wrap(self, to_what):