def get(a): hardwareType = a cur = mysql.connect().cursor() cur.execute("select * from mugsy.pinMappings WHERE hardwareType=(%s)",hardwareType) r = [dict((cur.description[i][0], value) for i, value in enumerate(row)) for row in cur.fetchall()] return {'pinInfo' : r }
def get(a): coffeeTypeId = a cur = mysql.connect().cursor() cur.execute("select * from mugsy.coffeeTypes WHERE coffeeTypeId=(%s)",coffeeTypeId) r = [dict((cur.description[i][0], value) for i, value in enumerate(row)) for row in cur.fetchall()] return {'brewSettings' : r}
def get(a): user = a cur = mysql.connect().cursor() cur.execute("select * from mugsy.brewSettings WHERE userID=(%s)",user) r = [dict((cur.description[i][0], value) for i, value in enumerate(row)) for row in cur.fetchall()] return {'brewSettings' : r}
def get(self): count = 1 while(count < 12): contents = scan() count = len(contents) duringScan() else: for line in open("/var/mugsy/decaf/helpers/upc.txt"): last=line barcode = [last.rstrip('\n')] afterScan() cur = mysql.connect().cursor() cur.execute("select * from mugsy.coffeeTypes WHERE upc=(%s)",barcode) r = [dict((cur.description[i][0], value) for i, value in enumerate(row)) for row in cur.fetchall()] return {'coffeeInfo' : r}