aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-06-13 11:49:48 +0200
committerMattias Andrée <maandree@operamail.com>2013-06-13 11:49:48 +0200
commita77f3b871c14ef50a0b13ad0e059fd0c8320e28f (patch)
treee554b8be57e97e2e2fa299c219af5883f10a7633
parentdone (diff)
downloadunstickpixels-a77f3b871c14ef50a0b13ad0e059fd0c8320e28f.tar.gz
unstickpixels-a77f3b871c14ef50a0b13ad0e059fd0c8320e28f.tar.bz2
unstickpixels-a77f3b871c14ef50a0b13ad0e059fd0c8320e28f.tar.xz
minor improvement with flush
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rwxr-xr-xunstickpixels4
1 files changed, 4 insertions, 0 deletions
diff --git a/unstickpixels b/unstickpixels
index 0c4ad91..2068ea8 100755
--- a/unstickpixels
+++ b/unstickpixels
@@ -24,6 +24,7 @@ from subprocess import Popen, PIPE
def print(text, end = '\n'):
sys.stdout.buffer.write((text + end).encode('utf-8'))
+ sys.stdout.buffer.flush()
(height, width) = Popen(['stty', 'size'], stdout=PIPE).communicate()[0].decode('utf-8', 'replace').split(' ')
@@ -56,8 +57,11 @@ try:
print('\033[H', '')
while True:
sys.stdout.buffer.write('\033]P0FF0000\033[2J'.encode('utf-8'))
+ sys.stdout.buffer.flush()
sys.stdout.buffer.write('\033]P000FF00\033[2J'.encode('utf-8'))
+ sys.stdout.buffer.flush()
sys.stdout.buffer.write('\033]P00000FF\033[2J'.encode('utf-8'))
+ sys.stdout.buffer.flush()
except:
pass
if started: