Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds python 3.7 compatibility #201

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

benjamin-salchow
Copy link

I upgraded to Python 3.7 and I could not run your plug-in.

I got the following error: "Plugin Filament Manager (0.5.3) is not compatible to Python 3.7.3 (compatibility string: >=2.7,<3)."

So I just added the plugin_pythoncompat information and run this plugin. I just needed to add the UTF-8 encoding within your entity_tag function. Now it works like a charm with Python 3.7.3 and I had no issue with my OctoPrint setup.

@benjamin-salchow
Copy link
Author

There is still a little issue with python3:

Traceback (most recent call last):
  File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/OctoPrint-1.4.0-py3.7.egg/octoprint/plugin/__init__.py", line 224, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_filamentmanager/__init__.py", line 225, in on_event
    self.on_printer_state_changed(payload)
  File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_filamentmanager/__init__.py", line 245, in on_printer_state_changed
    self.update_filament_usage()
  File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_filamentmanager/__init__.py", line 260, in update_filament_usage
    for tool in xrange(0, numTools):
NameError: name 'xrange' is not defined

@benjamin-salchow
Copy link
Author

Last check-in fixes commented error by using range instead of xrange.

@NovaViper
Copy link

Hey @benjamin-salchow how do I add your branch onto Octoprint?

@benjamin-salchow
Copy link
Author

@NovaViper Hello, you can use my branch by installing it with the URL:

https://github.com/benjamin-salchow/OctoPrint-FilamentManager/archive/master.zip

This contains all changes in this pull request. Just install it from this zip and later change it to the official if this gets included someday - hopefully ;-)

@NovaViper
Copy link

@benjamin-salchow Hey, thanks for the link! Um, I installed the plugin but it still says it's not Python 3 with the Python 3 Checker plugin

@NovaViper
Copy link

In fact, it still goes and installs the original plugin and not the modified one

@benjamin-salchow
Copy link
Author

benjamin-salchow commented Apr 8, 2020

Hello @NovaViper - the Python 3 Checker plug-in is useless. This plugin just takes a look in the official registry at Octoprint of the plugin. That's the reason why my fix is not listed, because my plugin is just a fork from this one. If you delete the original one and install the zip from my fork it should work. I did the same on my 3D-Printer and it works fine :-).

@buffedelic
Copy link

I can confirm that changes made by @benjamin-salchow is working for octoprint 1.4.0. Merge!

@sr1329
Copy link

sr1329 commented Aug 30, 2020

Hi I'm really confused. Has this been merged into the main branch? If I want to use this branch how do I install it? When I check inside the branch I see the author has linked to the main branch zip file.

How do I install this version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants