mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
pep8
This commit is contained in:
parent
927cf43a4c
commit
7e577735ba
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import json, traceback
|
||||
|
||||
from PyQt5.Qt import Qt, QDialogButtonBox, QSizePolicy
|
||||
from PyQt5.Qt import QDialogButtonBox
|
||||
|
||||
from calibre.gui2 import error_dialog, warning_dialog
|
||||
from calibre.gui2.preferences import ConfigWidgetBase, test_widget
|
||||
|
@ -1825,6 +1825,7 @@ class FormatterUserFunction(FormatterFunction):
|
||||
def to_pref(self):
|
||||
return [self.name, self.doc, self.arg_count, self.program_text]
|
||||
|
||||
|
||||
tabs = re.compile(r'^\t*')
|
||||
|
||||
|
||||
@ -1837,9 +1838,11 @@ def function_pref_is_python(pref):
|
||||
return False
|
||||
raise ValueError('Unknown program type in formatter function pref')
|
||||
|
||||
|
||||
def function_pref_name(pref):
|
||||
return pref[0]
|
||||
|
||||
|
||||
def compile_user_function(name, doc, arg_count, eval_func):
|
||||
if not function_pref_is_python(eval_func):
|
||||
return FormatterUserFunction(name, doc, arg_count, eval_func, False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user