summaryrefslogtreecommitdiffstats
path: root/docs/write_addons.rst
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-18 00:29:55 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-18 00:29:55 +0200
commitbb5a115533711fd8bb87f53cb32ff7342137208d (patch)
tree476600f9896fae029880e4049eb4c5e6021b202d /docs/write_addons.rst
parentPEP-8, Python Zen, refactor and reduce code (part 6 in master module/common) (diff)
downloadpyload-bb5a115533711fd8bb87f53cb32ff7342137208d.tar.xz
Spare code cosmetics (5)
Diffstat (limited to 'docs/write_addons.rst')
-rw-r--r--docs/write_addons.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/write_addons.rst b/docs/write_addons.rst
index cc39ab259..b7f6dfdb8 100644
--- a/docs/write_addons.rst
+++ b/docs/write_addons.rst
@@ -63,6 +63,7 @@ A basic excerpt would look like: ::
def activate(self):
print "Yay, the core is ready let's do some work."
+
def downloadFinished(self, pyfile):
print "A Download just finished."
@@ -80,16 +81,20 @@ It requires a `dict` that maps event names to function names or a `list` of func
"""
Your Addon code here.
"""
+
event_map = {'downloadFinished': "doSomeWork",
'allDownloadsFnished': "someMethod",
'activate': "initialize"}
+
def initialize(self):
print "Initialized."
+
def doSomeWork(self, pyfile):
print "This is equivalent to the above example."
+
def someMethod(self):
print "The underlying event (allDownloadsFinished) for this method is not available through the base class"
@@ -147,6 +152,7 @@ Just store everything in ``self.info``. ::
def setup(self):
self.info = {'running': False}
+
def activate(self):
self.info['running'] = True