Remove profiling

main
Bob Mottram 2022-03-31 11:13:45 +01:00
parent 1c40d54525
commit 815fd3dd88
2 changed files with 2 additions and 69 deletions

View File

@ -7920,10 +7920,7 @@ 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)

View File

@ -29,7 +29,6 @@ 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,
@ -63,33 +62,19 @@ def html_person_options(default_timeline: str,
news_instance: bool, news_instance: bool,
authorized: bool, authorized: bool,
access_keys: {}, access_keys: {},
is_group: bool, is_group: bool) -> str:
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:
@ -125,10 +110,6 @@ 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 = \
@ -138,10 +119,6 @@ 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:
@ -155,19 +132,11 @@ 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'
@ -229,10 +198,6 @@ def html_person_options(default_timeline: str,
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'] + \
@ -297,10 +262,6 @@ def html_person_options(default_timeline: str,
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:
@ -315,10 +276,6 @@ 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 = \
@ -347,10 +304,6 @@ 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:
@ -375,9 +328,6 @@ 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
@ -396,9 +346,6 @@ 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:
@ -418,13 +365,6 @@ 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 = '/'
@ -503,10 +443,6 @@ 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' + \