diff --git a/webapp_welcome_profile.py b/webapp_welcome_profile.py index 950c981c0..81fc21d22 100644 --- a/webapp_welcome_profile.py +++ b/webapp_welcome_profile.py @@ -34,100 +34,102 @@ def html_welcome_profile(base_dir: str, nickname: str, domain: str, copyfile(base_dir + '/accounts/welcome-background-custom.jpg', base_dir + '/accounts/welcome-background.jpg') - profileText = 'Welcome to Epicyon' - profileFilename = base_dir + '/accounts/welcome_profile.md' - if not os.path.isfile(profileFilename): - defaultFilename = None + profile_text = 'Welcome to Epicyon' + profile_filename = base_dir + '/accounts/welcome_profile.md' + if not os.path.isfile(profile_filename): + default_filename = None if theme_name: - defaultFilename = \ + default_filename = \ base_dir + '/theme/' + theme_name + '/welcome/' + \ 'profile_' + language + '.md' - if not os.path.isfile(defaultFilename): - defaultFilename = None - if not defaultFilename: - defaultFilename = \ + if not os.path.isfile(default_filename): + default_filename = None + if not default_filename: + default_filename = \ base_dir + '/defaultwelcome/profile_' + language + '.md' - if not os.path.isfile(defaultFilename): - defaultFilename = base_dir + '/defaultwelcome/profile_en.md' - copyfile(defaultFilename, profileFilename) + if not os.path.isfile(default_filename): + default_filename = base_dir + '/defaultwelcome/profile_en.md' + copyfile(default_filename, profile_filename) - instanceTitle = \ + instance_title = \ get_config_param(base_dir, 'instanceTitle') - if not instanceTitle: - instanceTitle = 'Epicyon' + if not instance_title: + instance_title = 'Epicyon' - if os.path.isfile(profileFilename): - with open(profileFilename, 'r') as profileFile: - profileText = profileFile.read() - profileText = profileText.replace('INSTANCE', instanceTitle) - profileText = markdown_to_html(remove_html(profileText)) + if os.path.isfile(profile_filename): + with open(profile_filename, 'r') as fp_pro: + profile_text = fp_pro.read() + profile_text = profile_text.replace('INSTANCE', instance_title) + profile_text = markdown_to_html(remove_html(profile_text)) - profileForm = '' + profile_form = '' css_filename = base_dir + '/epicyon-welcome.css' if os.path.isfile(base_dir + '/welcome.css'): css_filename = base_dir + '/welcome.css' - profileForm = \ - html_header_with_external_style(css_filename, instanceTitle, None) + profile_form = \ + html_header_with_external_style(css_filename, instance_title, None) # get the url of the avatar + ext = 'png' for ext in get_image_extensions(): - avatarFilename = \ + avatar_filename = \ acct_dir(base_dir, nickname, domain) + '/avatar.' + ext - if os.path.isfile(avatarFilename): + if os.path.isfile(avatar_filename): break - avatarUrl = \ - local_actor_url(http_prefix, nickname, domain_full) + '/avatar.' + ext + avatar_url = \ + local_actor_url(http_prefix, nickname, domain_full) + \ + '/avatar.' + ext - imageFormats = get_image_formats() - profileForm += '