tango-controls / pytango

This project was moved to gitlab.com
http://pytango.rtfd.io
54 stars 44 forks source link

pytango hlapi device server does not start #88

Closed andygotz closed 7 years ago

andygotz commented 7 years ago

I have installed the latest version of PyTango (from PyPi) 9.2.0 (well done on doing a great job - the installation worked like a charm!). But then when I tried to run a device server which uses the HLAPI. I tried one generated with the latest version of pogo and the PowerSupplyDS in the Getting Started. Both of them fail with this error:

~/tango/classes/pypowersupply$ python3 PowerSupplyDS.py test Exiting: Server exited with unforseen exception: When giving a single class, it must implement HLAPI (see tango.server) terminate called after throwing an instance of 'omni_thread_fatal' Aborted (core dumped)

I can run PyTango device servers which use the low level api. It would be nice if I could use the high level api. The servers are much more compact and easier to write!

Thanks for your help in advance

Andy

vxgmichel commented 7 years ago

The problem here is that the device is not compatible with python 3, because the metaclass is not set properly. Simply replace your class definition with one of the following:

I agree this issue is confusing, and we should do something in pytango to raise a meaningful exception and document it properly. We might also want to update the pogo templates.

andygotz commented 7 years ago

Cool it works! Thanks for the explanation.

vxgmichel commented 7 years ago

Related: metaclass definition won't be necessary anymore after PR #90 is merged.

andygotz commented 7 years ago

Great!