Skip to content

Commit

Permalink
New Version 1.27.2
Browse files Browse the repository at this point in the history
- B #240 the first matched layer-expression is used for the whole file
  • Loading branch information
OllisGit committed Nov 16, 2021
1 parent 9c28584 commit ddad3a9
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 11 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/github-release-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
###
### Simple script to build a zip file of the whole repository
###
#
#script:
## debug - echo 'Hello World'
# - export PLUGIN_VERSION=$(cat setup.py | grep 'plugin_version = "*"' | cut -d '"' -f2)
# - zip -r master.zip * -i '\octoprint_*' 'translations' 'README.md' 'requirements.txt' 'setup.py'
## debug - ls -al
#
### see "Fix travis automatic build and deploy"
### https://github.com/oliexdev/openScale/pull/121
### https://github.com/oliexdev/openScale/pull/121/files
#before_deploy:
# - git tag -f travis-build
# - git remote add gh https://${TRAVIS_REPO_SLUG%/*}:${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
# - git push -f gh travis-build
# - git remote remove gh
#
#deploy:
# name: "V${PLUGIN_VERSION}-draft"
# #prerelease: true
# draft: true
# provider: releases
# api_key: "${GITHUB_TOKEN}"
# file: "master.zip"
# overwrite: true
# skip_cleanup: true
# target_commitish: $TRAVIS_COMMIT



name: Build Plugin Release - Action
on: [push]
jobs:
Build-Release-ZIP-Action:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2

- run: echo "Read current plugin version..."
- run: export PLUGIN_VERSION=$(cat setup.py | grep 'plugin_version = "*"' | cut -d '"' -f2)
- run: echo "Plugin Version $PLUGIN_VERSION ${PLUGIN_VERSION}"

- run: echo "Build ZIP"
- run: zip -r master.zip * -i '\octoprint_*' 'translations' 'README.md' 'requirements.txt' 'setup.py'
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: version
run: echo "::set-output name=version::$(cat setup.py | grep 'plugin_version = "*"' | cut -d '"' -f2)"
id: version

- name: release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
with:
draft: true
prerelease: false
release_name: V${{ steps.version.outputs.version }}-draft
tag_name: ${{ steps.version.outputs.version }}-draft
body_path: RELEASE_TEMPLATE.md

- name: upload master.zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: master.zip
asset_name: master.zip
asset_content_type: application/gzip

- run: echo "🍏 This job's status is ${{ job.status }}."
File renamed without changes.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,6 @@ self.onDataUpdaterPluginMessage = function (plugin, data) {
return;
}
```
## Special Thanks
Goes to:
- JetBrains for supporting OpenSource-Projects, see https://jb.gg/OpenSource
15 changes: 15 additions & 0 deletions RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [BugFix]
- #xxx

## [Enhancement]
- #xxx

## Counter
![downloaded](https://img.shields.io/github/downloads/OllisGit/OctoPrint-DisplayLayerProgress/xxx/total)

## Support my Efforts

This plugin, as well as my [other plugins](https://github.com/OllisGit/) were developed in my spare time.
If you like it, I would be thankful about a cup of coffee :)

[![More coffee, more code](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6SW5R6ZUKLB5E&source=url)
28 changes: 18 additions & 10 deletions octoprint_DisplayLayerProgress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ def __init__(self, fileBufferedReader, allLayerExpressions, logger):
self._logger = logger
self._currentLayerCount = 0
self.totalLayerNumbers = 0
self.selectedLayerExpression = None

def process_line(self, origLine):
if not len(origLine):
return None

# line = origLine.decode('utf-8') # convert byte -> str
# line = stringUtils.to_native_str(origLine)
# print (origLine)
Expand All @@ -177,13 +177,17 @@ def process_line(self, origLine):
line = line.lstrip()

if (len(line) != 0 and line[0] == ";"):
for layerExpression in self._allLayerExpressions:
inputLine = line
line = self._modifyLineIfLayerComment(inputLine, layerExpression)
if line is not inputLine:
# pattern matched, skip other expressions
break
# line = line.encode('utf-8') # convert str -> byte
if (self.selectedLayerExpression == None):
for layerExpression in self._allLayerExpressions:
inputLine = line
line = self._modifyLineIfLayerComment(inputLine, layerExpression)
if line is not inputLine:
# pattern matched, skip other expressions
self.selectedLayerExpression = layerExpression
break
# line = line.encode('utf-8') # convert str -> byte
else:
line = self._modifyLineIfLayerComment(line, self.selectedLayerExpression)
else:
line = origLine

Expand Down Expand Up @@ -450,7 +454,7 @@ def sendingGCodeHookWorkerMethod(self, commandAsString):

## calculate time of layer printing
layerDuration = 0
currentTime = datetime.now()
currentTime = datetime.now()
if self._startLayerTime is not None:
layerDuration = currentTime - self._startLayerTime

Expand Down Expand Up @@ -1094,7 +1098,7 @@ def _alreadyAddedLayerIndicators(self, path):
lineCounter = lineCounter + 1
# reached the limit
if (lineCounter > layerIndicatorLookAheadLimit):
self._logger.info("Limit of "+layerIndicatorLookAheadLimit+" reached and no " + LAYER_MESSAGE_PREFIX + " found")
self._logger.info("Limit of " + str(layerIndicatorLookAheadLimit) + " reached and no " + LAYER_MESSAGE_PREFIX + " found")
break
# found an indicator
if (line.startswith(LAYER_MESSAGE_PREFIX)):
Expand Down Expand Up @@ -1500,6 +1504,10 @@ def _readHeightFromFileMeta(self, fileLocation, selectedFilename):
self._logger.info("Did NOT reading total height from MetaFile, because analyse was done for not selected file. Current: '"+self._currentFilename+"' Analyse for: '"+selectedFilename+"'")
return

if (metaDataDict == None):
self._logger.info("MetaData not present for: '"+selectedFilename+"'. Could not read height")
return

# - read height from meta
if ("analysis" in metaDataDict):
analysisDict = metaDataDict["analysis"]
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.27.1"
plugin_version = "1.27.2"

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

Please sign in to comment.