mirror of https://gitlab.com/bashrc2/epicyon
More profiling
parent
b6c2067c71
commit
1c40d54525
25
daemon.py
25
daemon.py
|
@ -7786,6 +7786,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
curr_session, proxy_type: str) -> None:
|
curr_session, proxy_type: str) -> None:
|
||||||
"""Show person options screen
|
"""Show person options screen
|
||||||
"""
|
"""
|
||||||
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
|
'_GET', '_show_person_options start', debug)
|
||||||
back_to_path = ''
|
back_to_path = ''
|
||||||
options_str = path.split('?options=')[1]
|
options_str = path.split('?options=')[1]
|
||||||
origin_path_str = path.split('?options=')[0]
|
origin_path_str = path.split('?options=')[0]
|
||||||
|
@ -7831,12 +7833,16 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
locked_account = False
|
locked_account = False
|
||||||
also_known_as = None
|
also_known_as = None
|
||||||
moved_to = ''
|
moved_to = ''
|
||||||
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
|
'_GET', '_show_person_options 2', debug)
|
||||||
actor_json = \
|
actor_json = \
|
||||||
get_person_from_cache(base_dir,
|
get_person_from_cache(base_dir,
|
||||||
options_actor,
|
options_actor,
|
||||||
self.server.person_cache,
|
self.server.person_cache,
|
||||||
True)
|
True)
|
||||||
if actor_json:
|
if actor_json:
|
||||||
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
|
'_GET', '_show_person_options 3', debug)
|
||||||
if actor_json.get('movedTo'):
|
if actor_json.get('movedTo'):
|
||||||
moved_to = actor_json['movedTo']
|
moved_to = actor_json['movedTo']
|
||||||
if '"' in moved_to:
|
if '"' in moved_to:
|
||||||
|
@ -7861,14 +7867,26 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
pgp_fingerprint = get_pgp_fingerprint(actor_json)
|
pgp_fingerprint = get_pgp_fingerprint(actor_json)
|
||||||
if actor_json.get('alsoKnownAs'):
|
if actor_json.get('alsoKnownAs'):
|
||||||
also_known_as = actor_json['alsoKnownAs']
|
also_known_as = actor_json['alsoKnownAs']
|
||||||
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
|
'_GET', '_show_person_options 4', debug)
|
||||||
|
|
||||||
if curr_session:
|
if curr_session:
|
||||||
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
|
'_GET', '_show_person_options 5', debug)
|
||||||
|
check_actor_timeout = 2
|
||||||
|
if self.server.domain.endswith('.onion') or \
|
||||||
|
self.server.domain.endswith('.i2p'):
|
||||||
|
# allow more time for a slower response
|
||||||
|
check_actor_timeout = 5
|
||||||
check_for_changed_actor(curr_session,
|
check_for_changed_actor(curr_session,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
options_actor, options_profile_url,
|
options_actor, options_profile_url,
|
||||||
self.server.person_cache, 5)
|
self.server.person_cache,
|
||||||
|
check_actor_timeout)
|
||||||
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
|
'_GET', '_show_person_options 6', debug)
|
||||||
|
|
||||||
access_keys = self.server.access_keys
|
access_keys = self.server.access_keys
|
||||||
if '/users/' in path:
|
if '/users/' in path:
|
||||||
|
@ -7902,7 +7920,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.text_mode_banner,
|
self.server.text_mode_banner,
|
||||||
self.server.news_instance,
|
self.server.news_instance,
|
||||||
authorized,
|
authorized,
|
||||||
access_keys, is_group)
|
access_keys, is_group,
|
||||||
|
getreq_start_time,
|
||||||
|
self.server.fitness,
|
||||||
|
debug)
|
||||||
if msg:
|
if msg:
|
||||||
msg = msg.encode('utf-8')
|
msg = msg.encode('utf-8')
|
||||||
msglen = len(msg)
|
msglen = len(msg)
|
||||||
|
|
|
@ -29,6 +29,7 @@ from webapp_utils import html_header_with_external_style
|
||||||
from webapp_utils import html_footer
|
from webapp_utils import html_footer
|
||||||
from webapp_utils import get_broken_link_substitute
|
from webapp_utils import get_broken_link_substitute
|
||||||
from webapp_utils import html_keyboard_navigation
|
from webapp_utils import html_keyboard_navigation
|
||||||
|
from fitnessFunctions import fitness_performance
|
||||||
|
|
||||||
|
|
||||||
def html_person_options(default_timeline: str,
|
def html_person_options(default_timeline: str,
|
||||||
|
@ -62,19 +63,33 @@ def html_person_options(default_timeline: str,
|
||||||
news_instance: bool,
|
news_instance: bool,
|
||||||
authorized: bool,
|
authorized: bool,
|
||||||
access_keys: {},
|
access_keys: {},
|
||||||
is_group: bool) -> str:
|
is_group: bool,
|
||||||
|
getreq_start_time,
|
||||||
|
fitness: {}, debug: bool) -> str:
|
||||||
"""Show options for a person: view/follow/block/report
|
"""Show options for a person: view/follow/block/report
|
||||||
"""
|
"""
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options start',
|
||||||
|
debug)
|
||||||
|
|
||||||
options_domain, options_port = get_domain_from_actor(options_actor)
|
options_domain, options_port = get_domain_from_actor(options_actor)
|
||||||
if not options_domain:
|
if not options_domain:
|
||||||
return None
|
return None
|
||||||
options_domain_full = get_full_domain(options_domain, options_port)
|
options_domain_full = get_full_domain(options_domain, options_port)
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options get domain',
|
||||||
|
debug)
|
||||||
|
|
||||||
if os.path.isfile(base_dir + '/accounts/options-background-custom.jpg'):
|
if os.path.isfile(base_dir + '/accounts/options-background-custom.jpg'):
|
||||||
if not os.path.isfile(base_dir + '/accounts/options-background.jpg'):
|
if not os.path.isfile(base_dir + '/accounts/options-background.jpg'):
|
||||||
copyfile(base_dir + '/accounts/options-background.jpg',
|
copyfile(base_dir + '/accounts/options-background.jpg',
|
||||||
base_dir + '/accounts/options-background.jpg')
|
base_dir + '/accounts/options-background.jpg')
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options background',
|
||||||
|
debug)
|
||||||
|
|
||||||
dormant = False
|
dormant = False
|
||||||
follow_str = 'Follow'
|
follow_str = 'Follow'
|
||||||
if is_group:
|
if is_group:
|
||||||
|
@ -110,6 +125,10 @@ def html_person_options(default_timeline: str,
|
||||||
options_nickname, options_domain_full):
|
options_nickname, options_domain_full):
|
||||||
block_str = 'Block'
|
block_str = 'Block'
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 1',
|
||||||
|
debug)
|
||||||
|
|
||||||
options_link_str = ''
|
options_link_str = ''
|
||||||
if options_link:
|
if options_link:
|
||||||
options_link_str = \
|
options_link_str = \
|
||||||
|
@ -119,6 +138,10 @@ def html_person_options(default_timeline: str,
|
||||||
if os.path.isfile(base_dir + '/options.css'):
|
if os.path.isfile(base_dir + '/options.css'):
|
||||||
css_filename = base_dir + '/options.css'
|
css_filename = base_dir + '/options.css'
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 2',
|
||||||
|
debug)
|
||||||
|
|
||||||
# To snooze, or not to snooze? That is the question
|
# To snooze, or not to snooze? That is the question
|
||||||
snooze_button_str = 'Snooze'
|
snooze_button_str = 'Snooze'
|
||||||
if nickname:
|
if nickname:
|
||||||
|
@ -132,10 +155,19 @@ def html_person_options(default_timeline: str,
|
||||||
' tabindex="-1""><button class="button" name="submitDonate">' + \
|
' tabindex="-1""><button class="button" name="submitDonate">' + \
|
||||||
translate['Donate'] + '</button></a>\n'
|
translate['Donate'] + '</button></a>\n'
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 3',
|
||||||
|
debug)
|
||||||
|
|
||||||
instance_title = \
|
instance_title = \
|
||||||
get_config_param(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
options_str = \
|
options_str = \
|
||||||
html_header_with_external_style(css_filename, instance_title, None)
|
html_header_with_external_style(css_filename, instance_title, None)
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 4',
|
||||||
|
debug)
|
||||||
|
|
||||||
options_str += html_keyboard_navigation(text_mode_banner, {}, {})
|
options_str += html_keyboard_navigation(text_mode_banner, {}, {})
|
||||||
options_str += '<br><br>\n'
|
options_str += '<br><br>\n'
|
||||||
options_str += '<div class="options">\n'
|
options_str += '<div class="options">\n'
|
||||||
|
@ -196,6 +228,11 @@ def html_person_options(default_timeline: str,
|
||||||
other_accounts_html += '</p>\n'
|
other_accounts_html += '</p>\n'
|
||||||
if ctr > 0:
|
if ctr > 0:
|
||||||
options_str += other_accounts_html
|
options_str += other_accounts_html
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 5',
|
||||||
|
debug)
|
||||||
|
|
||||||
if email_address:
|
if email_address:
|
||||||
options_str += \
|
options_str += \
|
||||||
'<p class="imText">' + translate['Email'] + \
|
'<p class="imText">' + translate['Email'] + \
|
||||||
|
@ -259,6 +296,11 @@ def html_person_options(default_timeline: str,
|
||||||
options_actor + '">\n'
|
options_actor + '">\n'
|
||||||
options_str += ' <input type="hidden" name="avatarUrl" value="' + \
|
options_str += ' <input type="hidden" name="avatarUrl" value="' + \
|
||||||
options_profile_url + '">\n'
|
options_profile_url + '">\n'
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 6',
|
||||||
|
debug)
|
||||||
|
|
||||||
if authorized:
|
if authorized:
|
||||||
if origin_path_str == '/users/' + nickname:
|
if origin_path_str == '/users/' + nickname:
|
||||||
if options_nickname:
|
if options_nickname:
|
||||||
|
@ -273,6 +315,10 @@ def html_person_options(default_timeline: str,
|
||||||
'name="submitPetname">' + \
|
'name="submitPetname">' + \
|
||||||
translate['Submit'] + '</button><br>\n'
|
translate['Submit'] + '</button><br>\n'
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options petname',
|
||||||
|
debug)
|
||||||
|
|
||||||
# Notify when a post arrives from this person
|
# Notify when a post arrives from this person
|
||||||
if is_following_actor(base_dir, nickname, domain, options_actor):
|
if is_following_actor(base_dir, nickname, domain, options_actor):
|
||||||
checkbox_str = \
|
checkbox_str = \
|
||||||
|
@ -301,6 +347,10 @@ def html_person_options(default_timeline: str,
|
||||||
checkbox_str = checkbox_str.replace(' checked>', '>')
|
checkbox_str = checkbox_str.replace(' checked>', '>')
|
||||||
options_str += checkbox_str
|
options_str += checkbox_str
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options following',
|
||||||
|
debug)
|
||||||
|
|
||||||
# checkbox for permission to post to newswire
|
# checkbox for permission to post to newswire
|
||||||
newswire_posts_permitted = False
|
newswire_posts_permitted = False
|
||||||
if options_domain_full == domain_full:
|
if options_domain_full == domain_full:
|
||||||
|
@ -325,6 +375,9 @@ def html_person_options(default_timeline: str,
|
||||||
else:
|
else:
|
||||||
newswire_posts_permitted = True
|
newswire_posts_permitted = True
|
||||||
options_str += checkbox_str
|
options_str += checkbox_str
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options news 1',
|
||||||
|
debug)
|
||||||
|
|
||||||
# whether blogs created by this account are moderated on
|
# whether blogs created by this account are moderated on
|
||||||
# the newswire
|
# the newswire
|
||||||
|
@ -343,6 +396,9 @@ def html_person_options(default_timeline: str,
|
||||||
if not os.path.isfile(moderated_filename):
|
if not os.path.isfile(moderated_filename):
|
||||||
checkbox_str = checkbox_str.replace(' checked>', '>')
|
checkbox_str = checkbox_str.replace(' checked>', '>')
|
||||||
options_str += checkbox_str
|
options_str += checkbox_str
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options news 2',
|
||||||
|
debug)
|
||||||
|
|
||||||
# checkbox for permission to post to featured articles
|
# checkbox for permission to post to featured articles
|
||||||
if news_instance and options_domain_full == domain_full:
|
if news_instance and options_domain_full == domain_full:
|
||||||
|
@ -362,6 +418,13 @@ def html_person_options(default_timeline: str,
|
||||||
options_domain):
|
options_domain):
|
||||||
checkbox_str = checkbox_str.replace(' checked>', '>')
|
checkbox_str = checkbox_str.replace(' checked>', '>')
|
||||||
options_str += checkbox_str
|
options_str += checkbox_str
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options news 3',
|
||||||
|
debug)
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 7',
|
||||||
|
debug)
|
||||||
|
|
||||||
options_str += options_link_str
|
options_str += options_link_str
|
||||||
back_path = '/'
|
back_path = '/'
|
||||||
|
@ -440,6 +503,10 @@ def html_person_options(default_timeline: str,
|
||||||
'accesskey="' + access_keys['enterNotes'] + '">' + \
|
'accesskey="' + access_keys['enterNotes'] + '">' + \
|
||||||
person_notes + '</textarea>\n'
|
person_notes + '</textarea>\n'
|
||||||
|
|
||||||
|
fitness_performance(getreq_start_time, fitness,
|
||||||
|
'_GET', 'html_person_options 8',
|
||||||
|
debug)
|
||||||
|
|
||||||
options_str += \
|
options_str += \
|
||||||
' </form>\n' + \
|
' </form>\n' + \
|
||||||
'</center>\n' + \
|
'</center>\n' + \
|
||||||
|
|
Loading…
Reference in New Issue