コード例 #1
0
ファイル: live.py プロジェクト: arbalet-project/frontage
 def callback(self, ch, method, properties, body):
     self.consumme += 1
     listpixels = loads(body.decode('ascii'))
     nuser = loads(Websock.get_grantUser())
     if (nuser.get('id') is None or nuser.get('id') == "turnoff"):
         logging.info("Turn off request")
         self.erase_all()
     elif nuser['id'] != self.user['id']:
         self.user = nuser
         self.erase_all()
         self.set_rgb_matrix(listpixels['pixels'])
     else:
         self.set_rgb_matrix(listpixels['pixels'])
コード例 #2
0
def get_users(user):
    if (not is_admin(user)):
        abort(403, "Forbidden Bru")
    users = (json.loads(Websock.get_users()))['users']
    guser = (json.loads(Websock.get_grantUser()))
    return jsonify(list_clients=users, selected_client=guser)