summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-10 12:23:58 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-10 12:23:58 +0200
commitfa7eafaa4398a1faf7e9046b5260e955b97368f4 (patch)
tree464ccbb593d748236cd46245fb1a7d82dd19b4d4 /module
parent[Plugin] Improve encoding functions & storing methods (diff)
downloadpyload-fa7eafaa4398a1faf7e9046b5260e955b97368f4.tar.xz
[Addon] Persistent self.info
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/Addon.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py
index 47c5584f5..1c70cd4c9 100644
--- a/module/plugins/internal/Addon.py
+++ b/module/plugins/internal/Addon.py
@@ -23,7 +23,7 @@ def threaded(fn):
class Addon(Plugin):
__name__ = "Addon"
__type__ = "hook" #@TODO: Change to `addon` in 0.4.10
- __version__ = "0.11"
+ __version__ = "0.12"
__status__ = "testing"
__threaded__ = [] #@TODO: Remove in 0.4.10
@@ -132,6 +132,14 @@ class Addon(Plugin):
raise NotImplementedError
+ def save_info(self):
+ self.store("info", self.info)
+
+
+ def restore_info(self):
+ self.retrieve("info", self.info)
+
+
@property
def activated(self):
"""
@@ -154,6 +162,7 @@ class Addon(Plugin):
#: Deprecated method, use `deactivate` instead (Remove in 0.4.10)
def unload(self, *args, **kwargs):
+ self.save_info()
return self.deactivate(*args, **kwargs)
@@ -166,6 +175,7 @@ class Addon(Plugin):
#: Deprecated method, use `activate` instead (Remove in 0.4.10)
def coreReady(self, *args, **kwargs):
+ self.restore_info()
return self.activate(*args, **kwargs)