feat(rcf): append right tools
This commit is contained in:
15
client.py
15
client.py
@ -214,13 +214,16 @@ class RCFClientAgent(object):
|
||||
if value:
|
||||
key_id = self.id
|
||||
|
||||
if override:
|
||||
key_id = value['id'].encode()
|
||||
# if override:
|
||||
# key_id = value['id'].encode()
|
||||
|
||||
rcfmsg = message.RCFMessage(
|
||||
key=key, id=key_id, mtype="", body=value)
|
||||
key=key, id=key_id, body=value)
|
||||
|
||||
rcfmsg.store(self.property_map)
|
||||
|
||||
if override:
|
||||
helpers.load(key,self.property_map[key].body)
|
||||
rcfmsg.send(self.publisher)
|
||||
else:
|
||||
logger.error("Fail to dump ")
|
||||
@ -238,7 +241,7 @@ class RCFClientAgent(object):
|
||||
value['id'] = self.id.decode()
|
||||
if value:
|
||||
rcfmsg = message.RCFMessage(
|
||||
key=key, id=self.id, mtype="", body=value)
|
||||
key=key, id=self.id, body=value)
|
||||
|
||||
rcfmsg.store(self.property_map)
|
||||
rcfmsg.send(self.publisher)
|
||||
@ -333,6 +336,10 @@ def rcf_client_agent(ctx, pipe, queue):
|
||||
if rcfmsg.id != agent.id:
|
||||
# update_queue.put((rcfmsg.key,rcfmsg.body))
|
||||
|
||||
try:
|
||||
logger.info(rcfmsg.body['id'])
|
||||
except:
|
||||
pass
|
||||
with lock:
|
||||
helpers.load(rcfmsg.key, rcfmsg.body)
|
||||
rcfmsg.store(agent.property_map)
|
||||
|
@ -12,20 +12,16 @@ class RCFMessage(object):
|
||||
Message is formatted on wire as 2 frames:
|
||||
frame 0: key (0MQ string) // property path
|
||||
frame 1: id (0MQ string) // property path
|
||||
frame 2: mtype (0MQ string) // property path
|
||||
frame 3: body (blob) // Could be any data
|
||||
|
||||
"""
|
||||
key = None # key (string)
|
||||
id = None # User (string)
|
||||
mtype = None # data mtype (string)
|
||||
body = None # data blob
|
||||
|
||||
|
||||
def __init__(self, key=None, id=None, mtype=None, body=None):
|
||||
def __init__(self, key=None, id=None, body=None):
|
||||
self.key = key
|
||||
|
||||
self.mtype = mtype
|
||||
self.body = body
|
||||
self.id = id
|
||||
|
||||
@ -72,10 +68,9 @@ class RCFMessage(object):
|
||||
else:
|
||||
size = len(self.body)
|
||||
data = repr(self.body)
|
||||
print("[key:{key}][size:{size}][mtype:{mtype}] {data}".format(
|
||||
print("[key:{key}][size:{size}] {data}".format(
|
||||
key=self.key,
|
||||
size=size,
|
||||
mtype=self.mtype,
|
||||
data=data,
|
||||
))
|
||||
|
||||
|
@ -416,6 +416,7 @@ class session_rights(bpy.types.Operator):
|
||||
if net_settings.is_admin:
|
||||
val = client_instance.get(self.key)
|
||||
val[0][1]['id'] = net_settings.clients
|
||||
|
||||
|
||||
client_instance.set(key=self.key, value=val[0][1],override=True)
|
||||
|
||||
|
Reference in New Issue
Block a user