diff --git a/octoprint/cura/__init__.py b/octoprint/cura/__init__.py index a9df95b7..54c7685d 100644 --- a/octoprint/cura/__init__.py +++ b/octoprint/cura/__init__.py @@ -29,7 +29,9 @@ class CuraEngine(object): logging.info('CuraEngine Created') - def process_file(self, config, gcode, file_path, call_back, call_back_args): + def process_file( + self, config, gcode, file_path, call_back=None, + call_back_args=None): """Wraps around the main.cpp processFile method. :param config: :class: `string` :path to a cura config file: :param gcode: :class: `string :path to write out the gcode generated: diff --git a/octoprint/cura/tests/test_cura.py b/octoprint/cura/tests/test_cura.py index a75f507f..791d4e7d 100644 --- a/octoprint/cura/tests/test_cura.py +++ b/octoprint/cura/tests/test_cura.py @@ -9,12 +9,12 @@ from octoprint.cura import CuraEngine class CuraFactoryTestCase(unittest.TestCase): - def test_cura_factory(self): + def test_cura_factory(self): - fake_path = 'my/temp/path' - result = CuraFactory.create_slicer(fake_path) + fake_path = 'my/temp/path' + result = CuraFactory.create_slicer(fake_path) - self.assertEqual(fake_path, result.cura_path) + self.assertEqual(fake_path, result.cura_path) @patch('threading.Thread') @@ -29,6 +29,5 @@ class CuraFactoryTestCase(unittest.TestCase): args = [path, '-s', config_path, '-o', file_path] cura_engine.process_file(config_path, gcode_filename, file_path) - self.assertTrue(thread.called) diff --git a/octoprint/gcodefiles.py b/octoprint/gcodefiles.py index 930e88aa..1275f470 100644 --- a/octoprint/gcodefiles.py +++ b/octoprint/gcodefiles.py @@ -128,7 +128,6 @@ class GcodeManager: file.save(absolutePath) filename = file.filename - if isGcodeFileName(filename): return self.processGcode(absolutePath) @@ -143,7 +142,6 @@ class GcodeManager: filename, absolutePath, callBack, callBackArgs) def processSTL(self, filename, absolutePath, callBack, callBackArgs): - from octoprint.cura import CuraFactory curaEngine = CuraFactory.create_slicer() @@ -157,7 +155,6 @@ class GcodeManager: config, gcodePath, absolutePath, callBack, callBackArgs) def processGcode(self, absolutePath): - filename = self._getBasicFilename(absolutePath) if filename in self._metadata.keys(): diff --git a/octoprint/printer.py b/octoprint/printer.py index d027d38b..55c9b2d1 100644 --- a/octoprint/printer.py +++ b/octoprint/printer.py @@ -487,7 +487,6 @@ class Printer(): filename, absolutePath, callBack, callBackArgs) def streamSdFile(filename, absolutePath): - self._sdStreamer = SdFileStreamer(self._comm, filename, absolutePath, self._onSdFileStreamProgress, self._onSdFileStreamFinish) self._sdStreamer.start() logging.info("Stream file to SD started") diff --git a/octoprint/server.py b/octoprint/server.py index 58d085c0..661cd8fd 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -509,7 +509,6 @@ def setSettings(): curaEngine = data.get("curaEngine", None) if curaEngine: - path = curaEngine.get("path") if path: s.set(["curaEngine", "path"], path) diff --git a/octoprint/tests/test_server.py b/octoprint/tests/test_server.py deleted file mode 100644 index 22589b4c..00000000 --- a/octoprint/tests/test_server.py +++ /dev/null @@ -1,9 +0,0 @@ -import unittest - - -class FileManipulationTestCase(unittest.TestCase): - - - def test_simple(self): - - self.assertTrue(True)