mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
oops
This commit is contained in:
parent
01f9a4a330
commit
adc6a173a5
@ -359,8 +359,8 @@ class TextEdit(PlainTextEdit):
|
||||
raw, count = pat.subn(template, raw)
|
||||
if repl_is_func:
|
||||
from calibre.gui2.tweak_book.search import show_function_debug_output
|
||||
show_function_debug_output(template)
|
||||
template.end()
|
||||
show_function_debug_output(template)
|
||||
if count > 0:
|
||||
start_pos = min(c.anchor(), c.position())
|
||||
c.insertText(raw)
|
||||
|
@ -97,7 +97,7 @@ class Function(object):
|
||||
return self.func(None, self.match_index, self.context_name, self.boss.current_metadata, dictionaries, self.data, self.functions)
|
||||
finally:
|
||||
sys.stdout, sys.stderr = oo, oe
|
||||
self.data, self.debug_buf, self.boss, self.functions = {}, None, None, {}
|
||||
self.data, self.boss, self.functions = {}, None, {}
|
||||
|
||||
class DebugOutput(Dialog):
|
||||
|
||||
|
@ -1188,6 +1188,7 @@ def get_search_function(search):
|
||||
def show_function_debug_output(func):
|
||||
if isinstance(func, Function):
|
||||
val = func.debug_buf.getvalue().strip()
|
||||
func.debug_buf.truncate(0)
|
||||
if val:
|
||||
from calibre.gui2.tweak_book.boss import get_boss
|
||||
get_boss().gui.sr_debug_output.show_log(func.name, val)
|
||||
|
Loading…
x
Reference in New Issue
Block a user