summaryrefslogtreecommitdiffstats
path: root/docs/write_addons.rst
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-20 22:48:30 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-20 23:02:00 +0200
commit5a86c3cb1db6cd87bf9ae22e09dd209cecc0a363 (patch)
treed5fbe979c043f5aa684272c97c0305d3124b1901 /docs/write_addons.rst
parentPEP-8, Python Zen, refactor and reduce code (part 12 in master module/remote/... (diff)
downloadpyload-5a86c3cb1db6cd87bf9ae22e09dd209cecc0a363.tar.xz
Spare code cosmetics (8)
Diffstat (limited to 'docs/write_addons.rst')
-rw-r--r--docs/write_addons.rst15
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/write_addons.rst b/docs/write_addons.rst
index b7f6dfdb8..58e73e675 100644
--- a/docs/write_addons.rst
+++ b/docs/write_addons.rst
@@ -20,12 +20,15 @@ All addons should start with something like this: ::
class YourAddon(Addon):
- __name = "YourAddon"
+ __name = "YourAddon"
+ __tupe = "addon"
__version = "0.1"
+
+ __config = [("activated", "bool", "Activated", "True")]
+
__description = "Does really cool stuff"
- __config = [ ("activated" , "bool" , "Activated" , "True" ) ]
- __author_name__ = ("Me")
- __author_mail__ = ("me@has-no-mail.com")
+ __license = "Your license short name"
+ __authors = [("Me", "me@has-no-mail.com")]
All meta-data is defined in the header, you need at least one option at ``__config`` so the user can toggle your
addon on and off. Dont't overwrite the ``init`` method if not neccesary, use ``setup`` instead.
@@ -130,7 +133,7 @@ Sounds complicated but is very easy to do. Just use the ``Expose`` decorator: ::
Thats all, it's available via the :class:`Api <pyload.api.Api>` now. If you want to use it read :ref:`access_api`.
Here is a basic example: ::
- #Assuming client is a ThriftClient or Api object
+ # Assuming client is a ThriftClient or Api object
print client.getServices()
print client.call(ServiceCall("YourAddon", "invoke", "an argument"))
@@ -158,7 +161,7 @@ Just store everything in ``self.info``. ::
Usable with: ::
- #Assuming client is a ThriftClient or Api object
+ # Assuming client is a ThriftClient or Api object
print client.getAllInfo()