mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-30 12:40:47 -04:00
Cleanup previous PR
This commit is contained in:
parent
989122f0a8
commit
77f827c3b8
@ -295,8 +295,8 @@ class FormatterFunction:
|
||||
|
||||
class BuiltinFormatterFunction(FormatterFunction):
|
||||
|
||||
def __init__(self):
|
||||
formatter_functions().register_builtin(self)
|
||||
def __init_subclass__(cls):
|
||||
formatter_functions().register_builtin(cls())
|
||||
|
||||
|
||||
class BuiltinStrcmp(BuiltinFormatterFunction):
|
||||
@ -3843,12 +3843,6 @@ returns `Foo, book 3 of 5`
|
||||
raise ValueError(_('This function cannot be called directly. It is built into the formatter'))
|
||||
|
||||
|
||||
# Registering builtins
|
||||
for obj in list(globals().values()):
|
||||
if isinstance(obj, type) and issubclass(obj, BuiltinFormatterFunction) and obj is not BuiltinFormatterFunction:
|
||||
obj()
|
||||
|
||||
|
||||
class FormatterUserFunction(FormatterFunction):
|
||||
|
||||
def __init__(self, name, doc, arg_count, program_text, object_type):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user