andrewshilliday/garage-door-controller

Migration to Python3 error: Class advice impossible in Python3. Use the @Implementer class decorator instead.

Closed this issue · 5 comments

My raspberry has burnt last night after a electrical power outage. I have a spare Raspberry3 . Today only python3 is available.
I have used 2to3 to convert your script,
Now I get the following error
pi@raspberrypi:/garage-door-controller $ python controller.py &
[1] 2070
pi@raspberrypi:
/garage-door-controller $ Traceback (most recent call last):
File "/home/pi/garage-door-controller/controller.py", line 20, in
class HttpPasswordRealm(object):
File "/home/pi/garage-door-controller/controller.py", line 21, in HttpPasswordRealm
implements(portal.IRealm)
File "/usr/lib/python3/dist-packages/zope/interface/declarations.py", line 706, in implements
raise TypeError(_ADVICE_ERROR % 'implementer')
TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instead.

I have some python basic knowledge so I have asked google but I don't find any relevant answer to this problem.
Any help ?
Thanks
Gilles

ok , I found . Just replace "implement" with "implementer" 2 times

btw , I still get some other errors that I try to fix one by one.

I was wrong. It is not yet fixed. The authentication doesn't work. I have found a lot of records ion google about that, but nothing that I can apply to my case.
Any help ???
I don't want to open/close my garage doors from internet without security :)

Hello,
can someone help to migrate it to Python3 . The twisted security part with Zope doesn't work anymore.
I have found some sample but no way to make it work properly. It ignores the username/password and refuses the connection:
https://docs.twistedmatrix.com/en/stable/web/howto/web-in-60/http-auth.html

I give up and will try to rewrite it with flask instead of twisted.