mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sync to trunk.
This commit is contained in:
commit
1e9d9dc242
3
setup.py
3
setup.py
@ -72,7 +72,7 @@ if __name__ == '__main__':
|
||||
build_osx, upload_installers, upload_user_manual, \
|
||||
upload_to_pypi, stage3, stage2, stage1, upload, \
|
||||
upload_rss, betas, build_linux32, build_linux64, \
|
||||
build_osx64
|
||||
build_osx64, get_translations
|
||||
resources.SCRIPTS = {}
|
||||
for x in ('console', 'gui'):
|
||||
for name in basenames[x]:
|
||||
@ -265,6 +265,7 @@ if __name__ == '__main__':
|
||||
'manual' : manual,
|
||||
'resources' : resources,
|
||||
'translations' : translations,
|
||||
'get_translations': get_translations,
|
||||
'gui' : gui,
|
||||
'clean' : clean,
|
||||
'sdist' : sdist,
|
||||
|
@ -309,7 +309,7 @@ class LibraryServer(object):
|
||||
def get_format(self, id, format):
|
||||
format = format.upper()
|
||||
fmt = self.db.format(id, format, index_is_id=True, as_file=True,
|
||||
mode='r+b')
|
||||
mode='rb')
|
||||
if fmt is None:
|
||||
raise cherrypy.HTTPError(404, 'book: %d does not have format: %s'%(id, format))
|
||||
if format == 'EPUB':
|
||||
|
26
upload.py
26
upload.py
@ -281,6 +281,32 @@ class translations(OptionlessCommand):
|
||||
if os.path.exists(path):
|
||||
os.remove(path)
|
||||
|
||||
class get_translations(translations):
|
||||
|
||||
description = 'Get updated translations from Launchpad'
|
||||
BRANCH = 'lp:~kovid/calibre/translations'
|
||||
|
||||
def run(self):
|
||||
cwd = os.getcwd()
|
||||
subprocess.check_call(['bzr', 'merge', self.BRANCH])
|
||||
|
||||
def check_for_errors(self):
|
||||
errors = os.path.join(self.PATH, '.errors')
|
||||
if os.path.exists(errors):
|
||||
shutil.rmtree(errors)
|
||||
pofilter = ('pofilter', '-i', '.', '-o', errors,
|
||||
'-t', 'accelerators', '-t', 'escapes', '-t', 'variables',
|
||||
#'-t', 'xmltags',
|
||||
'-t', 'printf')
|
||||
subprocess.check_call(pofilter)
|
||||
errs = os.listdir(errors)
|
||||
if errs:
|
||||
print 'WARNING: Translation errors detected'
|
||||
print 'See http://translate.sourceforge.net/wiki/toolkit/using_pofilter'
|
||||
print 'Error files:\n'
|
||||
for e in errs:
|
||||
print os.path.join(errors, e)
|
||||
|
||||
|
||||
class gui(OptionlessCommand):
|
||||
description='''Compile all GUI forms and images'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user