Snake case

main
Bob Mottram 2022-01-03 23:36:57 +00:00
parent 46e8eb7244
commit 74e953ce3b
1 changed files with 15 additions and 15 deletions

View File

@ -15,11 +15,11 @@ def is_minimal(base_dir: str, domain: str, nickname: str) -> bool:
"""Returns true if minimal buttons should be shown """Returns true if minimal buttons should be shown
for the given account for the given account
""" """
accountDir = acct_dir(base_dir, nickname, domain) account_dir = acct_dir(base_dir, nickname, domain)
if not os.path.isdir(accountDir): if not os.path.isdir(account_dir):
return True return True
minimalFilename = accountDir + '/.notminimal' minimal_filename = account_dir + '/.notminimal'
if os.path.isfile(minimalFilename): if os.path.isfile(minimal_filename):
return False return False
return True return True
@ -28,19 +28,19 @@ def set_minimal(base_dir: str, domain: str, nickname: str,
minimal: bool) -> None: minimal: bool) -> None:
"""Sets whether an account should display minimal buttons """Sets whether an account should display minimal buttons
""" """
accountDir = acct_dir(base_dir, nickname, domain) account_dir = acct_dir(base_dir, nickname, domain)
if not os.path.isdir(accountDir): if not os.path.isdir(account_dir):
return return
minimalFilename = accountDir + '/.notminimal' minimal_filename = account_dir + '/.notminimal'
minimalFileExists = os.path.isfile(minimalFilename) minimal_file_exists = os.path.isfile(minimal_filename)
if minimal and minimalFileExists: if minimal and minimal_file_exists:
try: try:
os.remove(minimalFilename) os.remove(minimal_filename)
except OSError: except OSError:
print('EX: set_minimal unable to delete ' + minimalFilename) print('EX: set_minimal unable to delete ' + minimal_filename)
elif not minimal and not minimalFileExists: elif not minimal and not minimal_file_exists:
try: try:
with open(minimalFilename, 'w+') as fp: with open(minimal_filename, 'w+') as fp_min:
fp.write('\n') fp_min.write('\n')
except OSError: except OSError:
print('EX: unable to write minimal ' + minimalFilename) print('EX: unable to write minimal ' + minimal_filename)