From 4d852a3417deb1dadff24a032e6f61bbb74f4a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C7=9Du=C4=B1=C9=A5suoo=C9=AF?= Date: Wed, 15 Nov 2017 10:58:10 +0800 Subject: [PATCH] Bug fix (up to ver 1.0.9) --- octoprint_multi_colors/__init__.py | 9 ++++----- setup.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/octoprint_multi_colors/__init__.py b/octoprint_multi_colors/__init__.py index be7ba18..6863f3f 100644 --- a/octoprint_multi_colors/__init__.py +++ b/octoprint_multi_colors/__init__.py @@ -8,7 +8,8 @@ import logging from flask import jsonify -import os.path, os.linesep +import os.path +from os import linesep import datetime import mmap import re @@ -85,10 +86,8 @@ def inject_gcode(self, file, layers, find_string, gcode): line_found = any(marker in line for line in f) found = 0 - if "\1" in gcode: - replace = ur'{0}{3}{1}{3}'.format(marker, gcode, linesep) - else: - replace = ur'\1{3}{0}{3}{1}{3}'.format(marker, gcode, linesep) + + replace = ur'\1{2}{0}{2}{1}{2}'.format(marker, gcode, linesep) for layer in layers: with open(file, 'r+') as f: diff --git a/setup.py b/setup.py index 155b5a2..5b8326d 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "OctoPrint MultiColors" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "1.0.8" +plugin_version = "1.0.9" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module