diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/write_addons.rst | 12 | ||||
-rw-r--r-- | docs/write_plugins.rst | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/docs/write_addons.rst b/docs/write_addons.rst index 7607560ff..9f4436cc5 100644 --- a/docs/write_addons.rst +++ b/docs/write_addons.rst @@ -19,20 +19,20 @@ All addons should start with something like this: :: from pyload.plugin.Addon import Addon class YourAddon(Addon): - __name__ = "YourAddon" - __version__ = "0.1" - __description__ = "Does really cool stuff" - __config__ = [ ("activated" , "bool" , "Activated" , "True" ) ] + __name = "YourAddon" + __version = "0.1" + __description = "Does really cool stuff" + __config = [ ("activated" , "bool" , "Activated" , "True" ) ] __author_name__ = ("Me") __author_mail__ = ("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 +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. Using the Config ---------------- -We are taking a closer look at the ``__config__`` parameter. +We are taking a closer look at the ``__config`` parameter. You can add more config values as desired by adding tuples of the following format to the config list: ``("name", "type", "description", "default value")``. When everything went right you can access the config values with ``self.getConfig(name)`` and ``self.setConfig(name, value``. diff --git a/docs/write_plugins.rst b/docs/write_plugins.rst index 7820e5ce6..3f6212dbf 100644 --- a/docs/write_plugins.rst +++ b/docs/write_plugins.rst @@ -10,8 +10,8 @@ There are three kinds of different plugins: **Hoster**, **Crypter**, **Container All kind of plugins inherit from the base :class:`Plugin <pyload.plugin.Plugin.Plugin>`. You should know its convenient methods, they make your work easier ;-) -Every plugin defines a ``__pattern__`` and when the user adds urls, every url is matched against the pattern defined in -the plugin. In case the ``__pattern__`` matched on the url the plugin will be assigned to handle it and instanciated when +Every plugin defines a ``__pattern`` and when the user adds urls, every url is matched against the pattern defined in +the plugin. In case the ``__pattern`` matched on the url the plugin will be assigned to handle it and instanciated when pyLoad begins to download/decrypt the url. Plugin header @@ -22,13 +22,13 @@ How basic hoster plugin header could look like: :: from pyload.plugin.Hoster import Hoster class MyFileHoster(Hoster): - __name__ = "MyFileHoster" - __version__ = "0.1" - __pattern__ = r"http://myfilehoster.example.com/file_id/[0-9]+" - __config__ = [] + __name = "MyFileHoster" + __version = "0.1" + __pattern = r"http://myfilehoster.example.com/file_id/[0-9]+" + __config = [] -You have to define these meta-data, ``__pattern__`` has to be a regexp that sucessfully compiles with -``re.compile(__pattern__)``. +You have to define these meta-data, ``__pattern`` has to be a regexp that sucessfully compiles with +``re.compile(__pattern)``. Just like :ref:`write_addons` you can add and use config values exatly the same way. If you want a Crypter or Container plugin, just replace the word Hoster with your desired plugin type. |