From c192f361a5247204f582db1226a0bd3ed0b8c600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torje=20Ho=C3=A5s=20Digernes?= Date: Thu, 17 Oct 2013 15:12:43 +0200 Subject: [PATCH] bluedart added bluedart display images and does som message passing --- blueDart.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 blueDart.py diff --git a/blueDart.py b/blueDart.py new file mode 100755 index 0000000..cd9ca18 --- /dev/null +++ b/blueDart.py @@ -0,0 +1,38 @@ +#!/usr/bin/python +import os +import threading +import time +import Queue +import signal +import subprocess +import collections + +q = Queue.Queue() + +ls = collections.deque( ["5XTtUYV.jpg", "dwarfEntrance.png", "CD16E4u.jpg" ]) + +def showstuff(): + while ( True ): + sb = subprocess.Popen(["feh", "-Z", "-g" ,"800x400",ls[0]]) + while( True ): + a = q.get() + print a + if ( a == "stop" ): + sb.terminate() + exit() + elif ( a == "next"): + ls.rotate(1) + sb.terminate() + break + + +def amin(): + showOff = threading.Thread(target=showstuff) + showOff.start() + for i in range(6): + time.sleep(5) + q.put("next") + time.sleep(2) + q.put("stop") + +amin()