add menacing "FEED ME!"
authorMark Tearle <mtearle@ucc.gu.uwa.edu.au>
Sun, 24 Feb 2008 11:43:02 +0000 (11:43 +0000)
committerMark Tearle <mtearle@ucc.gu.uwa.edu.au>
Sun, 24 Feb 2008 11:43:02 +0000 (11:43 +0000)
sql-edition/servers/VendServer.py

index 00e33b1..eff58e0 100755 (executable)
@@ -748,8 +748,24 @@ def handle_grandfather_tick(state, event, params, v, vstatus):
                vstatus.change_state(STATE_IDLE,1)
 
 def handle_door_idle(state, event, params, v, vstatus):
+       def twiddle(clock,v,wise = 2):
+               if (clock % 4 == 0):
+                       v.display("-FEED  ME-")
+               elif (clock % 4 == 1+wise):
+                       v.display("\\FEED  ME/")
+               elif (clock % 4 == 2):
+                       v.display("-FEED  ME-")
+               elif (clock % 4 == 3-wise):
+                       v.display("/FEED  ME\\")
+
        # don't care right now.
-       pass
+       now = int(time())
+
+       if ((now % 60 % 2) == 0):
+               twiddle(now, v)
+       else:
+               twiddle(now, v, wise=0)
+
 
 def handle_door_event(state, event, params, v, vstatus):
        if params == 0:  #door open

UCC git Repository :: git.ucc.asn.au