mirror of https://gitlab.com/bashrc2/epicyon
Clearing the notification screen
parent
808fb1c10b
commit
bdd3040308
|
@ -36,6 +36,11 @@ from pgp import hasLocalPGPkey
|
||||||
from pgp import pgpEncryptToActor
|
from pgp import pgpEncryptToActor
|
||||||
|
|
||||||
|
|
||||||
|
def _clearScreen() -> None:
|
||||||
|
print(chr(27) + "[2J")
|
||||||
|
print('\x1b[2J')
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
@ -371,7 +376,7 @@ def _showLocalBox(boxName: str,
|
||||||
_sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak)
|
_sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak)
|
||||||
print('')
|
print('')
|
||||||
return
|
return
|
||||||
print(chr(27) + "[2J")
|
_clearScreen()
|
||||||
maxPostIndex = len(index)
|
maxPostIndex = len(index)
|
||||||
index.sort(reverse=True)
|
index.sort(reverse=True)
|
||||||
ctr = 0
|
ctr = 0
|
||||||
|
@ -604,7 +609,7 @@ 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
|
||||||
"""
|
"""
|
||||||
print(chr(27) + "[2J")
|
_clearScreen()
|
||||||
bannerFilename = 'theme/default/banner.txt'
|
bannerFilename = 'theme/default/banner.txt'
|
||||||
if os.path.isfile(bannerFilename):
|
if os.path.isfile(bannerFilename):
|
||||||
with open(bannerFilename, 'r') as bannerFile:
|
with open(bannerFilename, 'r') as bannerFile:
|
||||||
|
@ -806,10 +811,11 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
_storeMessage(speakerJson, 'inbox')
|
_storeMessage(speakerJson, 'inbox')
|
||||||
|
|
||||||
if not showNewPosts:
|
if not showNewPosts:
|
||||||
print(chr(27) + "[2J")
|
_clearScreen()
|
||||||
_showLocalBox(currTimeline,
|
_showLocalBox(currTimeline,
|
||||||
None, systemLanguage, espeak,
|
None, systemLanguage, espeak,
|
||||||
currInboxIndex, 10)
|
currInboxIndex, 10)
|
||||||
|
else:
|
||||||
print('')
|
print('')
|
||||||
|
|
||||||
prevSay = speakerJson['say']
|
prevSay = speakerJson['say']
|
||||||
|
|
Loading…
Reference in New Issue