bradcfisher / OctoPrint-ExcludeRegionPlugin

OctoPrint plugin that adds the ability to prevent printing within rectangular or circular regions of the currently active gcode file.
GNU Affero General Public License v3.0
55 stars 5 forks source link

Try to add python 3 support #31

Closed 7FM closed 4 years ago

7FM commented 4 years ago

Due to missing python experience I basically run 2to3 on all python files but only commited the non-testing files. In the unit tests 2to3 wants changes like:

-        self.assertRegexpMatches(unit.id, "^[-0-9a-fA-F]{36}$", "id should be a UUID string")
+        self.assertRegex(unit.id, "^[-0-9a-fA-F]{36}$", "id should be a UUID string")

But as I dont know if this might break python 2 compability and those changes where only for test files I left them untouched. The plugin loads as expected in octoprint with python 3 but I did not yet try if functionallity works too.

gvmturl commented 4 years ago

Add on init.py

__plugin_pythoncompat__ = ">=2.7,<4"

like this.

plugin_name = "Exclude Region" plugin_pythoncompat = ">=2.7,<4" plugin_implementation = None plugin_hooks = None

7FM commented 4 years ago

Add on init.py

__plugin_pythoncompat__ = ">=2.7,<4"

like this.

plugin_name = "Exclude Region" plugin_pythoncompat = ">=2.7,<4" plugin_implementation = None plugin_hooks = None

As mentiened I do not have (a lot) pyhton experience. I have already added the flag thats why I do not really understand your point. Does the order matter? Or is it rather convention? (I am just trying to understand)

bradcfisher commented 4 years ago

Thanks for the PR! Looks good to me. I'll take a crack at reviewing/updating the tests. Hopefully there aren't too many changes required in those 🤞