From bf6ce92be2de6534cfb179f8714930a2e6f054aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 21 Jun 2016 17:47:41 +0200 Subject: [PATCH] Add location for gcode and stl to slicing events --- src/octoprint/filemanager/__init__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/octoprint/filemanager/__init__.py b/src/octoprint/filemanager/__init__.py index 1dfd4635..d70aad46 100644 --- a/src/octoprint/filemanager/__init__.py +++ b/src/octoprint/filemanager/__init__.py @@ -244,9 +244,16 @@ class FileManager(object): def stlProcessed(source_location, source_path, tmp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args, _error=None, _cancelled=False, _analysis=None): try: if _error: - eventManager().fire(Events.SLICING_FAILED, {"stl": source_path, "gcode": dest_path, "reason": _error}) + eventManager().fire(Events.SLICING_FAILED, dict(stl=source_path, + stl_location=source_location, + gcode=dest_path, + gcode_location=dest_location, + reason=_error)) elif _cancelled: - eventManager().fire(Events.SLICING_CANCELLED, {"stl": source_path, "gcode": dest_path}) + eventManager().fire(Events.SLICING_CANCELLED, dict(stl=source_path, + stl_location=source_location, + gcode=dest_path, + gcode_location=dest_location)) else: source_meta = self.get_metadata(source_location, source_path) hash = source_meta["hash"] @@ -262,7 +269,11 @@ class FileManager(object): self.add_file(dest_location, dest_path, file_obj, links=links, allow_overwrite=True, printer_profile=printer_profile, analysis=_analysis) end_time = time.time() - eventManager().fire(Events.SLICING_DONE, {"stl": source_path, "gcode": dest_path, "time": end_time - start_time}) + eventManager().fire(Events.SLICING_DONE, dict(stl=source_path, + stl_location=source_location, + gcode=dest_path, + gcode_location=dest_location, + time=end_time - start_time)) if callback is not None: if callback_args is None: