mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 compat
This commit is contained in:
parent
c203373b9b
commit
acb42d737d
@ -241,7 +241,7 @@ class POT(Command): # {{{
|
|||||||
] + qt_inputs)
|
] + qt_inputs)
|
||||||
|
|
||||||
with open(out.name, 'rb') as f:
|
with open(out.name, 'rb') as f:
|
||||||
src = f.read()
|
src = f.read().decode('utf-8')
|
||||||
os.remove(out.name)
|
os.remove(out.name)
|
||||||
src = pot_header + '\n' + src
|
src = pot_header + '\n' + src
|
||||||
src += '\n\n' + self.get_tweaks_docs()
|
src += '\n\n' + self.get_tweaks_docs()
|
||||||
@ -254,12 +254,12 @@ class POT(Command): # {{{
|
|||||||
src = re.sub(r'#, python-brace-format\s+msgid ""\s+.*<code>{0:</code>',
|
src = re.sub(r'#, python-brace-format\s+msgid ""\s+.*<code>{0:</code>',
|
||||||
lambda m: m.group().replace('python-brace', 'no-python-brace'), src)
|
lambda m: m.group().replace('python-brace', 'no-python-brace'), src)
|
||||||
with open(pot, 'wb') as f:
|
with open(pot, 'wb') as f:
|
||||||
f.write(src)
|
f.write(src.encode('utf-8'))
|
||||||
self.info('Translations template:', os.path.abspath(pot))
|
self.info('Translations template:', os.path.abspath(pot))
|
||||||
self.upload_pot(resource='main')
|
self.upload_pot(resource='main')
|
||||||
self.git(['add', os.path.abspath(pot)])
|
self.git(['add', os.path.abspath(pot)])
|
||||||
|
|
||||||
if self.git('diff-index --cached --quiet --ignore-submodules HEAD --', use_call=True) != 0:
|
if not is_ci and self.git('diff-index --cached --quiet --ignore-submodules HEAD --', use_call=True) != 0:
|
||||||
self.git(['commit', '-m', 'Updated translation templates'])
|
self.git(['commit', '-m', 'Updated translation templates'])
|
||||||
self.git('push')
|
self.git('push')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user