Commit 77baa8cd authored by Philipp Gast's avatar Philipp Gast
Browse files

some clean up I forgot to check in

parent 3261e6f8
......@@ -123,12 +123,16 @@ class MyFigClient(Figure):
print('The figure could not be deleted on the server Side')
else:
print(
'The client is not connected to a server yet. Please use the client to set up a sync conection.')
'The client is not connected to a server yet.'
'Please use the client to set up a sync conection.')
def get_state(self):
""" this function collects the current state of in the figure by creating a dict that holds all keyword,value pairs (taking the aliases into account)
""" this function collects the current state of in the figure
by creating a dict that holds all keyword,value pairs
(taking the aliases into account)
Warning: myplotlib allows in a transparent manner to modify the axes directly. Those changes can not be covert.
Warning: myplotlib allows in a transparent manner to modify
the axes directly. Those changes can not be covert.
"""
state = dict()
# test for double keywords and print a waring
......@@ -155,7 +159,8 @@ class MyFigClient(Figure):
print(
'Warning: The keyword \"',
key,
'\" appears in multiple axes. The Defaults will be overwritten. Prevent this by using aliases')
'\" appears in multiple axes. The Defaults will'
' be overwritten. Prevent this by using aliases')
# update the global keyword index
state.update(ax_keywords)
......@@ -178,7 +183,8 @@ class MyFigClient(Figure):
self.sync_id = newFig.sync_id
else:
print(
'The client is not connected to a server yet. Please use the client to set up a sync conection.')
'The client is not connected to a server yet. '
'Please use the client to set up a sync conection.')
# INITIALIZE -------------------------------------------------------
def _initialize(self, *args, **kwargs):
......@@ -292,17 +298,19 @@ class MyFigClient(Figure):
print(SEVR + "The axes name ", name, " was not found")
return None
#~ def getAxesName(self,unknownax) :
#~ """ compares all axes against the function parameter and returns the name of that axes if found in figure"""
#~
#~ for ax in self.get_axes() :
#~ if unknownax == ax :
#~ return ax.name
def get_axes_name(self,unknownax) :
""" compares all axes against the function parameter and
returns the name of that axes if found in figure"""
for ax in self.get_axes() :
if unknownax == ax :
return ax.name
# SET RAW DATA -----------------------------------------------------
def set_rawdata(self, rawdata):
''' This function sets loacally the names of the remote data in a similar way as a local figure would do.
Warning : No consitancy checking is done. The server side will report the errors.
''' This function sets loacally the names of the remote data
in a similar way as a local figure would do.
Warning : No consitancy checking is done. The server
side will report the errors.
'''
self.remote_rawdata = rawdata
......@@ -313,16 +321,10 @@ class MyFigClient(Figure):
synchronized figure (server-side) """
if (self.client is not None) and (self.sync_id != -1):
# try:
if (True):
datas = self.client.sync_fig_format_raw_data(self.sync_id)
# except:
# print(SEVR+'The server-side figure could not format the data...')
# return(False)
for ax, data in zip(self.get_axes(), datas):
# each data is a string that can be unpacked by axes itself
# ax.data = ax.unpackFormattedData(data)
ax.data = data
else:
......
......@@ -100,7 +100,7 @@ class RemoteFigTestCase(unittest.TestCase):
self.assertEqual(self.server.getFigByID(str(fig1.syncID)).getAxesByName('p1').keywords['xRange'],[-2, 2])
self.assertEqual(self.server.getFigByID(str(fig1.syncID)).getAxesByName('p1').keywords['yRange'],[-2, 2])
# compare client and server side keywords
# compare client and server side keywords after an update call
self.assertEqual(fig1.getAxesByName('p1').keywords,self.server.getFigByID(str(fig1.syncID)).getAxesByName('p1').keywords)
#~ def test_re_sync(self):
......
Supports Markdown
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