Skip to content

Commit

Permalink
Python 3.7 fix (#82)
Browse files Browse the repository at this point in the history
* Replace with Python 3.7 compatible syntax

* Bump version to 2.1.1
  • Loading branch information
crysxd authored Jul 4, 2024
1 parent 52ad162 commit 9fca47a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion octoapp/notificationutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ def processLine(line):

# Do not read by line! We need to keep track of \r and \n because they are part of the filePos
# later used. If read by line we do not know if \r\n or \n was used
while chunk := response.read(4096):
while True:
chunk = response.read(4096)
if not chunk:
break

buffer += chunk if type(chunk) == str else chunk.decode('utf-8')
while '\n' in buffer:
line, buffer = buffer.split('\n', 1)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
# Note that this is also parsed by the moonraker module to pull the version, so the string and format must remain the same!
plugin_version = "2.1.0"
plugin_version = "2.1.1"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 9fca47a

Please sign in to comment.