mirror of https://github.com/eyhc1/rendercv.git
renderer: remove `output_directory_path` argument from `copy_theme_files_to_output_directory`
This commit is contained in:
parent
37120928bb
commit
6d77686abd
|
@ -828,7 +828,6 @@ def generate_markdown_file(
|
||||||
def copy_theme_files_to_output_directory(
|
def copy_theme_files_to_output_directory(
|
||||||
theme_name: str,
|
theme_name: str,
|
||||||
output_directory_path: pathlib.Path,
|
output_directory_path: pathlib.Path,
|
||||||
theme_directory_path: Optional[pathlib.Path] = None,
|
|
||||||
):
|
):
|
||||||
"""Copy the auxiliary files (all the files that don't end with `.j2.tex` and `.py`)
|
"""Copy the auxiliary files (all the files that don't end with `.j2.tex` and `.py`)
|
||||||
of the theme to the output directory. For example, the "classic" theme has custom
|
of the theme to the output directory. For example, the "classic" theme has custom
|
||||||
|
@ -839,21 +838,20 @@ def copy_theme_files_to_output_directory(
|
||||||
theme_name (str): The name of the theme.
|
theme_name (str): The name of the theme.
|
||||||
output_directory (pathlib.Path): Path to the output directory.
|
output_directory (pathlib.Path): Path to the output directory.
|
||||||
"""
|
"""
|
||||||
if theme_directory_path is None:
|
if theme_name in dm.available_themes:
|
||||||
if theme_name in dm.available_themes:
|
theme_directory_path = importlib.resources.files(
|
||||||
theme_directory_path = importlib.resources.files(
|
f"rendercv.themes.{theme_name}"
|
||||||
f"rendercv.themes.{theme_name}"
|
)
|
||||||
)
|
else:
|
||||||
else:
|
# Then it means the theme is a custom theme. If theme_directory is not given
|
||||||
# Then it means the theme is a custom theme. If theme_directory is not given
|
# as an argument, then look for the theme in the current working directory.
|
||||||
# as an argument, then look for the theme in the current working directory.
|
theme_directory_path = pathlib.Path(pathlib.Path.cwd()) / theme_name
|
||||||
theme_directory_path = pathlib.Path(pathlib.Path.cwd()) / theme_name
|
|
||||||
|
|
||||||
if not theme_directory_path.is_dir():
|
if not theme_directory_path.is_dir():
|
||||||
raise FileNotFoundError(
|
raise FileNotFoundError(
|
||||||
f"The theme {theme_name} doesn't exist in the current working"
|
f"The theme {theme_name} doesn't exist in the current working"
|
||||||
" directory!"
|
" directory!"
|
||||||
)
|
)
|
||||||
|
|
||||||
for theme_file in theme_directory_path.iterdir():
|
for theme_file in theme_directory_path.iterdir():
|
||||||
dont_copy_files_with_these_extensions = [".j2.tex", ".py"]
|
dont_copy_files_with_these_extensions = [".j2.tex", ".py"]
|
||||||
|
|
Loading…
Reference in New Issue