mirror of
https://github.com/rendercv/rendercv.git
synced 2025-12-23 21:47:55 -05:00
data: refactor types
This commit is contained in:
@@ -87,11 +87,11 @@ text_entry = (
|
||||
)
|
||||
|
||||
|
||||
def dictionary_to_yaml(dictionary: dict[str, Any]):
|
||||
def dictionary_to_yaml(dictionary: dict):
|
||||
"""Converts a dictionary to a YAML string.
|
||||
|
||||
Args:
|
||||
dictionary (dict[str, Any]): The dictionary to be converted to YAML.
|
||||
dictionary (dict): The dictionary to be converted to YAML.
|
||||
Returns:
|
||||
str: The YAML string.
|
||||
"""
|
||||
|
||||
@@ -14,11 +14,11 @@ import ruamel.yaml
|
||||
from . import models, reader
|
||||
|
||||
|
||||
def dictionary_to_yaml(dictionary: dict[str, Any]) -> str:
|
||||
def dictionary_to_yaml(dictionary: dict) -> str:
|
||||
"""Converts a dictionary to a YAML string.
|
||||
|
||||
Args:
|
||||
dictionary (dict[str, Any]): The dictionary to be converted to YAML.
|
||||
dictionary (dict): The dictionary to be converted to YAML.
|
||||
|
||||
Returns:
|
||||
str: The YAML string.
|
||||
@@ -110,7 +110,7 @@ def create_a_sample_yaml_input_file(
|
||||
return yaml_string
|
||||
|
||||
|
||||
def generate_json_schema() -> dict[str, Any]:
|
||||
def generate_json_schema() -> dict:
|
||||
"""Generate the JSON schema of RenderCV.
|
||||
|
||||
JSON schema is generated for the users to make it easier for them to write the input
|
||||
|
||||
@@ -113,7 +113,7 @@ def get_characteristic_entry_attributes(
|
||||
|
||||
|
||||
def get_entry_type_name_and_section_validator(
|
||||
entry: dict[str, Any] | str | Type, entry_types: list[Type]
|
||||
entry: dict[str, str | list[str]] | str | Type, entry_types: list[Type]
|
||||
) -> tuple[str, Type[SectionBase]]:
|
||||
"""Get the entry type name and the section validator based on the entry.
|
||||
|
||||
@@ -122,7 +122,7 @@ def get_entry_type_name_and_section_validator(
|
||||
type.
|
||||
|
||||
Args:
|
||||
entry (dict[str, Any] | str): The entry to determine its type.
|
||||
entry (dict[str, str | list[str]] | str): The entry to determine its type.
|
||||
entry_types (list[Type]): The entry types to determine the entry type. These
|
||||
are not instances of the entry types, but the entry types themselves. `str`
|
||||
type should not be included in this list.
|
||||
|
||||
Reference in New Issue
Block a user