From 3f57f71c5af860ed35c43ca06649fac3e707ec4f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 22 Aug 2014 09:38:32 +0530 Subject: [PATCH] ... --- setup/publish.py | 20 ++++++++++++-------- setup/upload.py | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/setup/publish.py b/setup/publish.py index 5b2072fc87..922e05e789 100644 --- a/setup/publish.py +++ b/setup/publish.py @@ -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 ' diff --git a/setup/upload.py b/setup/upload.py index 86d9833ec7..81407e42d0 100644 --- a/setup/upload.py +++ b/setup/upload.py @@ -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) # }}}