Skip to content

Commit

Permalink
New Version 1.25.4
Browse files Browse the repository at this point in the history
#207, #208: "ghost"-file with dlp properties
MR #206: linebreaks,  credit goes to @kmarty
  • Loading branch information
OllisGit committed Feb 10, 2021
1 parent cad2f79 commit c382442
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions octoprint_DisplayLayerProgress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def _modifyLineIfLayerComment(self, line, layerExpression):
# read layer number from line
currentLayer = str(matched.group(groupIndex))
self.totalLayerNumbers = currentLayer
line = line + LAYER_MESSAGE_PREFIX + currentLayer + "\r\n"
endline = '\r\n' if line.endswith('\r\n') else '\n'
line = line + LAYER_MESSAGE_PREFIX + currentLayer + endline

return line

Expand Down Expand Up @@ -331,6 +332,7 @@ def initialize(self):
self._evaluatePrinterMessagePattern()
self._parseLayerExpressions(self._cachedSettings.getStringValue(SETTINGS_KEY_LAYER_EXPRESSIONS))
self._layerDetectorFileProcessor = None
self._layerDetectorFileProcessorLastProcessedFilename = None


def _initializeEventLogger(self):
Expand Down Expand Up @@ -1239,9 +1241,10 @@ def on_event(self, event, payload):

elif event == Events.FILE_ADDED:
fileLocation = payload.get("storage")
addedFilename = payload.get("name")

# addedFilename = payload.get("name")
addedFilename = payload.get("path")
if (self._layerDetectorFileProcessorLastProcessedFilename != None):
self._layerDetectorFileProcessorLastProcessedFilename = None
if (fileLocation == octoprint.filemanager.FileDestinations.LOCAL):
addedFile = self._file_manager.path_on_disk(fileLocation, addedFilename)
# mark this file that LayerIndicators were added
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "DisplayLayerProgress"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.25.3"
plugin_version = "1.25.4"

# 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 c382442

Please sign in to comment.