diff --git a/ofsted_childrens_services_inspection_scrape.py b/ofsted_childrens_services_inspection_scrape.py index 4dcc8b2..2812687 100644 --- a/ofsted_childrens_services_inspection_scrape.py +++ b/ofsted_childrens_services_inspection_scrape.py @@ -1201,7 +1201,7 @@ def save_to_html(data, column_order, local_link_column=None, web_link_column=Non data.rename(columns={'Ltla23Cd': 'LTLA23CD', 'Urn': 'URN'}, inplace=True) - # Generate Most-recent-reports list + # Generate 'Most-recent-reports' list (last updated list) # Remove this block if running locally (i.e. not in GitCodespace) # # Obtain list of those inspection reports that have updates @@ -1218,12 +1218,12 @@ def save_to_html(data, column_order, local_link_column=None, web_link_column=Non raise try: - # Get current status of repo + # get current status of repo changed_files = [item.a_path for item in repo.index.diff(None) if item.a_path.startswith(inspection_reports_folder)] # untracked_files = repo.untracked_files - # changed repo files into a list for later use - las_with_new_inspection_list = [file for file in changed_files] + # remove the inspection_reports_folder path prefix from the file paths, create last updated list + las_with_new_inspection_list = [os.path.relpath(file, inspection_reports_folder) for file in changed_files] except Exception as e: print(f"Error processing repository: {e}") @@ -1232,7 +1232,7 @@ def save_to_html(data, column_order, local_link_column=None, web_link_column=Non # Chk + remove onward use of var las_with_new_inspection_list if running locally - # Initialise HTML content with title and CSS + # init HTML content with title and CSS html_content = f"""