From d79bfb312fefab99b55b8b9464b1d3b99cef1aa2 Mon Sep 17 00:00:00 2001 From: jneilliii Date: Mon, 30 Nov 2020 17:31:18 -0500 Subject: [PATCH] 0.1.3 (#57) * reduced greediness of regular expression * fix state panel image not showing in OctoPrint 1.5.0 * added release channels available in OctoPrint 1.5.0 --- .github/workflows/main.yml | 40 ------------------- README.md | 1 + octoprint_prusaslicerthumbnails/__init__.py | 14 ++++++- .../static/js/prusaslicerthumbnails.js | 2 +- setup.py | 2 +- 5 files changed, 15 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index fe890c3..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,40 +0,0 @@ -on: - push: - # Sequence of patterns matched against refs/tags - tags: - - '[0-9]+.[0-9]+.[0-9]+' # Push events to matching tag 0.0.0 - -name: Upload Release Asset - -jobs: - build: - name: Upload Release Asset - runs-on: ubuntu-latest - steps: - - name: Get the version - id: tag_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Checkout code - uses: actions/checkout@v2 - - name: Build project # This would actually build your project, using zip for an example artifact - run: zip -r ${{ steps.tag_version.outputs.VERSION }}.zip . -x ".git/*" ".github/*" ".editorconfig" ".gitignore" - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - prerelease: true - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./${{ steps.tag_version.outputs.VERSION }}.zip - asset_name: ${{ steps.tag_version.outputs.VERSION }}.zip - asset_content_type: application/zip diff --git a/README.md b/README.md index 3f018db..3da6dca 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Check out my other plugins [here](https://plugins.octoprint.org/by_author/#jneil - @tideline3d - [SimplyPrint](https://simplyprint.dk/) - [Andrew Beeman](https://github.com/Kiendeleo) +- [Calanish](https://github.com/calanish) ### Support My Efforts I, jneilliii, programmed this plugin for fun and do my best effort to support those that have issues with it, please return the favor and leave me a tip or become a Patron if you find this plugin helpful and want me to continue future development. diff --git a/octoprint_prusaslicerthumbnails/__init__.py b/octoprint_prusaslicerthumbnails/__init__.py index c5fc995..f7eb6ba 100644 --- a/octoprint_prusaslicerthumbnails/__init__.py +++ b/octoprint_prusaslicerthumbnails/__init__.py @@ -53,7 +53,7 @@ def get_template_configs(self): def _extract_thumbnail(self, gcode_filename, thumbnail_filename): import re import base64 - regex = r"(?:^; thumbnail begin \d+x\d+ \d+)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+)(?:^; thumbnail end)" + regex = r"(?:^; thumbnail begin \d+x\d+ \d+)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+?)(?:^; thumbnail end)" lineNum = 0 collectedString = "" with open(gcode_filename,"rb") as gcode_file: @@ -159,9 +159,19 @@ def get_update_information(self): user="jneilliii", repo="OctoPrint-PrusaSlicerThumbnails", current=self._plugin_version, + stable_branch=dict( + name="Stable", branch="master", comittish=["master"] + ), + prerelease_branches=[ + dict( + name="Release Candidate", + branch="rc", + comittish=["rc", "master"], + ) + ], # update method: pip - pip="https://github.com/jneilliii/OctoPrint-PrusaSlicerThumbnails/releases/latest/download/{target_version}.zip" + pip="https://github.com/jneilliii/OctoPrint-PrusaSlicerThumbnails/archive/{target_version}.zip" ) ) diff --git a/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js b/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js index 57ff1c1..cc26185 100644 --- a/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js +++ b/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js @@ -104,7 +104,7 @@ $(function() { if($('#prusalicer_state_thumbnail').length) { $('#prusalicer_state_thumbnail > img').attr('src', file_data.thumbnail); } else { - $('#state > div > hr:nth-child(4)').after('
\n
'); + $('#state > div > hr:first').after('
\n
'); } } else { $('#prusalicer_state_thumbnail').remove(); diff --git a/setup.py b/setup.py index 3c92887..2558a55 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "PrusaSlicer Thumbnails" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "0.1.2" +plugin_version = "0.1.3" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module