diff --git a/manual/build.py b/manual/build.py index 3af1aa4cc4..4027691e11 100755 --- a/manual/build.py +++ b/manual/build.py @@ -42,29 +42,31 @@ def build_manual(language, base): sb = partial(sphinx_build, language, base) onlinedir = sb(t='online') epubdir = sb('myepub', 'epub') - latexdir = sb('latex', 'latex') - pwd = os.getcwd() - os.chdir(latexdir) + pdf_ok = language not in ('ja',) + if pdf_ok: + latexdir = sb('latex', 'latex') + pwd = os.getcwd() + os.chdir(latexdir) - def run_cmd(cmd): - p = subprocess.Popen(cmd, stdout=open(os.devnull, 'wb'), stdin=subprocess.PIPE) - p.stdin.close() - return p.wait() - try: - for i in range(3): - run_cmd(['xelatex', '-interaction=nonstopmode', 'calibre.tex']) - run_cmd(['makeindex', '-s', 'python.ist', 'calibre.idx']) - for i in range(2): - run_cmd(['xelatex', '-interaction=nonstopmode', 'calibre.tex']) - if not os.path.exists('calibre.pdf'): - print('Failed to build pdf file, see calibre.log in the latex directory', file=sys.stderr) - raise SystemExit(1) - finally: - os.chdir(pwd) + def run_cmd(cmd): + p = subprocess.Popen(cmd, stdout=open(os.devnull, 'wb'), stdin=subprocess.PIPE) + p.stdin.close() + return p.wait() + try: + for i in range(3): + run_cmd(['xelatex', '-interaction=nonstopmode', 'calibre.tex']) + run_cmd(['makeindex', '-s', 'python.ist', 'calibre.idx']) + for i in range(2): + run_cmd(['xelatex', '-interaction=nonstopmode', 'calibre.tex']) + if not os.path.exists('calibre.pdf'): + print('Failed to build pdf file, see calibre.log in the latex directory', file=sys.stderr) + raise SystemExit(1) + finally: + os.chdir(pwd) + pdf_dest = j(onlinedir, 'calibre.pdf') + shutil.copyfile(j(latexdir, 'calibre.pdf'), pdf_dest) epub_dest = j(onlinedir, 'calibre.epub') - pdf_dest = j(onlinedir, 'calibre.pdf') shutil.copyfile(j(epubdir, 'calibre.epub'), epub_dest) - shutil.copyfile(j(latexdir, 'calibre.pdf'), pdf_dest) epub_to_azw3(epub_dest) diff --git a/setup/publish.py b/setup/publish.py index be1f3544ee..6856ca8025 100644 --- a/setup/publish.py +++ b/setup/publish.py @@ -164,7 +164,7 @@ class Manual(Command): languages = opts.language or list( json.load(open(self.j(base, 'locale', 'completed.json'), 'rb')) ) - languages = ['en'] + list(set(languages) - {'en', 'ja'}) + languages = ['en'] + list(set(languages) - {'en'}) os.environ['ALL_USER_MANUAL_LANGUAGES'] = ' '.join(languages) for language in languages: jobs.append(create_job([