Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mandre committed Mar 16, 2020
1 parent 4a5d9b7 commit 72652e2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pull_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def fetch_package_version(project):
if version:
project['version'] = version
else:
print("Could not fetch version for %s" % project['name'])
print("Could not fetch version for %s: %s" % (project['name'], stderr.read().decode()))
exit()


Expand All @@ -51,7 +51,7 @@ def pull_po(project, podir, lang):
"--project-version", project['version'],
"--project-type", project['zanata_project_type'],
]
print(" ".join(command))
print("-> %s" % " ".join(command))
stdout, stderr, exit_status = run_command(command)
if exit_status != 0:
print("Failed to pull files")
Expand All @@ -64,7 +64,7 @@ def build_mo(project, podir, lang):
command = ["msgfmt", "-c", "-o",
os.path.join(podir, "%s.mo" % project['name']),
" ".join(glob.glob(os.path.join(podir, "*.po")))]
print(" ".join(command))
print("-> %s" % " ".join(command))
stdout, stderr, exit_status = run_command(command)
if exit_status != 0:
print("Failed to build mo file")
Expand All @@ -76,8 +76,10 @@ def copy_mo_file(project, podir, lang):
print("Copying mo file for %s" % project['name'])
mo_file = "%s.mo" % project['name']
scp.put(os.path.join(podir, mo_file), os.path.join("/tmp", mo_file))
ssh.exec_command("sudo mv %s /usr/share/locale/%s/LC_MESSAGES/%s"
% (os.path.join("/tmp", mo_file), lang, mo_file))
command = "sudo mv %s /usr/share/locale/%s/LC_MESSAGES/%s" \
% (os.path.join("/tmp", mo_file), lang, mo_file)
print("-> %s" % command)
ssh.exec_command(command)


def generate_lua_dict(project, podir, lang):
Expand Down

0 comments on commit 72652e2

Please sign in to comment.