Upd
This commit is contained in:
parent
e9a0b2832e
commit
0ce2aa5941
@ -54,7 +54,6 @@ class TurtleDevice(SynchronyDevice):
|
|||||||
raise NoSuchTrait
|
raise NoSuchTrait
|
||||||
|
|
||||||
def invalidate(self, trait_name: str) -> None:
|
def invalidate(self, trait_name: str) -> None:
|
||||||
# NOTE: если я правильно понял, что должен делать метод
|
|
||||||
self.write(trait_name=trait_name, value=Turtle().__getattribute__(trait_name))
|
self.write(trait_name=trait_name, value=Turtle().__getattribute__(trait_name))
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -88,10 +87,13 @@ class TurtleDevice(SynchronyDevice):
|
|||||||
result = []
|
result = []
|
||||||
for method_name in methods:
|
for method_name in methods:
|
||||||
method = getattr(self.turtle, method_name)
|
method = getattr(self.turtle, method_name)
|
||||||
args = inspect.signature(method).parameters
|
parameters = inspect.signature(method).parameters
|
||||||
|
|
||||||
arg_types = {}
|
arg_types = {}
|
||||||
for arg_name, arg in args.items():
|
for arg_name, arg in parameters.items():
|
||||||
arg_types[arg_name] = arg.annotation
|
arg_types[arg_name] = parameters[arg_name].annotation
|
||||||
|
|
||||||
|
|
||||||
result.append(
|
result.append(
|
||||||
ActionDescriptor(
|
ActionDescriptor(
|
||||||
name=method_name, info=method.__doc__, arguments=arg_types
|
name=method_name, info=method.__doc__, arguments=arg_types
|
||||||
|
Loading…
Reference in New Issue
Block a user