Extend payload in various events

Added name and path various event print job events and
the upload event, deprecated the file property.

Had to move event triggering of the print job events to
the printer implementation, since the file manager
is not available in the comm layer. Added new callbacks
to the PrinterInterface to allow for that to be possible.
This commit is contained in:
Gina Häußge committed 2016-07-08 12:54:58 +02:00
1 parent 3a4902367b
commit 5bf5e336ec
4 files changed
+204 -91

No files matched your search

+6 -1
View File
@@ -287,7 +287,12 @@ def uploadGcodeFile(target):
if isinstance(filename, tuple):
filename, sdFilename = filename
eventManager.fire(Events.UPLOAD, {"file": filename, "target": target})
eventManager.fire(Events.UPLOAD, {"name": futureFilename,
"path": filename,
"target": target,
# TODO deprecated, remove in 1.4.0
"file": filename})
files = {}
location = url_for(".readGcodeFile", target=FileDestinations.LOCAL, filename=filename, _external=True)