From 1bfe6b06d77d3bb606f387dce411047cefe3d199 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Wed, 27 Apr 2011 21:49:28 +0100 Subject: [PATCH] Fix (I hope) template program_text retrieval when not running from source --- src/calibre/gui2/preferences/template_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/preferences/template_functions.py b/src/calibre/gui2/preferences/template_functions.py index 8ffd65b2b5..20724b7667 100644 --- a/src/calibre/gui2/preferences/template_functions.py +++ b/src/calibre/gui2/preferences/template_functions.py @@ -186,7 +186,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): self.argument_count.setValue(func.arg_count) self.documentation.setText(func.doc) if txt in self.builtins: - if hasattr(func, 'program_text'): + if hasattr(func, 'program_text') and func.program_text: self.program.setPlainText(func.program_text) elif txt in self.builtin_source_dict: self.program.setPlainText(self.builtin_source_dict[txt])