Skip to content

Commit c01b058

Browse files
committed
Simplify msgcat walking
1 parent 6efff4e commit c01b058

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

manage_translation.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@ def fetch():
4242
)
4343
if pull_returncode != 0:
4444
exit(pull_returncode)
45-
for root, _, po_files in os.walk('.'):
46-
for po_file in po_files:
47-
if not po_file.endswith(".po"):
48-
continue
49-
po_path = os.path.join(root, po_file)
50-
call(f'msgcat --no-location -o {po_path} {po_path}', shell=True)
45+
for file in Path().rglob('*.po'):
46+
call(f'msgcat --no-location -o {file} {file}', shell=True)
5147

5248

5349
RESOURCE_NAME_MAP = {'glossary_': 'glossary'}

0 commit comments

Comments
 (0)