mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Ensure correct base directory is used when compiling with CALIBRE_DEVELOP_FROM
This commit is contained in:
parent
dee602246b
commit
3a270f77c5
@ -194,9 +194,13 @@ def create_manifest(html):
|
|||||||
h.hexdigest(), manifest).encode('utf-8')
|
h.hexdigest(), manifest).encode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
def compile_srv():
|
def base_dir():
|
||||||
d = os.path.dirname
|
d = os.path.dirname
|
||||||
base = d(d(d(d(os.path.abspath(__file__)))))
|
return d(d(d(d(os.path.abspath(__file__)))))
|
||||||
|
|
||||||
|
|
||||||
|
def compile_srv():
|
||||||
|
base = base_dir()
|
||||||
iconf = os.path.join(base, 'imgsrc', 'srv', 'generate.py')
|
iconf = os.path.join(base, 'imgsrc', 'srv', 'generate.py')
|
||||||
g = {'__file__': iconf}
|
g = {'__file__': iconf}
|
||||||
execfile(iconf, g)
|
execfile(iconf, g)
|
||||||
@ -213,7 +217,7 @@ def compile_srv():
|
|||||||
if e.errno != errno.ENOENT:
|
if e.errno != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
mathjax_version = '0'
|
mathjax_version = '0'
|
||||||
base = P('content-server', allow_user_override=False)
|
base = os.path.join(base, 'resources', 'content-server')
|
||||||
fname = os.path.join(rapydscript_dir, 'srv.pyj')
|
fname = os.path.join(rapydscript_dir, 'srv.pyj')
|
||||||
with lopen(fname, 'rb') as f:
|
with lopen(fname, 'rb') as f:
|
||||||
js = compile_fast(f.read(), fname).replace(
|
js = compile_fast(f.read(), fname).replace(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user