main
Bob Mottram 2021-03-15 14:30:59 +00:00
parent 5849ef37ff
commit c7eb730c06
1 changed files with 16 additions and 13 deletions

View File

@ -37,9 +37,22 @@ from pgp import pgpEncryptToActor
def _clearScreen() -> None: def _clearScreen() -> None:
"""Clears the screen
"""
os.system('cls' if os.name == 'nt' else 'clear') os.system('cls' if os.name == 'nt' else 'clear')
def _showDesktopBanner() -> None:
"""Shows the banner at the top
"""
bannerFilename = 'theme/starlight/banner.txt'
if os.path.isfile(bannerFilename):
with open(bannerFilename, 'r') as bannerFile:
banner = bannerFile.read()
if banner:
print(banner + '\n')
def _waitForKeypress(timeout: int, debug: bool) -> str: def _waitForKeypress(timeout: int, debug: bool) -> str:
"""Waits for a keypress with a timeout """Waits for a keypress with a timeout
Returns the key pressed, or None on timeout Returns the key pressed, or None on timeout
@ -379,12 +392,7 @@ def _showLocalBox(boxName: str,
# title # title
_clearScreen() _clearScreen()
bannerFilename = 'theme/starlight/banner.txt' _showDesktopBanner()
if os.path.isfile(bannerFilename):
with open(bannerFilename, 'r') as bannerFile:
banner = bannerFile.read()
if banner:
print(banner + '\n')
print(indent + boxName.upper() + '\n') print(indent + boxName.upper() + '\n')
maxPostIndex = len(index) maxPostIndex = len(index)
@ -619,17 +627,12 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
"""Runs the notifications and screen reader client, """Runs the notifications and screen reader client,
which announces new inbox items which announces new inbox items
""" """
indent = ' ' indent = ' '
if showNewPosts: if showNewPosts:
indent = '' indent = ''
_clearScreen() _clearScreen()
bannerFilename = 'theme/starlight/banner.txt' _showDesktopBanner()
if os.path.isfile(bannerFilename):
with open(bannerFilename, 'r') as bannerFile:
banner = bannerFile.read()
if banner:
print(banner + '\n')
espeak = None espeak = None
if screenreader: if screenreader: