diff --git a/common/mount.py b/common/mount.py index b7af736e2..9eccd79da 100644 --- a/common/mount.py +++ b/common/mount.py @@ -267,6 +267,7 @@ def umount(self, hash_id = None): parent = self.parent, **kwargs) backend.umount() + self.config.PLUGIN_MANAGER.postUnmount(self.profile_id) def preMountCheck(self, mode = None, first_run = False, **kwargs): """ diff --git a/common/pluginmanager.py b/common/pluginmanager.py index 8fd8d13ca..30a00f682 100644 --- a/common/pluginmanager.py +++ b/common/pluginmanager.py @@ -184,6 +184,9 @@ def unmount(self, profileID = None): """ return + def postUnmount(self, profileID = None): + return + class PluginManager: """ Central interface for loading plugins and calling their API @@ -342,6 +345,13 @@ def unmount(self, profileID = None): except BaseException as e: self.logError(plugin, e) + def postUnmount(self, profileID = None): + for plugin in reversed(self.plugins): + try: + plugin.postUnmount(profileID) + except BaseException as e: + self.logError(plugin, e) + def logError(self, plugin, e): logger.error('Plugin %s %s failed: %s' %(plugin.__module__, #plugin name diff --git a/common/plugins/usercallbackplugin.py b/common/plugins/usercallbackplugin.py index 69831409e..bf7a7a8d1 100644 --- a/common/plugins/usercallbackplugin.py +++ b/common/plugins/usercallbackplugin.py @@ -138,3 +138,6 @@ def mount(self, profileID = None): def unmount(self, profileID = None): self.callback('8', profileID = profileID) + + def postUnmount(self, profileID = None): + self.callback('9', profileID = profileID)