Skip to content

Commit

Permalink
Fix py adjust timeout (#78)
Browse files Browse the repository at this point in the history
* Add missing adjust_timeout to Python code

* Code formatting
  • Loading branch information
johnwason committed Feb 9, 2023
1 parent e7a2b7d commit 8d47fbf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions RobotRaconteurPython/RobotRaconteurPythonUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def ReceivePacketWait(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE):
:type timeout: float
:return: The received packet
"""
m = self.__innerpipe.ReceivePacketWait(timeout)
m = self.__innerpipe.ReceivePacketWait(adjust_timeout(timeout))
return UnpackMessageElement(m, self.__type, self.__obj, self.__innerpipe.GetNode())

def PeekNextPacketWait(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE):
Expand All @@ -886,7 +886,7 @@ def PeekNextPacketWait(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE):
:param timeout: Timeout in seconds to wait for a packet, or -1 for infinite
:return: The received packet
"""
m = self.__innerpipe.PeekNextPacketWait(timeout)
m = self.__innerpipe.PeekNextPacketWait(adjust_timeout(timeout))
return UnpackMessageElement(m, self.__type, self.__obj, self.__innerpipe.GetNode())

def TryReceivePacketWait(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE, peek=False):
Expand All @@ -907,7 +907,8 @@ def TryReceivePacketWait(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE,
:rtype: Tuple[bool,T]
"""
m = RobotRaconteurPython.MessageElement()
r = self.__innerpipe.TryReceivePacketWait(m, timeout, peek)
r = self.__innerpipe.TryReceivePacketWait(
m, adjust_timeout(timeout), peek)
return (r, UnpackMessageElement(m, self.__type, self.__obj, self.__innerpipe.GetNode()))

@property
Expand Down Expand Up @@ -1400,7 +1401,7 @@ def WaitInValueValid(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE):
:return: Value is valid
:rtype: bool
"""
return self.__innerwire.WaitInValueValid(timeout)
return self.__innerwire.WaitInValueValid(adjust_timeout(timeout))

def WaitOutValueValid(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE):
"""
Expand All @@ -1414,7 +1415,7 @@ def WaitOutValueValid(self, timeout=RobotRaconteurPython.RR_TIMEOUT_INFINITE):
:return: Value is valid
:rtype: bool
"""
return self.__innerwire.WaitOutValueValid(timeout)
return self.__innerwire.WaitOutValueValid(adjust_timeout(timeout))

@property
def WireValueChanged(self):
Expand Down

0 comments on commit 8d47fbf

Please sign in to comment.