From 7372774270bb934802bf65cb894e4c44aa233d4d Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Tue, 22 Sep 2015 21:58:58 +0200 Subject: [PATCH] Added parameters to fullwhite.py --- animations/fullwhite.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/animations/fullwhite.py b/animations/fullwhite.py index 628658f..450a7db 100644 --- a/animations/fullwhite.py +++ b/animations/fullwhite.py @@ -1,7 +1,10 @@ #!/usr/bin/env python2 +import sys + from random import randint from time import sleep + from twinklclient import TwinklSocket, TwinklMessage HEIGHT = 8 @@ -31,10 +34,13 @@ def set_box(x,y,r,g,b): +if len(sys.argv) != 3: + print "Usage: %s host priority" % sys.argv[0] + sys.exit(1) -socket = TwinklSocket("localhost", "1337") +socket = TwinklSocket(sys.argv[1], "1337") -msg.set_priority(0); +msg.set_priority(int(sys.argv[2])) for x in range(0, WIDTH): for y in range(0, HEIGHT):