From 6267065790cd8b329a31757c577fdc383eefcdde Mon Sep 17 00:00:00 2001 From: andrie Date: Sat, 10 Aug 2024 23:09:11 +0100 Subject: [PATCH] Allow for exclusion of files --- docs/exercises/helpers/__init__.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/exercises/helpers/__init__.py b/docs/exercises/helpers/__init__.py index 9ee002f..b487ced 100644 --- a/docs/exercises/helpers/__init__.py +++ b/docs/exercises/helpers/__init__.py @@ -143,13 +143,19 @@ def problem_app_express(folder_name) -> None: # Parameters: # - folder_name: relative folder path # - app: If True, expects an app (app.py) and if False, expects a problem (app.py and app-solution.py) -def problem_tabs_express(folder_name:str, app:bool = False) -> None: +def problem_tabs_express( + folder_name:str, + app:bool = False, + app_exclusions:list = [], + sol_exclusions:list = [], + ) -> None: path = os.path.basename(folder_name) path = os.path.join(path, "problem") path = "problem" - # path = - # path = folder_name - # folder_name = path + + app_exclusions = ["app-solution.py", "README"] + app_exclusions + sol_exclusions = ["app.py", "README"] + sol_exclusions + prompt = parse_readme("problem") @@ -181,7 +187,8 @@ def problem_tabs_express(folder_name:str, app:bool = False) -> None: _include_shiny_folder( path, "app.py", - exclusions=["app-solution.py", "README"] + exclusions=app_exclusions + # exclusions=["app-solution.py", "README"] ) ) else: @@ -200,7 +207,7 @@ def problem_tabs_express(folder_name:str, app:bool = False) -> None: _include_shiny_folder( path, "app-solution.py", - exclusions=["app.py", "README"] + exclusions=sol_exclusions ) ) else: