mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Snake case
							parent
							
								
									580f58eb8b
								
							
						
					
					
						commit
						5d1ea15956
					
				|  | @ -21,23 +21,23 @@ def is_welcome_screen_complete(base_dir: str, | ||||||
|                                nickname: str, domain: str) -> bool: |                                nickname: str, domain: str) -> bool: | ||||||
|     """Returns true if the welcome screen is complete for the given account |     """Returns true if the welcome screen is complete for the given account | ||||||
|     """ |     """ | ||||||
|     accountPath = acct_dir(base_dir, nickname, domain) |     account_path = acct_dir(base_dir, nickname, domain) | ||||||
|     if not os.path.isdir(accountPath): |     if not os.path.isdir(account_path): | ||||||
|         return |         return | ||||||
|     completeFilename = accountPath + '/.welcome_complete' |     complete_filename = account_path + '/.welcome_complete' | ||||||
|     return os.path.isfile(completeFilename) |     return os.path.isfile(complete_filename) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def welcome_screen_is_complete(base_dir: str, | def welcome_screen_is_complete(base_dir: str, | ||||||
|                                nickname: str, domain: str) -> None: |                                nickname: str, domain: str) -> None: | ||||||
|     """Indicates that the welcome screen has been shown for a given account |     """Indicates that the welcome screen has been shown for a given account | ||||||
|     """ |     """ | ||||||
|     accountPath = acct_dir(base_dir, nickname, domain) |     account_path = acct_dir(base_dir, nickname, domain) | ||||||
|     if not os.path.isdir(accountPath): |     if not os.path.isdir(account_path): | ||||||
|         return |         return | ||||||
|     completeFilename = accountPath + '/.welcome_complete' |     complete_filename = account_path + '/.welcome_complete' | ||||||
|     with open(completeFilename, 'w+') as completeFile: |     with open(complete_filename, 'w+') as fp_comp: | ||||||
|         completeFile.write('\n') |         fp_comp.write('\n') | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def html_welcome_screen(base_dir: str, nickname: str, | 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', |             copyfile(base_dir + '/accounts/welcome-background-custom.jpg', | ||||||
|                      base_dir + '/accounts/welcome-background.jpg') |                      base_dir + '/accounts/welcome-background.jpg') | ||||||
| 
 | 
 | ||||||
|     welcomeText = 'Welcome to Epicyon' |     welcome_text = 'Welcome to Epicyon' | ||||||
|     welcomeFilename = base_dir + '/accounts/' + currScreen + '.md' |     welcome_filename = base_dir + '/accounts/' + currScreen + '.md' | ||||||
|     if not os.path.isfile(welcomeFilename): |     if not os.path.isfile(welcome_filename): | ||||||
|         defaultFilename = None |         default_filename = None | ||||||
|         if theme_name: |         if theme_name: | ||||||
|             defaultFilename = \ |             default_filename = \ | ||||||
|                 base_dir + '/theme/' + theme_name + '/welcome/' + \ |                 base_dir + '/theme/' + theme_name + '/welcome/' + \ | ||||||
|                 'welcome_' + language + '.md' |                 'welcome_' + language + '.md' | ||||||
|             if not os.path.isfile(defaultFilename): |             if not os.path.isfile(default_filename): | ||||||
|                 defaultFilename = None |                 default_filename = None | ||||||
|         if not defaultFilename: |         if not default_filename: | ||||||
|             defaultFilename = \ |             default_filename = \ | ||||||
|                 base_dir + '/defaultwelcome/' + \ |                 base_dir + '/defaultwelcome/' + \ | ||||||
|                 currScreen + '_' + language + '.md' |                 currScreen + '_' + language + '.md' | ||||||
|         if not os.path.isfile(defaultFilename): |         if not os.path.isfile(default_filename): | ||||||
|             defaultFilename = \ |             default_filename = \ | ||||||
|                 base_dir + '/defaultwelcome/' + currScreen + '_en.md' |                 base_dir + '/defaultwelcome/' + currScreen + '_en.md' | ||||||
|         copyfile(defaultFilename, welcomeFilename) |         copyfile(default_filename, welcome_filename) | ||||||
| 
 | 
 | ||||||
|     instanceTitle = \ |     instance_title = \ | ||||||
|         get_config_param(base_dir, 'instanceTitle') |         get_config_param(base_dir, 'instanceTitle') | ||||||
|     if not instanceTitle: |     if not instance_title: | ||||||
|         instanceTitle = 'Epicyon' |         instance_title = 'Epicyon' | ||||||
| 
 | 
 | ||||||
|     if os.path.isfile(welcomeFilename): |     if os.path.isfile(welcome_filename): | ||||||
|         with open(welcomeFilename, 'r') as welcomeFile: |         with open(welcome_filename, 'r') as fp_wel: | ||||||
|             welcomeText = welcomeFile.read() |             welcome_text = fp_wel.read() | ||||||
|             welcomeText = welcomeText.replace('INSTANCE', instanceTitle) |             welcome_text = welcome_text.replace('INSTANCE', instance_title) | ||||||
|             welcomeText = markdown_to_html(remove_html(welcomeText)) |             welcome_text = markdown_to_html(remove_html(welcome_text)) | ||||||
| 
 | 
 | ||||||
|     welcomeForm = '' |     welcome_form = '' | ||||||
|     css_filename = base_dir + '/epicyon-welcome.css' |     css_filename = base_dir + '/epicyon-welcome.css' | ||||||
|     if os.path.isfile(base_dir + '/welcome.css'): |     if os.path.isfile(base_dir + '/welcome.css'): | ||||||
|         css_filename = base_dir + '/welcome.css' |         css_filename = base_dir + '/welcome.css' | ||||||
| 
 | 
 | ||||||
|     welcomeForm = \ |     welcome_form = \ | ||||||
|         html_header_with_external_style(css_filename, instanceTitle, None) |         html_header_with_external_style(css_filename, instance_title, None) | ||||||
|     welcomeForm += \ |     welcome_form += \ | ||||||
|         '<form enctype="multipart/form-data" method="POST" ' + \ |         '<form enctype="multipart/form-data" method="POST" ' + \ | ||||||
|         'accept-charset="UTF-8" ' + \ |         'accept-charset="UTF-8" ' + \ | ||||||
|         'action="/users/' + nickname + '/profiledata">\n' |         'action="/users/' + nickname + '/profiledata">\n' | ||||||
|     welcomeForm += '<div class="container">' + welcomeText + '</div>\n' |     welcome_form += '<div class="container">' + welcome_text + '</div>\n' | ||||||
|     welcomeForm += '  <div class="container next">\n' |     welcome_form += '  <div class="container next">\n' | ||||||
|     welcomeForm += \ |     welcome_form += \ | ||||||
|         '    <button type="submit" class="button" ' + \ |         '    <button type="submit" class="button" ' + \ | ||||||
|         'name="previewAvatar">' + translate['Next'] + '</button>\n' |         'name="previewAvatar">' + translate['Next'] + '</button>\n' | ||||||
|     welcomeForm += '  </div>\n' |     welcome_form += '  </div>\n' | ||||||
|     welcomeForm += '</div>\n' |     welcome_form += '</div>\n' | ||||||
|     welcomeForm += '</form>\n' |     welcome_form += '</form>\n' | ||||||
|     welcomeForm += html_footer() |     welcome_form += html_footer() | ||||||
|     return welcomeForm |     return welcome_form | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue