diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-08 01:08:03 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 11:03:20 +0200 |
commit | 91115fd577f20704ef7f2e74c4527ffbb0730a09 (patch) | |
tree | 198fc68f1eb6f42e220d0f1c68499f48ae70543c /docs | |
parent | Project __init__ with info (diff) | |
download | pyload-91115fd577f20704ef7f2e74c4527ffbb0730a09.tar.xz |
Restructure pyload file tree (1)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/access_api.rst | 8 | ||||
-rw-r--r-- | docs/module_overview.rst | 2 | ||||
-rw-r--r-- | docs/write_hooks.rst | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/docs/access_api.rst b/docs/access_api.rst index d83698aa3..58fe56ca4 100644 --- a/docs/access_api.rst +++ b/docs/access_api.rst @@ -13,12 +13,12 @@ First of all, you need to know what you can do with our API. It lets you do all retrieving download status, manage queue, manage accounts, modify config and so on. This document is not intended to explain every function in detail, for a complete listing -see :class:`Api <pyload.Api.Api>`. +see :class:`Api <pyload.api.Api>`. Of course its possible to access the ``core.api`` attribute in plugins and hooks, but much more interesting is the possibillity to call function from different programs written in many different languages. -pyLoad uses thrift as backend and provides its :class:`Api <pyload.Api.Api>` as service. +pyLoad uses thrift as backend and provides its :class:`Api <pyload.api.Api>` as service. More information about thrift can be found here http://wiki.apache.org/thrift/. @@ -92,7 +92,7 @@ so pyLoad can authenticate you. Calling Methods =============== -In general you can use any method listed at the :class:`Api <pyload.Api.Api>` documentation, which is also available to +In general you can use any method listed at the :class:`Api <pyload.api.Api>` documentation, which is also available to the thriftbackend. Access works simply via ``http://pyload-core/api/methodName``, where ``pyload-core`` is the ip address @@ -107,7 +107,7 @@ Passing parameters To pass arguments you have two choices. Either use positional arguments, eg ``http://pyload-core/api/getFileData/1``, where 1 is the FileID, or use keyword arguments -supplied via GET or POST ``http://pyload-core/api/getFileData?fid=1``. You can find the argument names in the :class:`Api <pyload.Api.Api>` +supplied via GET or POST ``http://pyload-core/api/getFileData?fid=1``. You can find the argument names in the :class:`Api <pyload.api.Api>` documentation. It is important that *all* arguments are in JSON format. So ``http://pyload-core/api/getFileData/1`` is valid because diff --git a/docs/module_overview.rst b/docs/module_overview.rst index 8cea3874b..d76386ed7 100644 --- a/docs/module_overview.rst +++ b/docs/module_overview.rst @@ -6,7 +6,7 @@ You can find an overview of some important classes here: .. autosummary:: :toctree: pyload - pyload.Api.Api + pyload.api.Api pyload.plugins.Plugin.Base pyload.plugins.Plugin.Plugin pyload.plugins.Crypter.Crypter diff --git a/docs/write_hooks.rst b/docs/write_hooks.rst index 5508f5a0c..ebf2ed368 100644 --- a/docs/write_hooks.rst +++ b/docs/write_hooks.rst @@ -6,7 +6,7 @@ Hooks A Hook is a python file which is located at :file:`pyload/plugins/hooks`. The :class:`HookManager <pyload.HookManager.HookManager>` will load it automatically on startup. Only one instance exists over the complete lifetime of pyload. Your hook can interact on various events called by the :class:`HookManager <pyload.HookManager.HookManager>`, -do something complete autonomic and has full access to the :class:`Api <pyload.Api.Api>` and every detail of pyLoad. +do something complete autonomic and has full access to the :class:`Api <pyload.api.Api>` and every detail of pyLoad. The UpdateManager, CaptchaTrader, UnRar and many more are realised as hooks. Hook header @@ -102,7 +102,7 @@ available as event and not accessible through overwriting hook methods. However Providing RPC services ---------------------- -You may noticed that pyLoad has an :class:`Api <pyload.Api.Api>`, which can be used internal or called by clients via RPC. +You may noticed that pyLoad has an :class:`Api <pyload.api.Api>`, which can be used internal or called by clients via RPC. So probably clients want to be able to interact with your hook to request it's state or invoke some action. Sounds complicated but is very easy to do. Just use the ``Expose`` decorator: :: @@ -118,7 +118,7 @@ Sounds complicated but is very easy to do. Just use the ``Expose`` decorator: :: def invoke(self, arg): print "Invoked with", arg -Thats all, it's available via the :class:`Api <pyload.Api.Api>` now. If you want to use it read :ref:`access_api`. +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 @@ -128,7 +128,7 @@ Here is a basic example: :: Providing status information ---------------------------- -Your hook can store information in a ``dict`` that can easily be retrievied via the :class:`Api <pyload.Api.Api>`. +Your hook can store information in a ``dict`` that can easily be retrievied via the :class:`Api <pyload.api.Api>`. Just store everything in ``self.info``. :: |