mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1903535 [[PATCH] Allow keyword arguments in debug_print](https://bugs.launchpad.net/calibre/+bug/1903535)
This commit is contained in:
parent
787001dea0
commit
19a0aa139d
@ -23,15 +23,13 @@ from calibre.devices.usbms.books import BookList, Book
|
|||||||
from calibre.ebooks.metadata.book.json_codec import JsonCodec
|
from calibre.ebooks.metadata.book.json_codec import JsonCodec
|
||||||
from polyglot.builtins import itervalues, unicode_type, string_or_bytes, zip
|
from polyglot.builtins import itervalues, unicode_type, string_or_bytes, zip
|
||||||
|
|
||||||
BASE_TIME = None
|
|
||||||
|
|
||||||
|
def debug_print(*args, **kw):
|
||||||
def debug_print(*args):
|
base_time = getattr(debug_print, 'base_time', None)
|
||||||
global BASE_TIME
|
if base_time is None:
|
||||||
if BASE_TIME is None:
|
debug_print.base_time = base_time = time.monotonic()
|
||||||
BASE_TIME = time.time()
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
prints('DEBUG: %6.1f'%(time.time()-BASE_TIME), *args)
|
prints('DEBUG: %6.1f'%(time.monotonic()-base_time), *args, **kw)
|
||||||
|
|
||||||
|
|
||||||
def safe_walk(top, topdown=True, onerror=None, followlinks=False, maxdepth=128):
|
def safe_walk(top, topdown=True, onerror=None, followlinks=False, maxdepth=128):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user