mirror of https://gitlab.com/bashrc2/epicyon
Remove default function arguments
parent
5913ddc823
commit
86b8e379f1
10
blog.py
10
blog.py
|
@ -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
|
||||
|
|
12
posts.py
12
posts.py
|
@ -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
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue