Refactor function names for clarity and accuracy
Renamed functions to better reflect their actual behavior: - truncate → strip_tags_and_truncate (does both operations) - fix_relative_links → make_links_absolute (converts, not fixes) - clean_html_tag → strip_html_tags (more explicit) - clean_site → rebuild_site_directory (removes and recreates) - read_headers → parse_headers (parses, not just reads) - read_content → parse_post_file (full processing pipeline) - get_nb_of_comments → get_comment_count (removes French abbreviation)
This commit is contained in:
parent
f5df515d2b
commit
424ea20bcf
2 changed files with 23 additions and 23 deletions
|
|
@ -14,7 +14,7 @@ def fread(filename):
|
|||
return f.read()
|
||||
|
||||
|
||||
def get_nb_of_comments():
|
||||
def get_comment_count():
|
||||
"""Fetch the total number of comments from Stacosys API.
|
||||
|
||||
Returns:
|
||||
|
|
@ -45,13 +45,13 @@ if os.path.isfile("params.json"):
|
|||
params.update(json.loads(fread("params.json")))
|
||||
|
||||
external_check_cmd = params["external_check"]
|
||||
initial_count = get_nb_of_comments()
|
||||
initial_count = get_comment_count()
|
||||
print(f"Comments = {initial_count}")
|
||||
while True:
|
||||
# check number of comments every 60 seconds
|
||||
for _ in range(15):
|
||||
time.sleep(60)
|
||||
if initial_count != get_nb_of_comments():
|
||||
if initial_count != get_comment_count():
|
||||
exit_program()
|
||||
# check if git repo changed every 15 minutes
|
||||
if external_check_cmd and os.system(external_check_cmd):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue