@@ -85,10 +85,8 @@ class MplHandler(SocketServer.StreamRequestHandler):
ifFigIDinG_FIGURES:
returnStatus(True,"SERVER: I created the requested Figure with following instructions"+str(FigClass.__name__)+str(datas)+'('+str(args)+', '+str(kwargs)+')')
deftreatUpdateSyncFigure(self,content):
pass
deftreatSyncFigFormatRawData(self,figID):
defgetFigByID(self,figID):
""" Identify the figure by ID and return it. On error it will return a Status Signal"""
# Identify the figure
fig=G_FIGURES.get(figID,None)
...
...
@@ -99,6 +97,33 @@ class MplHandler(SocketServer.StreamRequestHandler):
elifisinstance(fig,MyFig):
ifDEBUG:
print('Figure ',figID,' found in database')
returnfig
deftreatUpdateSyncFigure(self,content):
""" If client request an update of the keywords of a figure. This function forwards the request to the corresponding figure"""
figID,kwargs=content
fig=self.getFigByID(figID)
# if an error occured forward the signal
ifisinstance(fig,Signal):
returnfig
status=fig.update(**kwargs)
ifstatus:
returnStatus(True,'Kewords of figure ID: '+figID+' successfully updated')
else:
returnStatus(False,'Kewords of figure ID: '+figID+' could not be updated')