Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Garel <alex@openfoodfacts.org>
  • Loading branch information
benbenben2 and alexgarel authored Mar 5, 2024
1 parent 3a14edd commit 5338afe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/update_tags_per_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def main():
if tag in map_tags_field_url_dic:
map_tags_field_url_parameter[tag] = map_tags_field_url_dic[tag]
else:
print("This tag is not known:", tag)
print("This tag is not known:", tag, file=sys.stderr)
sys.exit()

if env == "prod":
Expand All @@ -339,7 +339,7 @@ def main():
env = "net"
user = "off:off@"
else:
print("Environment should be 'prod' or 'dev', unexpected value:", env)
print("Environment should be 'prod' or 'dev', unexpected value:", env, file=sys.stderr)
sys.exit()

for plural, singular in map_tags_field_url_parameter.items():
Expand Down Expand Up @@ -384,9 +384,9 @@ def main():
with open(log_file_name_1.format(plural=plural), 'r') as log_file_1:
# skip header
log_file_1.readline()
for line in log_file_1:
key, value = line.strip().split(',')
possible_wrong_language_tags[key] = value
possible_wrong_language_tags = dict(
line.strip().split(',', 1) for line in log_file_1
)

resume = False
if os.path.getsize(log_file_name_2.format(plural=plural)) != 0:
Expand Down

0 comments on commit 5338afe

Please sign in to comment.