Skip to content

Commit

Permalink
Merge pull request #56 from tk0miya/55_FileNotFoundError
Browse files Browse the repository at this point in the history
Fix #55: FileNotFoundError on update-txconfig-resources in the subdirectory
  • Loading branch information
tk0miya committed Oct 31, 2021
2 parents 491cf59 + 28b1065 commit 6edc8aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Documentation

Bug Fixes
---------
- #55: FileNotFoundError on update-txconfig-resources in the subdirectory

2.0.1 (2020/04/11)
==================
Expand Down
12 changes: 7 additions & 5 deletions sphinx_intl/transifex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import textwrap

import click
from sphinx.util.osutil import cd

from .pycompat import relpath
from .catalog import load_po
Expand Down Expand Up @@ -159,10 +160,11 @@ def update_txconfig_resources(transifex_project_name, locale_dir, pot_dir):
resource_path = relpath(base, pot_dir)
pot = load_po(pot_file)
if len(pot):
resource_name = normalize_resource_name(resource_path)
lv = locals()
args = [arg % lv for arg in args_tmpl]
# print('set', args, tx_root)
txclib.utils.exec_command('set', args, tx_root)
with cd("."): # Change the current working directory after tx processing
resource_name = normalize_resource_name(resource_path)
lv = locals()
args = [arg % lv for arg in args_tmpl]
# print('set', args, tx_root)
txclib.utils.exec_command('set', args, tx_root)
else:
click.echo('{0} is empty, skipped'.format(pot_file))

0 comments on commit 6edc8aa

Please sign in to comment.