Added logging for updated files
This commit is contained in:
@ -256,6 +256,7 @@ def process_service(args, service):
|
|||||||
repo_dir = None
|
repo_dir = None
|
||||||
git_repo = None
|
git_repo = None
|
||||||
error_list = []
|
error_list = []
|
||||||
|
files_updated = 0
|
||||||
|
|
||||||
repo = None
|
repo = None
|
||||||
for r in service["repositories"]:
|
for r in service["repositories"]:
|
||||||
@ -352,6 +353,7 @@ def process_service(args, service):
|
|||||||
|
|
||||||
if add_sphinx_metadata(rst_file, description, keywords):
|
if add_sphinx_metadata(rst_file, description, keywords):
|
||||||
updated_count += 1
|
updated_count += 1
|
||||||
|
files_updated += 1
|
||||||
logging.info(f"Added meta description and keywords to {rst_file}")
|
logging.info(f"Added meta description and keywords to {rst_file}")
|
||||||
else:
|
else:
|
||||||
processed_count += 1
|
processed_count += 1
|
||||||
@ -387,6 +389,8 @@ def process_service(args, service):
|
|||||||
|
|
||||||
logging.info(f"Processed {processed_count} files, updated {updated_count} files")
|
logging.info(f"Processed {processed_count} files, updated {updated_count} files")
|
||||||
|
|
||||||
|
return files_updated
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
@ -445,7 +449,7 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
services = []
|
services = []
|
||||||
if args.service_type:
|
if args.service_type:
|
||||||
@ -453,8 +457,24 @@ def main():
|
|||||||
else:
|
else:
|
||||||
services = data.services_with_repos()
|
services = data.services_with_repos()
|
||||||
|
|
||||||
|
total_files_updated = 0
|
||||||
|
services_with_updates = []
|
||||||
|
|
||||||
for service in services:
|
for service in services:
|
||||||
process_service(args, service)
|
files_updated = process_service(args, service)
|
||||||
|
if files_updated > 0:
|
||||||
|
total_files_updated += files_updated
|
||||||
|
services_with_updates.append((service['service_title'], files_updated))
|
||||||
|
|
||||||
|
print("\n" + "=" * 60)
|
||||||
|
print("SUMMARY")
|
||||||
|
print("=" * 60)
|
||||||
|
print(f"Total files with metadata added: {total_files_updated}")
|
||||||
|
print(f"Services with updates: {len(services_with_updates)}")
|
||||||
|
print("\nServices with metadata added:")
|
||||||
|
for service_title, count in services_with_updates:
|
||||||
|
print(f" - {service_title}: {count} file(s)")
|
||||||
|
print("=" * 60)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user