Dont use installed calibre when running sphinx-build

This commit is contained in:
Kovid Goyal 2017-07-04 21:51:42 +05:30
parent 9ccbf1ef8f
commit dfe2f5e04f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 15 additions and 17 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env calibre-debug
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
@ -6,18 +6,17 @@ from __future__ import (unicode_literals, division, absolute_import,
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import sys, os, subprocess, shutil
import tempfile
from functools import partial
from calibre import __appname__, __version__
from calibre.utils.icu import upper # ensure encoding is set to utf-8
del upper
import sys, os, subprocess, shutil
SPHINX_BUILD = 'sphinx-build2'
j, d, a = os.path.join, os.path.dirname, os.path.abspath
BASE = d(a(__file__))
SPHINX_BUILD = 'sphinx-build2'
sys.path.insert(0, d(BASE))
from setup import __appname__, __version__
del sys.path[0]
def sphinx_build(language, base, builder='html', bdir='html', t=None, quiet=True, very_quiet=False):

View File

@ -15,11 +15,11 @@ import sys, os
from datetime import date
# If your extensions are in another directory, add it here.
sys.path.append(os.path.abspath('.'))
import init_calibre
init_calibre
from calibre.constants import __appname__, __version__
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.dirname(sys.path[-1]))
from setup import __appname__, __version__
import calibre.utils.localization as l # Ensure calibre translations are installed
del sys.path[0]
del l
import custom
custom

View File

@ -3,14 +3,13 @@
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import sys, os, re, textwrap
import os, re, textwrap
from functools import partial
import init_calibre
del init_calibre
from sphinx.util.console import bold
sys.path.append(os.path.abspath('../../../'))
from calibre.linux import entry_points, cli_index_strings
from epub import EPUBHelpBuilder
from latex import LaTeXHelpBuilder

View File

@ -208,8 +208,8 @@ class Manual(Command):
os.environ['ALL_USER_MANUAL_LANGUAGES'] = ' '.join(languages)
for language in languages:
jobs.append(([
'calibre-debug', self.j(self.d(self.SRC), 'manual', 'build.py'),
'--', language, self.j(tdir, language)
sys.executable, self.j(self.d(self.SRC), 'manual', 'build.py'),
language, self.j(tdir, language)
], '\n\n**************** Building translations for: %s' % language))
self.info('Building manual for %d languages' % len(jobs))
subprocess.check_call(jobs[0][0])
@ -300,7 +300,7 @@ class ManPages(Command):
jobs = []
for l in languages:
jobs.append((
['calibre-debug', self.j(base, 'build.py'), '--', '--man-pages', l, dest],
[sys.executable, self.j(base, 'build.py'), '--man-pages', l, dest],
'\n\n**************** Building translations for: %s' % l)
)
self.info('\tCreating man pages in {} for {} languages...'.format(dest, len(jobs)))