mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04: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
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__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 locale import normalize as normalize_locale
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
@ -299,6 +299,12 @@ class Translations(POT): # {{{
|
|||||||
locale = self.mo_file(f)[0]
|
locale = self.mo_file(f)[0]
|
||||||
stats[locale] = min(1.0, float(trans)/total)
|
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)
|
cPickle.dump(stats, open(dest, 'wb'), -1)
|
||||||
|
|
||||||
def compile_user_manual_translations(self):
|
def compile_user_manual_translations(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user