import variable names

main
Bob Mottram 2023-02-10 17:04:26 +00:00
parent 1fe000adb1
commit 507085494e
3 changed files with 13 additions and 13 deletions

View File

@ -6173,9 +6173,9 @@ class PubServer(BaseHTTPRequestHandler):
'banner', 'search_banner', 'banner', 'search_banner',
'instanceLogo', 'instanceLogo',
'left_col_image', 'right_col_image', 'left_col_image', 'right_col_image',
'submitImportFollows', 'import_follows',
'submitImportBlocks', 'import_blocks',
'submitImportTheme' 'import_theme'
) )
profile_media_types_uploaded = {} profile_media_types_uploaded = {}
for m_type in profile_media_types: for m_type in profile_media_types:
@ -6208,7 +6208,7 @@ class PubServer(BaseHTTPRequestHandler):
if m_type == 'instanceLogo': if m_type == 'instanceLogo':
filename_base = \ filename_base = \
base_dir + '/accounts/login.temp' base_dir + '/accounts/login.temp'
elif m_type == 'submitImportTheme': elif m_type == 'import_theme':
if not os.path.isdir(base_dir + '/imports'): if not os.path.isdir(base_dir + '/imports'):
os.mkdir(base_dir + '/imports') os.mkdir(base_dir + '/imports')
filename_base = \ filename_base = \
@ -6219,11 +6219,11 @@ class PubServer(BaseHTTPRequestHandler):
except OSError: except OSError:
print('EX: _profile_edit unable to delete ' + print('EX: _profile_edit unable to delete ' +
filename_base) filename_base)
elif m_type == 'submitImportFollows': elif m_type == 'import_follows':
filename_base = \ filename_base = \
acct_dir(base_dir, nickname, domain) + \ acct_dir(base_dir, nickname, domain) + \
'/import_following.csv' '/import_following.csv'
elif m_type == 'submitImportBlocks': elif m_type == 'import_blocks':
filename_base = \ filename_base = \
acct_dir(base_dir, nickname, domain) + \ acct_dir(base_dir, nickname, domain) + \
'/import_blocks.csv' '/import_blocks.csv'
@ -6243,7 +6243,7 @@ class PubServer(BaseHTTPRequestHandler):
' media, zip, csv or font filename in POST') ' media, zip, csv or font filename in POST')
continue continue
if m_type == 'submitImportFollows': if m_type == 'import_follows':
if os.path.isfile(filename_base): if os.path.isfile(filename_base):
print(nickname + ' imported follows csv') print(nickname + ' imported follows csv')
else: else:
@ -6251,7 +6251,7 @@ class PubServer(BaseHTTPRequestHandler):
nickname) nickname)
continue continue
if m_type == 'submitImportBlocks': if m_type == 'import_blocks':
if os.path.isfile(filename_base): if os.path.isfile(filename_base):
blocks_import_succeeded = False blocks_import_succeeded = False
if import_blocks(base_dir, nickname, domain, if import_blocks(base_dir, nickname, domain,
@ -6270,7 +6270,7 @@ class PubServer(BaseHTTPRequestHandler):
nickname) nickname)
continue continue
if m_type == 'submitImportTheme': if m_type == 'import_theme':
if nickname == admin_nickname or \ if nickname == admin_nickname or \
is_artist(base_dir, nickname): is_artist(base_dir, nickname):
if import_theme(base_dir, filename): if import_theme(base_dir, filename):

View File

@ -1540,7 +1540,7 @@ def _html_edit_profile_graphic_design(base_dir: str, translate: {}) -> str:
' <label class="labels">' + \ ' <label class="labels">' + \
translate['Import Theme'] + '</label>\n' translate['Import Theme'] + '</label>\n'
graphics_str += ' <input type="file" id="import_theme" ' graphics_str += ' <input type="file" id="import_theme" '
graphics_str += 'name="submitImportTheme" ' graphics_str += 'name="import_theme" '
graphics_str += 'accept="' + THEME_FORMATS + '">\n' graphics_str += 'accept="' + THEME_FORMATS + '">\n'
graphics_str += \ graphics_str += \
' <label class="labels">' + \ ' <label class="labels">' + \
@ -2049,7 +2049,7 @@ def _html_edit_profile_filtering(base_dir: str, nickname: str, domain: str,
' <label class="labels">' + \ ' <label class="labels">' + \
translate['Import Blocks'] + '</label>\n' translate['Import Blocks'] + '</label>\n'
edit_profile_form += ' <input type="file" id="import_blocks" ' edit_profile_form += ' <input type="file" id="import_blocks" '
edit_profile_form += 'name="submitImportBlocks" ' edit_profile_form += 'name="import_blocks" '
edit_profile_form += 'accept="' + BLOCKFILE_FORMATS + '">\n' edit_profile_form += 'accept="' + BLOCKFILE_FORMATS + '">\n'
edit_profile_form += \ edit_profile_form += \
' <label class="labels">' + \ ' <label class="labels">' + \
@ -2282,7 +2282,7 @@ def _html_edit_profile_import_export(nickname: str, domain: str,
'<p><label class="labels">' + \ '<p><label class="labels">' + \
translate['Import Follows'] + '</label>\n' translate['Import Follows'] + '</label>\n'
edit_profile_form += '<input type="file" id="import_follows" ' edit_profile_form += '<input type="file" id="import_follows" '
edit_profile_form += 'name="submitImportFollows" ' edit_profile_form += 'name="import_follows" '
edit_profile_form += 'accept=".csv"></p>\n' edit_profile_form += 'accept=".csv"></p>\n'
edit_profile_form += \ edit_profile_form += \

View File

@ -334,7 +334,7 @@ def html_theme_designer(base_dir: str,
' <label class="labels">' + \ ' <label class="labels">' + \
translate['Import Theme'] + '</label>\n' translate['Import Theme'] + '</label>\n'
export_import_str += ' <input type="file" id="import_theme" ' export_import_str += ' <input type="file" id="import_theme" '
export_import_str += 'name="submitImportTheme" ' export_import_str += 'name="import_theme" '
export_import_str += 'accept="' + theme_formats + '">\n' export_import_str += 'accept="' + theme_formats + '">\n'
export_import_str += \ export_import_str += \
' <label class="labels">' + \ ' <label class="labels">' + \