andrewshilliday / garage-door-controller

Software to monitor and control garage doors via a raspberry pi
MIT License
327 stars 132 forks source link

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

Closed Gilles94500 closed 1 year ago

Gilles94500 commented 1 year ago

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

Gilles94500 commented 1 year ago

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

Gilles94500 commented 1 year ago

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

Gilles94500 commented 1 year ago

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 :)

Gilles94500 commented 1 year ago

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

Gilles94500 commented 1 year ago

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