Skip to content

Commit

Permalink
lowered the language in main, and remove from other places, but capit…
Browse files Browse the repository at this point in the history
…alize for print statements
  • Loading branch information
SethiShreya committed Oct 31, 2024
1 parent 6a1f13b commit 89f4036
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/scribe_data/cli/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ def convert_wrapper(
None
"""
output_type = output_type.lower()
print(f"Converting data for {language.capitalize()} {data_type.capitalize()} to {output_type}...")
print(
f"Converting data for {language.capitalize()} {data_type.capitalize()} to {output_type}..."
)

# Route the function call to the correct conversion function.
if output_type == "json":
Expand Down
4 changes: 3 additions & 1 deletion src/scribe_data/cli/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def get_data(

elif language or data_type:
data_type = data_type[0] if isinstance(data_type, list) else data_type
print(f"Updating data for language(s): {language.capitalize()}; data type(s): {data_type.capitalize()}")
print(
f"Updating data for language(s): {language.capitalize()}; data type(s): {data_type.capitalize()}"
)
query_data(
languages=languages,
data_type=data_types,
Expand Down
8 changes: 5 additions & 3 deletions src/scribe_data/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ def main() -> None:
elif args.command in ["total", "t"]:
total_wrapper(
language=args.language.lower() if args.language is not None else None,
data_type=args.data_type.lower() if args.data_type is not None else None,
all_bool=args.all
)
data_type=args.data_type.lower()
if args.data_type is not None
else None,
all_bool=args.all,
)

elif args.command in ["convert", "c"]:
convert_wrapper(
Expand Down
2 changes: 1 addition & 1 deletion src/scribe_data/cli/total.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_datatype_list(language):

if not language_data:
raise ValueError(f"Language '{language.capitalize()}' is not recognized.")

data_types = [f.name for f in language_dir.iterdir() if f.is_dir()]
if not data_types:
raise ValueError(
Expand Down
4 changes: 3 additions & 1 deletion src/scribe_data/unicode/generate_emoji_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def generate_emoji(language, output_dir: str = None):
print(f"Emoji Generation for language {language.capitalize()} is supported")

else:
print(f"Emoji Generation for language {language.capitalize()} is not supported")
print(
f"Emoji Generation for language {language.capitalize()} is not supported"
)
return

updated_path = output_dir[2:] if output_dir.startswith("./") else output_dir
Expand Down
8 changes: 6 additions & 2 deletions src/scribe_data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
sub_qid = sub_lang_data.get("qid")

if sub_qid is None:
print(f"Warning: 'qid' missing for sub-language {sub_lang.capitalize()} of {lang.capitalize()}")
print(
f"Warning: 'qid' missing for sub-language {sub_lang.capitalize()} of {lang.capitalize()}"
)

else:
language_map[sub_lang_lower] = sub_lang_data
Expand Down Expand Up @@ -311,7 +313,9 @@ def export_formatted_data(
-------
None
"""
export_path = Path(file_path) / language.capitalize() / f"{data_type.replace('-', '_')}.json"
export_path = (
Path(file_path) / language.capitalize() / f"{data_type.replace('-', '_')}.json"
)

with open(export_path, "w", encoding="utf-8") as file:
json.dump(formatted_data, file, ensure_ascii=False, indent=0)
Expand Down

0 comments on commit 89f4036

Please sign in to comment.