Reverse the minimal file logic to make minimal buttons the default

main
Bob Mottram 2020-10-16 10:19:48 +01:00
parent a5d2bfd412
commit 25831b2994
1 changed files with 7 additions and 7 deletions

View File

@ -305,11 +305,11 @@ class PubServer(BaseHTTPRequestHandler):
accountDir = self.server.baseDir + '/accounts/' + \ accountDir = self.server.baseDir + '/accounts/' + \
nickname + '@' + self.server.domain nickname + '@' + self.server.domain
if not os.path.isdir(accountDir): if not os.path.isdir(accountDir):
return False
minimalFilename = accountDir + '/minimal'
if os.path.isfile(minimalFilename):
return True return True
return False minimalFilename = accountDir + '/.notminimal'
if os.path.isfile(minimalFilename):
return False
return True
def _setMinimal(self, nickname: str, minimal: bool) -> None: def _setMinimal(self, nickname: str, minimal: bool) -> None:
"""Sets whether an account should display minimal buttons """Sets whether an account should display minimal buttons
@ -318,11 +318,11 @@ class PubServer(BaseHTTPRequestHandler):
nickname + '@' + self.server.domain nickname + '@' + self.server.domain
if not os.path.isdir(accountDir): if not os.path.isdir(accountDir):
return return
minimalFilename = accountDir + '/minimal' minimalFilename = accountDir + '/.notminimal'
minimalFileExists = os.path.isfile(minimalFilename) minimalFileExists = os.path.isfile(minimalFilename)
if not minimal and minimalFileExists: if minimal and minimalFileExists:
os.remove(minimalFilename) os.remove(minimalFilename)
elif minimal and not minimalFileExists: elif not minimal and not minimalFileExists:
with open(minimalFilename, 'w+') as fp: with open(minimalFilename, 'w+') as fp:
fp.write('\n') fp.write('\n')