mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
ebook-viewer: Fix --debug-javascript option causing an error when running frmo a binary build on os x and linux
This commit is contained in:
parent
e993b1e0d4
commit
eca6e320ab
@ -41,7 +41,6 @@ class JavaScriptLoader(object):
|
|||||||
'hyphenation', 'hyphenator', 'utils', 'cfi', 'indexing', 'paged',
|
'hyphenation', 'hyphenator', 'utils', 'cfi', 'indexing', 'paged',
|
||||||
'fs', 'math', 'extract')
|
'fs', 'math', 'extract')
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, dynamic_coffeescript=False):
|
def __init__(self, dynamic_coffeescript=False):
|
||||||
self._dynamic_coffeescript = dynamic_coffeescript
|
self._dynamic_coffeescript = dynamic_coffeescript
|
||||||
if self._dynamic_coffeescript:
|
if self._dynamic_coffeescript:
|
||||||
@ -68,6 +67,7 @@ class JavaScriptLoader(object):
|
|||||||
allow_user_override=False).decode('utf-8')
|
allow_user_override=False).decode('utf-8')
|
||||||
else:
|
else:
|
||||||
dynamic = (self._dynamic_coffeescript and
|
dynamic = (self._dynamic_coffeescript and
|
||||||
|
calibre.__file__ and not calibre.__file__.endswith('.pyo') and
|
||||||
os.path.exists(calibre.__file__))
|
os.path.exists(calibre.__file__))
|
||||||
ans = compiled_coffeescript(src, dynamic=dynamic).decode('utf-8')
|
ans = compiled_coffeescript(src, dynamic=dynamic).decode('utf-8')
|
||||||
self._cache[name] = ans
|
self._cache[name] = ans
|
||||||
@ -105,4 +105,3 @@ class JavaScriptLoader(object):
|
|||||||
evaljs('\n\n'.join(self._hp_cache.itervalues()))
|
evaljs('\n\n'.join(self._hp_cache.itervalues()))
|
||||||
|
|
||||||
return lang
|
return lang
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user