Remove default function arguments

main
Bob Mottram 2024-05-01 11:41:43 +01:00
parent 5913ddc823
commit 86b8e379f1
3 changed files with 13 additions and 11 deletions

10
blog.py
View File

@ -47,7 +47,7 @@ from cache import get_person_from_cache
def _no_of_blog_replies(base_dir: str, http_prefix: str, translate: {},
nickname: str, domain: str, domain_full: str,
post_id: str, depth: int = 0) -> int:
post_id: str, depth: int) -> int:
"""Returns the number of replies on the post
This is recursive, so can handle replies to replies
"""
@ -116,7 +116,7 @@ def _no_of_blog_replies(base_dir: str, http_prefix: str, translate: {},
def _get_blog_replies(base_dir: str, http_prefix: str, translate: {},
nickname: str, domain: str, domain_full: str,
post_id: str, depth: int = 0) -> str:
post_id: str, depth: int) -> str:
"""Returns a string containing html blog posts
"""
if depth > 4:
@ -337,7 +337,7 @@ def _html_blog_post_content(debug: bool, session, authorized: bool,
replies = _no_of_blog_replies(base_dir, http_prefix, translate,
nickname, domain, domain_full,
post_json_object['object']['id'])
post_json_object['object']['id'], 0)
# separator between blogs should be centered
if '<center>' not in blog_separator:
@ -357,13 +357,13 @@ def _html_blog_post_content(debug: bool, session, authorized: bool,
blog_str += \
_get_blog_replies(base_dir, http_prefix, translate,
nickname, domain, domain_full,
post_json_object['object']['id'])
post_json_object['object']['id'], 0)
else:
obj_id = post_json_object['object']['id']
blog_replies_str = \
_get_blog_replies(base_dir, http_prefix,
translate, nickname,
domain, domain_full, obj_id)
domain, domain_full, obj_id, 0)
blog_str += blog_replies_str.replace('>' + title_str + '<', '')
return blog_str

View File

@ -234,7 +234,7 @@ def get_user_url(wf_request: {}, source_id: int, debug: bool) -> str:
def parse_user_feed(signing_priv_key_pem: str,
session, feed_url: str, as_header: {},
project_version: str, http_prefix: str,
origin_domain: str, debug: bool, depth: int = 0) -> []:
origin_domain: str, debug: bool, depth: int) -> []:
"""Returns a feed of posts for an account url
"""
if depth > 10:
@ -600,7 +600,7 @@ def _get_posts(session, outbox_url: str, max_posts: int,
user_feed = parse_user_feed(signing_priv_key_pem,
session, outbox_url, as_header,
project_version, http_prefix,
origin_domain, debug)
origin_domain, debug, 0)
if user_feed:
for item in user_feed:
result.append(item)
@ -615,7 +615,7 @@ def _get_posts(session, outbox_url: str, max_posts: int,
user_feed = parse_user_feed(signing_priv_key_pem,
session, outbox_url, as_header,
project_version, http_prefix,
origin_domain, debug)
origin_domain, debug, 0)
if not user_feed:
return person_posts
@ -832,7 +832,8 @@ def get_post_domains(session, outbox_url: str, max_posts: int, debug: bool,
i = 0
user_feed = parse_user_feed(signing_priv_key_pem,
session, outbox_url, as_header,
project_version, http_prefix, domain, debug)
project_version, http_prefix, domain,
debug, 0)
if not user_feed:
return post_domains
@ -900,7 +901,8 @@ def _get_posts_for_blocked_domains(base_dir: str,
i = 0
user_feed = parse_user_feed(signing_priv_key_pem,
session, outbox_url, as_header,
project_version, http_prefix, domain, debug)
project_version, http_prefix, domain,
debug, 0)
if not user_feed:
return blocked_posts

View File

@ -503,7 +503,7 @@ def html_profile_after_search(authorized: bool,
user_feed = \
parse_user_feed(signing_priv_key_pem,
session, outbox_url, as_header, project_version,
http_prefix, from_domain, debug)
http_prefix, from_domain, debug, 0)
if not user_feed:
if debug:
print('DEBUG: no user feed in profile preview')