Make internal helper functions private

Added underscore prefix to functions used only internally:
- _strip_tags_and_truncate (used only in parse_post_file)
- _parse_headers (used only in parse_post_file)
- _rfc_2822_format (used only in parse_post_file)
- _make_links_absolute (used only in parse_post_file)
- _strip_html_tags (used only in parse_post_file)
- _get_friendly_date (used only in _setup_page_params)
- _exit_program (used only in monitor.py main loop)

This improves encapsulation by clearly marking implementation details.
This commit is contained in:
Yax 2026-01-07 13:37:55 +01:00
parent 424ea20bcf
commit 13d3d653de
2 changed files with 16 additions and 16 deletions

View file

@ -28,7 +28,7 @@ def get_comment_count():
return 0 if not resp.ok else int(resp.json()["count"])
def exit_program():
def _exit_program():
"""Exit the program with status code 0."""
sys.exit(0)
@ -52,7 +52,7 @@ while True:
for _ in range(15):
time.sleep(60)
if initial_count != get_comment_count():
exit_program()
_exit_program()
# check if git repo changed every 15 minutes
if external_check_cmd and os.system(external_check_cmd):
exit_program()
_exit_program()