Commit 3242ad3c authored by Yori Fournier's avatar Yori Fournier
Browse files

Now modified the server side such that io functions do no require MplData

format to allow a better merging of data with client.merge_data query
issue is that a MplData object is created on the server side silently...
so the user need to be warned.
parent 8b15762b
......@@ -1007,8 +1007,20 @@ class MplFig(metaclass=FigureClassFactory, context=CONTEXT.lower()):
self.formatted = False
status = False
print('TO ERASE: ' + str(rawdata))
# CONVINIENT: one object for all axes
if isinstance(rawdata, str):
if(self.debug):
print("{dbug} set_rawdata: one item for all axes\
".format(dbug=DBUG))
# This is the trick rawdata becomes a generator (so smart)
self.rawdata = repeat(self.server._rawdata[rawdata])
status = self.format_rawdata()
# DEFAULT: one item per axes in figure
if isinstance(rawdata, Iterable):
elif isinstance(rawdata, Iterable):
if len(rawdata) == len(self.get_axes()):
if(self.debug):
......@@ -1027,16 +1039,6 @@ class MplFig(metaclass=FigureClassFactory, context=CONTEXT.lower()):
len_rawdata=len(rawdata)))
return(False)
# CONVINIENT: one object for all axes
elif isinstance(rawdata, str):
if(self.debug):
print("{dbug} set_rawdata: one item for all axes\
".format(dbug=DBUG))
# This is the trick rawdata becomes a generator (so smart)
self.rawdata = repeat(self.server._rawdata[rawdata])
status = self.format_rawdata()
else:
print("{sevr} set_rawdata: I could not set the rawdata...\
".format(sevr=SEVR))
......
......@@ -47,7 +47,7 @@ class MplHandler(socketserver.StreamRequestHandler):
# Try to execute the instructions
try:
self.server._rawdata[data_name] = fct(*args, **kwargs)
self.server._rawdata[data_name] = MplData(data=fct(*args, **kwargs), name=data_name)
if debug:
print(INFO + "SERVER: I read the data "
"following instructions")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment