✨ Add operation to FileRemoved event

Also document operation field for FileAdded.
This commit is contained in:
Gina Häußge committed 2023-10-24 15:56:55 +02:00
1 parent 523d4aa5ac
commit 4830ac53c7
2 files changed
+4

No files matched your search

+2
View File
@@ -246,6 +246,7 @@ FileAdded
* ``name``: the file's name
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
``["model", "stl"]``
* ``operation``: the operation that triggered the event, either ``add``, ``copy`` or ``move``.
.. note::
@@ -263,6 +264,7 @@ FileRemoved
* ``name``: the file's name
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
``["model", "stl"]``
* ``operation``: the operation that triggered the event, either ``remove`` or ``move``
.. note::
+2
View File
@@ -769,6 +769,7 @@ class FileManager:
"path": path,
"name": name,
"type": get_file_type(name),
"operation": "remove",
},
)
eventManager().fire(Events.UPDATED_FILES, {"type": "printables"})
@@ -814,6 +815,7 @@ class FileManager:
"path": source_path_in_storage,
"name": source_name,
"type": get_file_type(source_name),
"operation": "move",
},
)
eventManager().fire(