pageauc / pi-timolo

Raspberry PI-TIMOLO ( PI-TImelapse, MOtion, LOwLight ) uses RPI picamera and OpenCV for Remote Headless Security Monitoring using Motion Tracking, Rclone Auto Sync files with remote storage services. Auto Twilight Transitions and Low Light Camera Settings. Panoramic images using PanTiltHat and More. This project is featured on GitHub Awesome software.
MIT License
552 stars 102 forks source link

Python3 compatibility #110

Closed surak closed 3 years ago

surak commented 3 years ago

While pi-timolo is trivial to work with python3, the webserver.py is not.

Since python2 is deprecated and unmaintained, I would humbly suggest we ditch it and go with python3 from here on.

pageauc commented 3 years ago

I try to make my code python 2 and 3 compatible. I will take a look at the webserver and make it python2 and 3 compatible. Claude ...

On Sat, Dec 19, 2020 at 12:45 PM Alexandre Strube notifications@github.com wrote:

While pi-timolo is trivial to work with python3, the webserver.py is not.

Since python2 is deprecated and unmaintained, I would humbly suggest we ditch it and go with python3 from here on.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pageauc/pi-timolo/issues/110, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZAYBLIETTBRQYPVZ2DSVTRCHANCNFSM4VCOHMKA .

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp

surak commented 3 years ago

Thanks, Claude. I made a merge request (#111) which will work only in Python3 (no module html in python2), but one can easily do a try import html, and if it throws an exception, load cg as html, for example.

pageauc commented 3 years ago

Thanks, I think python3 only is fine since mostly standard libraries. I will keep pi-timolo.py python2 and 3 compliant because it uses OpenCV although buster allows importing python3 opencv using apt-get. If this is stable can you change the PROG_VER to 12.0 and I will do a merge. I appreciate your contribution. I was going to write update but would have done it using try except to make it dual compatible but like I said I don't think python 3 only is an issue. Please send me an updated push with ver change and any other updates you may have. You can add your credit in the code comments. Thanks Claude.

On Sat, Dec 19, 2020 at 12:57 PM Alexandre Strube notifications@github.com wrote:

Thanks, Claude. I made a merge request (#111 https://github.com/pageauc/pi-timolo/pull/111) which will work only in Python3 (no module html in python2), but one can easily do a try import html, and if it throws an exception, load cg as html, for example.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pageauc/pi-timolo/issues/110#issuecomment-748504944, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZD4B37L5GVZV3YDDV3SVTSRFANCNFSM4VCOHMKA .

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp

pageauc commented 3 years ago

I ran across issues with Jessie so made python2 ver the default. Added instructions to copy webserver3.py to webserver.py. This will allow webserver.sh and menubox.sh to work correctly for python3. Your input is appreciated.

I have had experience with trying to make a robotic servo driver python2 and 3 compatible. A lot of try except's and very messy code. Thought it was cleaner to just have a clean webserver3.py that can be implemented on Buster. At some point I will reverse the instructions to make python3 version the default and instructions to fall back to python2 webserver. I still have some RPI's running Jessie so I believe there are users still running older versions of Debian. Let me know if this is a suitable implementation plan. Claude ...