From 5d1ea159569fefbedec009a60327d8b964ea7bd0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 4 Jan 2022 14:48:02 +0000 Subject: [PATCH] Snake case --- webapp_welcome.py | 82 +++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/webapp_welcome.py b/webapp_welcome.py index 716ea6c16..56bbd0346 100644 --- a/webapp_welcome.py +++ b/webapp_welcome.py @@ -21,23 +21,23 @@ def is_welcome_screen_complete(base_dir: str, nickname: str, domain: str) -> bool: """Returns true if the welcome screen is complete for the given account """ - accountPath = acct_dir(base_dir, nickname, domain) - if not os.path.isdir(accountPath): + account_path = acct_dir(base_dir, nickname, domain) + if not os.path.isdir(account_path): return - completeFilename = accountPath + '/.welcome_complete' - return os.path.isfile(completeFilename) + complete_filename = account_path + '/.welcome_complete' + return os.path.isfile(complete_filename) def welcome_screen_is_complete(base_dir: str, nickname: str, domain: str) -> None: """Indicates that the welcome screen has been shown for a given account """ - accountPath = acct_dir(base_dir, nickname, domain) - if not os.path.isdir(accountPath): + account_path = acct_dir(base_dir, nickname, domain) + if not os.path.isdir(account_path): return - completeFilename = accountPath + '/.welcome_complete' - with open(completeFilename, 'w+') as completeFile: - completeFile.write('\n') + complete_filename = account_path + '/.welcome_complete' + with open(complete_filename, 'w+') as fp_comp: + fp_comp.write('\n') def html_welcome_screen(base_dir: str, nickname: str, @@ -52,54 +52,54 @@ def html_welcome_screen(base_dir: str, nickname: str, copyfile(base_dir + '/accounts/welcome-background-custom.jpg', base_dir + '/accounts/welcome-background.jpg') - welcomeText = 'Welcome to Epicyon' - welcomeFilename = base_dir + '/accounts/' + currScreen + '.md' - if not os.path.isfile(welcomeFilename): - defaultFilename = None + welcome_text = 'Welcome to Epicyon' + welcome_filename = base_dir + '/accounts/' + currScreen + '.md' + if not os.path.isfile(welcome_filename): + default_filename = None if theme_name: - defaultFilename = \ + default_filename = \ base_dir + '/theme/' + theme_name + '/welcome/' + \ 'welcome_' + 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/' + \ currScreen + '_' + language + '.md' - if not os.path.isfile(defaultFilename): - defaultFilename = \ + if not os.path.isfile(default_filename): + default_filename = \ base_dir + '/defaultwelcome/' + currScreen + '_en.md' - copyfile(defaultFilename, welcomeFilename) + copyfile(default_filename, welcome_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(welcomeFilename): - with open(welcomeFilename, 'r') as welcomeFile: - welcomeText = welcomeFile.read() - welcomeText = welcomeText.replace('INSTANCE', instanceTitle) - welcomeText = markdown_to_html(remove_html(welcomeText)) + if os.path.isfile(welcome_filename): + with open(welcome_filename, 'r') as fp_wel: + welcome_text = fp_wel.read() + welcome_text = welcome_text.replace('INSTANCE', instance_title) + welcome_text = markdown_to_html(remove_html(welcome_text)) - welcomeForm = '' + welcome_form = '' css_filename = base_dir + '/epicyon-welcome.css' if os.path.isfile(base_dir + '/welcome.css'): css_filename = base_dir + '/welcome.css' - welcomeForm = \ - html_header_with_external_style(css_filename, instanceTitle, None) - welcomeForm += \ + welcome_form = \ + html_header_with_external_style(css_filename, instance_title, None) + welcome_form += \ '
\n' - welcomeForm += '
' + welcomeText + '
\n' - welcomeForm += ' \n' - welcomeForm += '
\n' - welcomeForm += html_footer() - return welcomeForm + welcome_form += ' \n' + welcome_form += '\n' + welcome_form += '\n' + welcome_form += html_footer() + return welcome_form