Skip to content

refactor: centralize output generation in TemplateManager#87

Merged
drkrillo merged 2 commits into
drkrillo:mainfrom
keshavsharma0614-blip:main
May 19, 2026
Merged

refactor: centralize output generation in TemplateManager#87
drkrillo merged 2 commits into
drkrillo:mainfrom
keshavsharma0614-blip:main

Conversation

@keshavsharma0614-blip
Copy link
Copy Markdown
Contributor

Summary

Refactored output generation responsibilities by moving write_output from update_issues.py into TemplateManager to better centralize rendering and output-related functionality.

Changes Made

  • Moved write_output into TemplateManager
  • Updated update_issues.py to use TemplateManager.write_output(...)
  • Removed redundant CSV/JSON output logic from update_issues.py
  • Improved separation of concerns by consolidating output handling

Why

This aligns output generation responsibilities with the existing rendering architecture, making the codebase cleaner, more maintainable, and easier to extend.

Copy link
Copy Markdown
Owner

@drkrillo drkrillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great implementation!

I like that you deleted the unnecesary imports in the update_issues.py.
Also the improved readability in the new static method for CSV headers.

Thanks for also taking the tame to improve some other things here. Like new lines for better readability in toher funcitons, and deleting the tabs in render_template function

Thanks for contributing!

Comment thread app/core/api_handler.py
Comment on lines 106 to +131
@@ -121,24 +122,61 @@ def render_template(csv_path, template_path, today):

with open(csv_path, newline='', encoding='utf-8') as f:
reader = csv.DictReader(f)

for row in reader:
results.append({
'repo': row['repo'],
'repo': row['repo'],
'language': row['language'],
'title': row['title'],
'url': row['url'],
'title': row['title'],
'url': row['url'],
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you deleted those unnecesary tabs there!

Comment thread app/core/api_handler.py

return rendered_readme

@staticmethod
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect implementation with the static method, and improved readability in the CSV columns by using new lines instead all in the same one!

Comment thread app/update_issues.py

if args.output:
write_output(formatted_response, args.output)
TemplateManager.write_output(formatted_response, args.output)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect call for a static method here!

@drkrillo drkrillo merged commit 22b872f into drkrillo:main May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants