Skip to content

Commit

Permalink
add cleanup and simple test call
Browse files Browse the repository at this point in the history
  • Loading branch information
rlehfeld committed Dec 22, 2024
1 parent 3e0af6b commit 9992122
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion RPyCRobotRemote/RPyCRobotRemoteServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __reduce_ex__(self, protocol):
return self.get_thread_specific_instance().__reduce_ex__(protocol)

def __call__(self, *args, **kwargs):
return self.get_thread_specific_instance().__call__(*args, **kwargs)
return self.get_thread_specific_instance()(*args, **kwargs)

def __format__(self, format_spec):
return self.get_thread_specific_instance().__format__(format_spec)
Expand Down Expand Up @@ -186,6 +186,7 @@ def on_disconnect(self, conn):
_stdin.unset_thread_specific_instance()
_stdout.unset_thread_specific_instance()
_stderr.unset_thread_specific_instance()
_robotapilogwriter.unset_thread_specific_instance()

on_disconnect = getattr(self._library, '_on_disconnect', None)
if on_disconnect:
Expand Down
3 changes: 2 additions & 1 deletion test/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import namedtuple
from robot.api.deco import keyword, not_keyword
from Model import DummyModel

from robot.api import logger

class Region(namedtuple('Region', 'x y width height')):
"""
Expand Down Expand Up @@ -49,6 +49,7 @@ def value(self, v):
def __call__(self, *args, **kwargs):
"""callable object"""
print(f'called __call__({args}, {kwargs})')
logger.console('called and message to console')
return '__call__'

def method(self, *args, **kwargs):
Expand Down

0 comments on commit 9992122

Please sign in to comment.