Skip to content

Commit

Permalink
Add debug prints for issue tango-controls#292
Browse files Browse the repository at this point in the history
  • Loading branch information
reszelaz committed Feb 7, 2020
1 parent 1836d31 commit 4f3fb72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tango/device_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,6 @@ def __DeviceProxy__subscribe_event_global(self, event_type, cb,
"an object with a 'push_event' method.")

event_id = self.__subscribe_event(event_type, cbfn, stateless)

with self.__get_event_map_lock():
se = self.__get_event_map()
evt_data = se.get(event_id)
Expand Down Expand Up @@ -1247,10 +1246,10 @@ def __DeviceProxy__subscribe_event_attrib(self, attr_name, event_type,
raise TypeError(
"Parameter cb_or_queuesize should be a number, a"
" callable object or an object with a 'push_event' method.")

print("__DeviceProxy.subscribe_event_attrib({}): before self.__subscribe_event".format(attr_name))
event_id = self.__subscribe_event(
attr_name, event_type, cb, filters, stateless, extract_as)

print("__DeviceProxy.subscribe_event_attrib({}): after self.__subscribe_event; id = {}".format(attr_name, event_id))
with self.__get_event_map_lock():
se = self.__get_event_map()
evt_data = se.get(event_id)
Expand Down Expand Up @@ -1287,7 +1286,6 @@ def __DeviceProxy__unsubscribe_event(self, event_id):
events_del = set()
timestamp = time.time()
se = self.__get_event_map()

with self.__get_event_map_lock():
# first delete event callbacks that have expire
for evt_id, (_, expire_time) in self._pending_unsubscribe.items():
Expand All @@ -1303,7 +1301,9 @@ def __DeviceProxy__unsubscribe_event(self, event_id):
raise KeyError("This device proxy does not own this subscription " + str(event_id))
del se[event_id]
self._pending_unsubscribe[event_id] = evt_info[0], timestamp + _UNSUBSCRIBE_LIFETIME
print("__DeviceProxy__unsubscribe_event({}): before self.__unsubscribe_event".format(event_id))
self.__unsubscribe_event(event_id)
print("__DeviceProxy__unsubscribe_event({}): after self.__unsubscribe_event".format(event_id))


def __DeviceProxy__unsubscribe_event_all(self):
Expand Down

0 comments on commit 4f3fb72

Please sign in to comment.