fix unicode decode bug (#19) in sample data model

This commit is contained in:
Sina Atalay 2024-02-26 19:42:34 +01:00
parent 25ded71f02
commit b678226fdc
2 changed files with 14 additions and 12 deletions

View File

@ -488,6 +488,7 @@ def cli_command_new(
data_model_as_dictionary = json.loads(data_model_as_json)
yaml_object = ruamel.yaml.YAML()
yaml_object.encoding = "utf-8"
yaml_object.indent(mapping=2, sequence=4, offset=2)
yaml_object.dump(data_model_as_dictionary, file_path)

View File

@ -1109,6 +1109,7 @@ def get_a_sample_data_model(
Returns:
RenderCVDataModel: A sample data model.
"""
name = name.encode().decode("unicode-escape")
sections = {
"summary": [
(
@ -1169,12 +1170,12 @@ def get_a_sample_data_model(
location="WA, USA",
highlights=[
(
"Promoted to Lead Student Ambassador in the Fall of 2004, supervised"
" 10 - 15 Student Ambassadors."
"Promoted to Lead Student Ambassador in the Fall of 2004,"
" supervised 10 - 15 Student Ambassadors."
),
(
"Created and taught a computer science course, CSE 099: Software"
" Design and Development."
"Created and taught a computer science course, CSE 099:"
" Software Design and Development."
),
],
),
@ -1190,14 +1191,14 @@ def get_a_sample_data_model(
" (ctrl-tab) and extended it to tool windows."
),
(
"Created a service to provide gradient across VS and VS add-ins."
" Optimized service via caching."
"Created a service to provide gradient across VS and VS"
" add-ins. Optimized service via caching."
),
"Programmer Productivity Research Center (Summers 2001, 2002)",
(
"Built app to compute the similarity of all methods in a code base,"
" reduced time from $\\mathcal{O}(n^2)$ to $\\mathcal{O}(n"
" \\log n)$. "
"Built app to compute the similarity of all methods in a code"
" base, reduced time from $\\mathcal{O}(n^2)$ to"
" $\\mathcal{O}(n \\log n)$. "
),
(
"Created a test case generation tool that creates random XML"
@ -1213,8 +1214,8 @@ def get_a_sample_data_model(
location="WA, USA",
highlights=[
(
"Promoted to Lead Student Ambassador in the Fall of 2004, supervised"
" 10 - 15 Student Ambassadors."
"Promoted to Lead Student Ambassador in the Fall of 2004,"
" supervised 10 - 15 Student Ambassadors."
),
],
),