mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make dir if it does not exist
This commit is contained in:
parent
5afeace988
commit
0137c2a74b
@ -113,6 +113,10 @@ class POT(Command): # {{{
|
|||||||
ans.append('')
|
ans.append('')
|
||||||
pot = self.pot_header() + '\n\n' + '\n'.join(ans)
|
pot = self.pot_header() + '\n\n' + '\n'.join(ans)
|
||||||
dest = self.j(self.TRANSLATIONS, 'iso_639', 'iso_639_3.pot')
|
dest = self.j(self.TRANSLATIONS, 'iso_639', 'iso_639_3.pot')
|
||||||
|
try:
|
||||||
|
os.makedirs(os.path.dirname(dest))
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
with open(dest, 'wb') as f:
|
with open(dest, 'wb') as f:
|
||||||
f.write(pot.encode('utf-8'))
|
f.write(pot.encode('utf-8'))
|
||||||
self.upload_pot(resource='iso639')
|
self.upload_pot(resource='iso639')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user