mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
16ff0f0f6d
commit
a181b524e9
|
@ -120,6 +120,39 @@ def _person_options_petname(options_confirm_params: str) -> str:
|
||||||
return petname
|
return petname
|
||||||
|
|
||||||
|
|
||||||
|
def _person_option_receive_petname(self, options_confirm_params: str,
|
||||||
|
petname: str, debug: bool,
|
||||||
|
options_nickname: str,
|
||||||
|
options_domain_full: str,
|
||||||
|
base_dir: str,
|
||||||
|
chooser_nickname: str,
|
||||||
|
domain: str,
|
||||||
|
users_path: str,
|
||||||
|
default_timeline: str,
|
||||||
|
page_number: int,
|
||||||
|
cookie: str,
|
||||||
|
calling_domain: str) -> bool:
|
||||||
|
"""person options screen, petname submit button
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitPetname=' in options_confirm_params and petname:
|
||||||
|
if debug:
|
||||||
|
print('Change petname to ' + petname)
|
||||||
|
handle = options_nickname + '@' + options_domain_full
|
||||||
|
set_pet_name(base_dir,
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
handle, petname)
|
||||||
|
users_path_str = \
|
||||||
|
users_path + '/' + default_timeline + \
|
||||||
|
'?page=' + str(page_number)
|
||||||
|
redirect_headers(self, users_path_str, cookie,
|
||||||
|
calling_domain, 303)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def _person_options_notes(options_confirm_params: str) -> str:
|
def _person_options_notes(options_confirm_params: str) -> str:
|
||||||
"""notes about this person
|
"""notes about this person
|
||||||
"""
|
"""
|
||||||
|
@ -135,6 +168,42 @@ def _person_options_notes(options_confirm_params: str) -> str:
|
||||||
return person_notes
|
return person_notes
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_receive_notes(self, options_confirm_params: str,
|
||||||
|
debug: bool,
|
||||||
|
options_nickname: str,
|
||||||
|
options_domain_full: str,
|
||||||
|
person_notes: str,
|
||||||
|
base_dir: str,
|
||||||
|
chooser_nickname: str,
|
||||||
|
domain: str,
|
||||||
|
users_path: str,
|
||||||
|
default_timeline: str,
|
||||||
|
page_number: int,
|
||||||
|
cookie: str,
|
||||||
|
calling_domain: str) -> bool:
|
||||||
|
"""Person options screen, person notes submit button
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitPersonNotes=' in options_confirm_params:
|
||||||
|
if debug:
|
||||||
|
print('Change person notes')
|
||||||
|
handle = options_nickname + '@' + options_domain_full
|
||||||
|
if not person_notes:
|
||||||
|
person_notes = ''
|
||||||
|
set_person_notes(base_dir,
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
handle, person_notes)
|
||||||
|
users_path_str = \
|
||||||
|
users_path + '/' + default_timeline + \
|
||||||
|
'?page=' + str(page_number)
|
||||||
|
redirect_headers(self, users_path_str, cookie,
|
||||||
|
calling_domain, 303)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def _person_options_view(self, options_confirm_params: str,
|
def _person_options_view(self, options_confirm_params: str,
|
||||||
debug: bool,
|
debug: bool,
|
||||||
options_actor: str,
|
options_actor: str,
|
||||||
|
@ -272,6 +341,91 @@ def _person_options_view(self, options_confirm_params: str,
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_on_calendar(self, options_confirm_params: str,
|
||||||
|
base_dir: str,
|
||||||
|
chooser_nickname: str,
|
||||||
|
domain: str,
|
||||||
|
options_nickname: str,
|
||||||
|
options_domain_full: str,
|
||||||
|
users_path: str,
|
||||||
|
default_timeline: str,
|
||||||
|
page_number: int,
|
||||||
|
cookie: str,
|
||||||
|
calling_domain: str) -> bool:
|
||||||
|
"""Person options screen, on calendar checkbox
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitOnCalendar=' in options_confirm_params:
|
||||||
|
on_calendar = None
|
||||||
|
if 'onCalendar=' in options_confirm_params:
|
||||||
|
on_calendar = options_confirm_params.split('onCalendar=')[1]
|
||||||
|
if '&' in on_calendar:
|
||||||
|
on_calendar = on_calendar.split('&')[0]
|
||||||
|
if on_calendar == 'on':
|
||||||
|
add_person_to_calendar(base_dir,
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
options_nickname,
|
||||||
|
options_domain_full)
|
||||||
|
else:
|
||||||
|
remove_person_from_calendar(base_dir,
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
options_nickname,
|
||||||
|
options_domain_full)
|
||||||
|
users_path_str = \
|
||||||
|
users_path + '/' + default_timeline + \
|
||||||
|
'?page=' + str(page_number)
|
||||||
|
redirect_headers(self, users_path_str, cookie,
|
||||||
|
calling_domain, 303)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_min_images(self, options_confirm_params: str,
|
||||||
|
base_dir: str,
|
||||||
|
chooser_nickname: str,
|
||||||
|
domain: str,
|
||||||
|
options_nickname: str,
|
||||||
|
options_domain_full: str,
|
||||||
|
users_path: str,
|
||||||
|
default_timeline: str,
|
||||||
|
page_number: int,
|
||||||
|
cookie: str,
|
||||||
|
calling_domain: str) -> bool:
|
||||||
|
"""Person options screen, minimize images checkbox
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitMinimizeImages=' in options_confirm_params:
|
||||||
|
minimize_images = None
|
||||||
|
if 'minimizeImages=' in options_confirm_params:
|
||||||
|
minimize_images = \
|
||||||
|
options_confirm_params.split('minimizeImages=')[1]
|
||||||
|
if '&' in minimize_images:
|
||||||
|
minimize_images = minimize_images.split('&')[0]
|
||||||
|
if minimize_images == 'on':
|
||||||
|
person_minimize_images(base_dir,
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
options_nickname,
|
||||||
|
options_domain_full)
|
||||||
|
else:
|
||||||
|
person_undo_minimize_images(base_dir,
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
options_nickname,
|
||||||
|
options_domain_full)
|
||||||
|
users_path_str = \
|
||||||
|
users_path + '/' + default_timeline + \
|
||||||
|
'?page=' + str(page_number)
|
||||||
|
redirect_headers(self, users_path_str, cookie,
|
||||||
|
calling_domain, 303)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def person_options2(self, path: str,
|
def person_options2(self, path: str,
|
||||||
calling_domain: str, cookie: str,
|
calling_domain: str, cookie: str,
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
|
@ -440,99 +594,59 @@ def person_options2(self, path: str,
|
||||||
calling_domain):
|
calling_domain):
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, petname submit button
|
if _person_option_receive_petname(self, options_confirm_params,
|
||||||
# See html_person_options
|
petname, debug,
|
||||||
if '&submitPetname=' in options_confirm_params and petname:
|
options_nickname,
|
||||||
if debug:
|
options_domain_full,
|
||||||
print('Change petname to ' + petname)
|
base_dir,
|
||||||
handle = options_nickname + '@' + options_domain_full
|
chooser_nickname,
|
||||||
set_pet_name(base_dir,
|
domain,
|
||||||
chooser_nickname,
|
users_path,
|
||||||
domain,
|
default_timeline,
|
||||||
handle, petname)
|
page_number,
|
||||||
users_path_str = \
|
cookie,
|
||||||
users_path + '/' + default_timeline + \
|
calling_domain):
|
||||||
'?page=' + str(page_number)
|
|
||||||
redirect_headers(self, users_path_str, cookie,
|
|
||||||
calling_domain, 303)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, person notes submit button
|
if _person_options_receive_notes(self, options_confirm_params,
|
||||||
# See html_person_options
|
debug,
|
||||||
if '&submitPersonNotes=' in options_confirm_params:
|
options_nickname,
|
||||||
if debug:
|
options_domain_full,
|
||||||
print('Change person notes')
|
person_notes,
|
||||||
handle = options_nickname + '@' + options_domain_full
|
base_dir,
|
||||||
if not person_notes:
|
chooser_nickname,
|
||||||
person_notes = ''
|
domain,
|
||||||
set_person_notes(base_dir,
|
users_path,
|
||||||
chooser_nickname,
|
default_timeline,
|
||||||
domain,
|
page_number,
|
||||||
handle, person_notes)
|
cookie,
|
||||||
users_path_str = \
|
calling_domain):
|
||||||
users_path + '/' + default_timeline + \
|
|
||||||
'?page=' + str(page_number)
|
|
||||||
redirect_headers(self, users_path_str, cookie,
|
|
||||||
calling_domain, 303)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, on calendar checkbox
|
if _person_options_on_calendar(self, options_confirm_params,
|
||||||
# See html_person_options
|
base_dir,
|
||||||
if '&submitOnCalendar=' in options_confirm_params:
|
|
||||||
on_calendar = None
|
|
||||||
if 'onCalendar=' in options_confirm_params:
|
|
||||||
on_calendar = options_confirm_params.split('onCalendar=')[1]
|
|
||||||
if '&' in on_calendar:
|
|
||||||
on_calendar = on_calendar.split('&')[0]
|
|
||||||
if on_calendar == 'on':
|
|
||||||
add_person_to_calendar(base_dir,
|
|
||||||
chooser_nickname,
|
chooser_nickname,
|
||||||
domain,
|
domain,
|
||||||
options_nickname,
|
options_nickname,
|
||||||
options_domain_full)
|
options_domain_full,
|
||||||
else:
|
users_path,
|
||||||
remove_person_from_calendar(base_dir,
|
default_timeline,
|
||||||
chooser_nickname,
|
page_number,
|
||||||
domain,
|
cookie,
|
||||||
options_nickname,
|
calling_domain):
|
||||||
options_domain_full)
|
|
||||||
users_path_str = \
|
|
||||||
users_path + '/' + default_timeline + \
|
|
||||||
'?page=' + str(page_number)
|
|
||||||
redirect_headers(self, users_path_str, cookie,
|
|
||||||
calling_domain, 303)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, minimize images checkbox
|
if _person_options_min_images(self, options_confirm_params,
|
||||||
# See html_person_options
|
base_dir,
|
||||||
if '&submitMinimizeImages=' in options_confirm_params:
|
chooser_nickname,
|
||||||
minimize_images = None
|
domain,
|
||||||
if 'minimizeImages=' in options_confirm_params:
|
options_nickname,
|
||||||
minimize_images = \
|
options_domain_full,
|
||||||
options_confirm_params.split('minimizeImages=')[1]
|
users_path,
|
||||||
if '&' in minimize_images:
|
default_timeline,
|
||||||
minimize_images = minimize_images.split('&')[0]
|
page_number,
|
||||||
if minimize_images == 'on':
|
cookie,
|
||||||
person_minimize_images(base_dir,
|
calling_domain):
|
||||||
chooser_nickname,
|
|
||||||
domain,
|
|
||||||
options_nickname,
|
|
||||||
options_domain_full)
|
|
||||||
else:
|
|
||||||
person_undo_minimize_images(base_dir,
|
|
||||||
chooser_nickname,
|
|
||||||
domain,
|
|
||||||
options_nickname,
|
|
||||||
options_domain_full)
|
|
||||||
users_path_str = \
|
|
||||||
users_path + '/' + default_timeline + \
|
|
||||||
'?page=' + str(page_number)
|
|
||||||
redirect_headers(self, users_path_str, cookie,
|
|
||||||
calling_domain, 303)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, allow announces checkbox
|
# person options screen, allow announces checkbox
|
||||||
|
|
Loading…
Reference in New Issue