Port sdist to use the new translations layout

This commit is contained in:
Kovid Goyal 2014-05-26 09:03:44 +05:30
parent 2363f44a65
commit 6bc70dc2f4

View File

@ -293,14 +293,14 @@ class Sdist(Command):
dest = os.path.join(tdir, self.d(f))
shutil.copy2(f, dest)
tbase = self.j(self.d(self.d(self.SRC)), 'calibre-translations')
for x in ('setup/iso_639', 'src/calibre/translations'):
destdir = self.j(tdir, x)
tbase = self.j(self.d(self.SRC), 'translations')
for x in ('iso_639', 'calibre'):
destdir = self.j(tdir, 'translations', x)
if not os.path.exists(destdir):
os.mkdir(destdir)
for y in glob.glob(self.j(tbase, x, '*')):
os.makedirs(destdir)
for y in glob.glob(self.j(tbase, x, '*.po')) + glob.glob(self.j(tbase, x, '*.pot')):
dest = self.j(destdir, self.b(y))
if y.rpartition('.')[-1] not in {'pyc', 'pyo'} and not os.path.exists(dest):
if not os.path.exists(dest):
shutil.copy2(y, dest)
self.info('\tCreating tarfile...')