Esempio n. 1
0
def main(args):
    while True:
        body = getEmail()
        if body != "":
            coordsFile = open(os.path.dirname(__file__) + "/coords.json")
            coordMap = json.loads(coordsFile.read())
            coordsFile.close()

            culprit = parseEmail(body)

            if coordMap[culprit] is not None:
                print "firing on " + culprit
                coordinates = coordMap[culprit]
                argStr = "led 1 " + coordMap[culprit] + " fire 1 led 0 reset"
                args = argStr.split()

                args.insert(0, "retaliation.py")
                try:
                    print "retaliation.py " + argStr
                    retaliation.main(args)
                except:
                    print "Something went wrong in retaliation.py"
        time.sleep(5)
Esempio n. 2
0
import pygame, sys
import retaliation

pygame.init()
BLACK = (0,0,0)
WIDTH = 50
HEIGHT = 50
windowSurface = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32)

windowSurface.fill(BLACK)

while True:
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_RIGHT:
                print "You pressed right"
                retaliation.main(["retaliation.py", "right", "25"])
                pass
            if event.type == "QUIT":
                pygame.quit()
                sys.exit()
Esempio n. 3
0
File: run.py Progetto: crabl/silo
def reset():
  retaliation.main(['', 'reset'])
  return "OK"
Esempio n. 4
0
File: run.py Progetto: crabl/silo
def fire():
  retaliation.main(['', 'fire'])
  return "OK"
Esempio n. 5
0
File: run.py Progetto: crabl/silo
def move_down():
  amount = request.args["amount"]
  retaliation.main(['', 'down', amount])
  return "OK"
Esempio n. 6
0
File: run.py Progetto: crabl/silo
def move_up():
  amount = request.args["amount"]
  retaliation.main(['', 'up', amount])
  return "OK"
Esempio n. 7
0
File: run.py Progetto: crabl/silo
def move_left():
  amount = request.args["amount"]
  retaliation.main(['', 'left', amount])
  return "OK"