diff --git a/.gitignore b/.gitignore index a8e501f0032529b7fb206ad50fb5c5a84ec099a9..69b341f25c21e547dfee3bc3ec953a336541439d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ java/.classpath .project .classpath **/.*.swp +.*.sw[a-z] +*.un~ +Session.vim + diff --git a/python/src/ipaaca.py b/python/src/ipaaca.py index eccf93c9f4fac26cf651c04575a5e048dd7773c2..a23d279c26b1650c449226a65fe1800ebc54cae8 100755 --- a/python/src/ipaaca.py +++ b/python/src/ipaaca.py @@ -210,23 +210,23 @@ class IUInterface(object): #{{{ '''Attempt to add links if the conditions are met and send an update message. Then call the local setter.''' if not hasattr(targets, '__iter__'): targets=[targets] - self._modify_links(links=self, is_delta=True, new_links={type:targets}, links_to_remove={}, writer_name=writer_name) + self._modify_links(is_delta=True, new_links={type:targets}, links_to_remove={}, writer_name=writer_name) self._add_and_remove_links( add={type:targets}, remove={} ) def remove_links(self, type, targets, writer_name=None): '''Attempt to remove links if the conditions are met and send an update message. Then call the local setter.''' if not hasattr(targets, '__iter__'): targets=[targets] - self._modify_links(links=self, is_delta=True, new_links={}, links_to_remove={type:targets}, writer_name=writer_name) + self._modify_links(is_delta=True, new_links={}, links_to_remove={type:targets}, writer_name=writer_name) self._add_and_remove_links( add={}, remove={type:targets} ) def modify_links(self, add, remove, writer_name=None): '''Attempt to modify links if the conditions are met and send an update message. Then call the local setter.''' - self._modify_links(links=self, is_delta=True, new_links=add, links_to_remove=remove, writer_name=writer_name) + self._modify_links(is_delta=True, new_links=add, links_to_remove=remove, writer_name=writer_name) self._add_and_remove_links( add=add, remove=remove ) def set_links(self, links, writer_name=None): '''Attempt to set (replace) links if the conditions are met and send an update message. Then call the local setter.''' - self._modify_links(links=self, is_delta=False, new_links=links, links_to_remove={}, writer_name=writer_name) + self._modify_links(is_delta=False, new_links=links, links_to_remove={}, writer_name=writer_name) self._replace_links( links=links ) def get_links(self, type): return set(self._links[type]) @@ -300,7 +300,7 @@ class IU(IUInterface):#{{{ self.revision_lock = threading.RLock() self._payload = Payload(iu=self) - def _modify_links(self, links, is_delta=False, new_links={}, links_to_remove={}, writer_name=None): + def _modify_links(self, is_delta=False, new_links={}, links_to_remove={}, writer_name=None): if self.committed: raise IUCommittedError(self) with self.revision_lock: @@ -412,7 +412,7 @@ class RemotePushIU(IUInterface):#{{{ self._payload = Payload(iu=self, new_payload=payload, omit_init_update_message=True) self._links = links - def _modify_links(self, links, is_delta=False, new_links={}, links_to_remove={}, writer_name=None): + def _modify_links(self, is_delta=False, new_links={}, links_to_remove={}, writer_name=None): """Modify the links: add or remove item from this payload remotely and send update.""" if self.committed: raise IUCommittedError(self) diff --git a/python/test/src/ipaacaspam.py b/python/test/src/ipaacaspam.py index bca8ccb3f6da1e92b2b772a9c9a1ef724cea1300..69722ad4a1f213e3eac4a395e2705cf899e1f9b4 100755 --- a/python/test/src/ipaacaspam.py +++ b/python/test/src/ipaacaspam.py @@ -66,6 +66,7 @@ class Sender(object): def __init__(self, send_frequency): self.ob = ipaaca.OutputBuffer('PowerOut') self.iu = ipaaca.IU('spam') + self.data_prefix='A'*1024; self.iu.payload = {'data':'0'} self.ob.add(self.iu) self.counter = 0 @@ -79,6 +80,17 @@ class Sender(object): time.sleep(self.delay) self.counter += 1 self.iu.payload['data'] = str(self.counter) + #self.iu.payload = { + # 'data':self.data_prefix, + # 'data2':self.data_prefix, + # 'data3':self.data_prefix, + # 'data4':self.data_prefix, + # 'data5':self.data_prefix, + # 'data6':self.data_prefix, + # 'data7':self.data_prefix, + # 'data8':self.data_prefix, + # 'data9':self.data_prefix, + # } if self.counter == 1000: print "Sent 1k updates at", int(1000.0/(time.time()-last_time)),"Hz" last_time = time.time()