This commit is contained in:
Kovid Goyal 2014-08-22 09:38:32 +05:30
parent 27b57c73b3
commit 3f57f71c5a
2 changed files with 14 additions and 10 deletions

View File

@ -106,14 +106,18 @@ class Manual(Command):
self.info('Building manual for %d languages' % len(jobs))
if not parallel_build(jobs, self.info):
raise SystemExit(1)
os.chdir(self.j(tdir, 'en', 'html'))
for x in os.listdir(tdir):
if x != 'en':
shutil.copytree(self.j(tdir, x, 'html'), x)
self.replace_with_symlinks(x)
else:
os.symlink('..', 'en')
self.info('Built manual for %d languages in %s minutes' % (len(jobs), int((time.time() - st)/60.)))
cwd = os.getcwdu()
try:
os.chdir(self.j(tdir, 'en', 'html'))
for x in os.listdir(tdir):
if x != 'en':
shutil.copytree(self.j(tdir, x, 'html'), x)
self.replace_with_symlinks(x)
else:
os.symlink('..', 'en')
self.info('Built manual for %d languages in %s minutes' % (len(jobs), int((time.time() - st)/60.)))
finally:
os.chdir(cwd)
def replace_with_symlinks(self, lang_dir):
' Replace all identical files with symlinks to save disk space/upload bandwidth '

View File

@ -250,9 +250,9 @@ class UploadDemo(Command): # {{{
'''--mono-family "/usr/share/fonts/corefonts, Andale Mono" '''
''''''%self.j(self.SRC, HTML2LRF), shell=True)
lrf = self.j(self.SRC, 'calibre', 'ebooks', 'lrf', 'html', 'demo')
check_call(
'cd src/calibre/ebooks/lrf/html/demo/ && '
'zip -j /tmp/html-demo.zip * /tmp/html2lrf.lrf', shell=True)
'cd %s && zip -j /tmp/html-demo.zip * /tmp/html2lrf.lrf' % lrf, shell=True)
check_call('scp /tmp/html-demo.zip divok:%s/'%(DOWNLOADS,), shell=True)
# }}}