mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 16:03:17 +02:00
Dont fail when building translations if resources/localization does not exist, which happens for people building from a git checkout instead of the source tarball
This commit is contained in:
parent
e10538e05c
commit
f011529895
1 changed files with 7 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
|||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os, tempfile, shutil, subprocess, glob, re, time, textwrap, cPickle, shlex, json
|
||||
import os, tempfile, shutil, subprocess, glob, re, time, textwrap, cPickle, shlex, json, errno
|
||||
from locale import normalize as normalize_locale
|
||||
from functools import partial
|
||||
|
||||
|
|
@ -299,6 +299,12 @@ def write_stats(self):
|
|||
locale = self.mo_file(f)[0]
|
||||
stats[locale] = min(1.0, float(trans)/total)
|
||||
|
||||
base = self.d(dest)
|
||||
try:
|
||||
os.mkdir(base)
|
||||
except EnvironmentError as err:
|
||||
if err.errno != errno.EEXIST:
|
||||
raise
|
||||
cPickle.dump(stats, open(dest, 'wb'), -1)
|
||||
|
||||
def compile_user_manual_translations(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue