Fix server method in DevEnum example in doc/data_types.rst
Fix Clock.mktime
server method in documentation data_types.rst
DevEnum
example.
Without the fix, the failure is like this for a DeviceProxy client:
>>> dp.mktime((2021, 12, 2, 12, 56, 32, 3, 336, 0))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py", line 275, in f
return dp.command_inout(name, *args, **kwds)
File "/usr/local/lib/python3.7/dist-packages/tango/green.py", line 195, in greener
return executor.run(fn, args, kwargs, wait=wait, timeout=timeout)
File "/usr/local/lib/python3.7/dist-packages/tango/green.py", line 109, in run
return fn(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/tango/connection.py", line 108, in __Connection__command_inout
r = Connection.command_inout_raw(self, name, *args, **kwds)
File "/usr/local/lib/python3.7/dist-packages/tango/connection.py", line 137, in __Connection__command_inout_raw
return self.__command_inout(cmd_name, param)
PyTango.DevFailed: DevFailed[
DevError[
desc = TypeError: Tuple or struct_time argument required
origin = Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/tango/server.py", line 1142, in cmd
return get_worker().execute(f, self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/tango/green.py", line 98, in execute
return fn(*args, **kwargs)
File "/training/Clock/ClockDS.py", line 71, in mktime
return time.mktime(tupl)
TypeError: Tuple or struct_time argument required
reason = PyDs_PythonError
severity = ERR]
DevError[
desc = Failed to execute command_inout on device test/nodb/clock, command mktime
origin = Connection::command_inout()
reason = API_CommandFailed
severity = ERR]
]
On the device side, it reports the command's input argument has type <class 'numpy.ndarray'>
.
Edited by Anton Joubert