diff options
author | 2013-06-09 18:10:22 +0200 | |
---|---|---|
committer | 2013-06-09 18:10:23 +0200 | |
commit | 16af85004c84d0d6c626b4f8424ce9647669a0c1 (patch) | |
tree | 025d479862d376dbc17e934f4ed20031c8cd97d1 /docs | |
parent | adapted to jshint config (diff) | |
download | pyload-16af85004c84d0d6c626b4f8424ce9647669a0c1.tar.xz |
moved everything from module to pyload
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api/components.rst | 18 | ||||
-rw-r--r-- | docs/api/datatypes.rst | 4 | ||||
-rw-r--r-- | docs/api/json_api.rst | 6 | ||||
-rw-r--r-- | docs/api/overview.rst | 6 | ||||
-rw-r--r-- | docs/conf.py | 6 | ||||
-rw-r--r-- | docs/docs.conf | 4 | ||||
-rw-r--r-- | docs/index.rst | 2 | ||||
-rw-r--r-- | docs/module_overview.rst | 30 | ||||
-rw-r--r-- | docs/plugins/addon_plugin.rst | 40 | ||||
-rw-r--r-- | docs/plugins/base_plugin.rst | 16 | ||||
-rw-r--r-- | docs/plugins/crypter_plugin.rst | 12 | ||||
-rw-r--r-- | docs/plugins/hoster_plugin.rst | 8 |
12 files changed, 76 insertions, 76 deletions
diff --git a/docs/api/components.rst b/docs/api/components.rst index 116cfa90b..08560b535 100644 --- a/docs/api/components.rst +++ b/docs/api/components.rst @@ -9,12 +9,12 @@ of the available components listed by topic can be found below. .. autosummary:: :toctree: module - module.api.CoreApi.CoreApi - module.api.ConfigApi.ConfigApi - module.api.DownloadPreparingApi.DownloadPreparingApi - module.api.DownloadApi.DownloadApi - module.api.FileApi.FileApi - module.api.CollectorApi.CollectorApi - module.api.AccountApi.AccountApi - module.api.UserInteractionApi.UserInteractionApi - module.api.AddonApi.AddonApi
\ No newline at end of file + pyload.api.CoreApi.CoreApi + pyload.api.ConfigApi.ConfigApi + pyload.api.DownloadPreparingApi.DownloadPreparingApi + pyload.api.DownloadApi.DownloadApi + pyload.api.FileApi.FileApi + pyload.api.CollectorApi.CollectorApi + pyload.api.AccountApi.AccountApi + pyload.api.UserInteractionApi.UserInteractionApi + pyload.api.AddonApi.AddonApi
\ No newline at end of file diff --git a/docs/api/datatypes.rst b/docs/api/datatypes.rst index 5516189f3..cc07a5f28 100644 --- a/docs/api/datatypes.rst +++ b/docs/api/datatypes.rst @@ -4,12 +4,12 @@ Datatype Definition ******************* -Below you find a copy of :file:`module/remote/thriftbackend/pyload.thrift`, which is used to generate the data structs +Below you find a copy of :file:`pyload/remote/thriftbackend/pyload.thrift`, which is used to generate the data structs for various languages. It is also a good overview of avaible methods and return data. .. code-block:: c - .. [[[cog cog.out(open('module/remote/pyload.thrift', 'rb').read()) ]]] + .. [[[cog cog.out(open('pyload/remote/pyload.thrift', 'rb').read()) ]]] namespace java org.pyload.thrift typedef i32 FileID diff --git a/docs/api/json_api.rst b/docs/api/json_api.rst index 1f54e40aa..504de20bf 100644 --- a/docs/api/json_api.rst +++ b/docs/api/json_api.rst @@ -6,7 +6,7 @@ JSON API JSON [1]_ is a lightweight object notation and wrappers exists for nearly every programming language. Every modern browser is able to load JSON objects with JavaScript. Unlike other RPC methods you don't need to generate or precompile -any stub methods. The JSON :class:`Api <module.Api.Api>` is ready to be used in most languages and most JSON libraries are lightweight +any stub methods. The JSON :class:`Api <pyload.Api.Api>` is ready to be used in most languages and most JSON libraries are lightweight enough to build very small and performant scripts. Because of the builtin support, JSON is the first choice for all browser applications. @@ -28,7 +28,7 @@ so pyLoad can authenticate you. Calling Methods --------------- -In general you can use any method listed at the :class:`Api <module.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 thrift backend. Access works simply via ``http://pyload-core/api/methodName``, where ``pyload-core`` is the ip address @@ -43,7 +43,7 @@ Passing parameters To pass arguments you have two choices: Either use positional arguments, e.g.: ``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 <module.Api.Api>` documentation. +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 1 represents an integer in json format. On the other hand if the method is expecting strings, this would be correct: diff --git a/docs/api/overview.rst b/docs/api/overview.rst index 99e7075ca..3b65a45b0 100644 --- a/docs/api/overview.rst +++ b/docs/api/overview.rst @@ -12,10 +12,10 @@ From Wikipedia, the free encyclopedia [1]_: .. rubric:: Motivation -The idea of the centralized pyLoad :class:`Api <module.Api.Api>` is to give uniform access to all integral parts +The idea of the centralized pyLoad :class:`Api <pyload.Api.Api>` is to give uniform access to all integral parts and plugins in pyLoad as well as other clients written in arbitrary programming languages. -Most of the :class:`Api <module.Api.Api>` functionality is exposed via HTTP or WebSocktes [2]_ as -simple JSON objects [3]_. In conclusion the :class:`Api <module.Api.Api>` is accessible via many programming languages, +Most of the :class:`Api <pyload.Api.Api>` functionality is exposed via HTTP or WebSocktes [2]_ as +simple JSON objects [3]_. In conclusion the :class:`Api <pyload.Api.Api>` is accessible via many programming languages, over network from remote machines and over browser with javascript. diff --git a/docs/conf.py b/docs/conf.py index 258dab745..8bd7c5f56 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,7 +16,7 @@ from os.path import dirname, join, abspath dir_name = join(dirname(abspath(""))) sys.path.append(dir_name) -sys.path.append(join(dir_name, "module", "lib")) +sys.path.append(join(dir_name, "pyload", "lib")) # If extensions (or modules to document with autodoc) are in another directory, @@ -129,12 +129,12 @@ html_theme = 'default' # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = join(dir_name, "module", "web", "static", "img", "default", "logo.png") +html_logo = join(dir_name, "pyload", "web", "static", "img", "default", "logo.png") # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -html_favicon = join(dir_name, "module", "web", "static", "img", "favicon.ico") +html_favicon = join(dir_name, "pyload", "web", "static", "img", "favicon.ico") # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/docs/docs.conf b/docs/docs.conf index e197cfa43..d41ad8bc6 100644 --- a/docs/docs.conf +++ b/docs/docs.conf @@ -3,12 +3,12 @@ [epydoc] -modules: pyLoadCore.py, pyLoadCli.py, pyloadGui.py, module +modules: pyLoadCore.py, pyLoadCli.py, pyloadGui.py, pyload output: html target: docs docformat: restructuredtext -exclude: module\.lib|module\.remote\.thriftbackend\.thriftgen|PyQt4|\.pyc|\.pyo|module\.plugins\.(accounts|captcha|container|crypter|hooks|hoster) +exclude: pyload\.lib|pyload\.remote\.thriftbackend\.thriftgen|PyQt4|\.pyc|\.pyo|pyload\.plugins\.(accounts|captcha|container|crypter|hooks|hoster) name: pyLoad Documentation url: http://docs.pyload.org diff --git a/docs/index.rst b/docs/index.rst index 37fba3501..0b5885f0b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,7 +37,7 @@ Contents module_overview.rst -.. currentmodule:: module +.. currentmodule:: pyload .. rubric:: Footnotes diff --git a/docs/module_overview.rst b/docs/module_overview.rst index 56934e298..2876e465e 100644 --- a/docs/module_overview.rst +++ b/docs/module_overview.rst @@ -5,19 +5,19 @@ Module Overview A little selection of most important modules in pyLoad. .. autosummary:: - :toctree: module + :toctree: pyload - module.Api.Api - module.plugins.Base.Base - module.plugins.Hoster.Hoster - module.plugins.internal.SimpleHoster.SimpleHoster - module.plugins.Crypter.Crypter - module.plugins.internal.SimpleCrypter.SimpleCrypter - module.plugins.Addon.Addon - module.plugins.Account.Account - module.plugins.MultiHoster.MultiHoster - module.AddonManager.AddonManager - module.interaction.EventManager.EventManager - module.interaction.InteractionManager.InteractionManager - module.interaction.InteractionTask.InteractionTask - module.remote.ttypes + pyload.Api.Api + pyload.plugins.Base.Base + pyload.plugins.Hoster.Hoster + pyload.plugins.internal.SimpleHoster.SimpleHoster + pyload.plugins.Crypter.Crypter + pyload.plugins.internal.SimpleCrypter.SimpleCrypter + pyload.plugins.Addon.Addon + pyload.plugins.Account.Account + pyload.plugins.MultiHoster.MultiHoster + pyload.AddonManager.AddonManager + pyload.interaction.EventManager.EventManager + pyload.interaction.InteractionManager.InteractionManager + pyload.interaction.InteractionTask.InteractionTask + pyload.remote.ttypes diff --git a/docs/plugins/addon_plugin.rst b/docs/plugins/addon_plugin.rst index e18bd6b0f..bef5b115e 100644 --- a/docs/plugins/addon_plugin.rst +++ b/docs/plugins/addon_plugin.rst @@ -3,20 +3,20 @@ Addon - Add new functionality ============================= -A Hook is a python file which is located at :file:`module/plugins/hooks`. -The :class:`HookManager <module.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 <module.HookManager.HookManager>`, -do something completely autonomic and has full access to the :class:`Api <module.Api.Api>` and every detail of pyLoad. +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 completely 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 implemented as hooks. Hook header ----------- -Your hook needs to subclass :class:`Hook <module.plugins.Hook.Hook>` and will inherit all of its methods, so make sure to check it's documentation! +Your hook needs to subclass :class:`Hook <pyload.plugins.Hook.Hook>` and will inherit all of its methods, so make sure to check it's documentation! All hooks should start with something like this: :: - from module.plugins.Hook import Hook + from pyload.plugins.Hook import Hook class YourHook(Hook): __name__ = "YourHook" @@ -43,16 +43,16 @@ Interacting on Events The next step is to think about where your Hook action takes place. -The easiest way is to overwrite specific methods defined by the :class:`Hook <module.plugins.Hook.Hook>` base class. +The easiest way is to overwrite specific methods defined by the :class:`Hook <pyload.plugins.Hook.Hook>` base class. The name is indicating when the function gets called. -See :class:`Hook <module.plugins.Hook.Hook>` page for a complete listing. +See :class:`Hook <pyload.plugins.Hook.Hook>` page for a complete listing. -You should be aware of the arguments the hooks are called with, whether its a :class:`PyFile <module.PyFile.PyFile>` -or :class:`PyPackage <module.PyPackage.PyPackage>` you should read the relevant documentation to know how to access it's great power and manipulate them. +You should be aware of the arguments the hooks are called with, whether its a :class:`PyFile <pyload.PyFile.PyFile>` +or :class:`PyPackage <pyload.PyPackage.PyPackage>` you should read the relevant documentation to know how to access it's great power and manipulate them. What a basic excerpt would look like: :: - from module.plugins.Hook import Hook + from pyload.plugins.Hook import Hook class YourHook(Hook): """ @@ -70,12 +70,12 @@ in a thread, in order to not block the main thread. This should be used for all Another and more flexible and powerful way is to use the event listener. All hook methods exists as event and very useful additional events are dispatched by the core. For a little overview look -at :class:`HookManager <module.HookManager.HookManager>`. Keep in mind that you can define your own events and other people may listen on them. +at :class:`HookManager <pyload.HookManager.HookManager>`. Keep in mind that you can define your own events and other people may listen on them. For your convenience it's possible to register listeners automatically via the ``event_map`` attribute. It requires a `dict` that maps event names to function names or a `list` of function names. It's important that all names are strings :: - from module.plugins.Hook import Hook + from pyload.plugins.Hook import Hook class YourHook(Hook): """ @@ -96,7 +96,7 @@ It requires a `dict` that maps event names to function names or a `list` of func An advantage of the event listener is that you are able to register and remove the listeners at runtime. Use `self.manager.addEvent("name", function)`, `self.manager.removeEvent("name", function)` and see doc for -:class:`HookManager <module.HookManager.HookManager>`. Contrary to ``event_map``, ``function`` has to be a reference +:class:`HookManager <pyload.HookManager.HookManager>`. Contrary to ``event_map``, ``function`` has to be a reference and **not** a `string`. We introduced events because it scales better if there is a huge amount of events and hooks. So all future interactions will be exclusively @@ -107,12 +107,12 @@ Providing RPC services ---------------------- -You may have noticed that pyLoad has an :class:`Api <module.Api.Api>`, which can be used internal or called by clients via RPC. +You may have 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: :: - from module.plugins.Hook import Hook, Expose + from pyload.plugins.Hook import Hook, Expose class YourHook(Hook): """ @@ -123,7 +123,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 <module.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 @@ -133,11 +133,11 @@ 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 <module.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``. :: - from module.plugins.Hook import Hook + from pyload.plugins.Hook import Hook class YourHook(Hook): """ @@ -160,4 +160,4 @@ Example ------- Sorry but you won't find an example here ;-) - Look at :file:`module/plugins/hooks` and you will find plenty examples there. + Look at :file:`pyload/plugins/hooks` and you will find plenty examples there. diff --git a/docs/plugins/base_plugin.rst b/docs/plugins/base_plugin.rst index 3e1d5f952..5fa110fe7 100644 --- a/docs/plugins/base_plugin.rst +++ b/docs/plugins/base_plugin.rst @@ -3,8 +3,8 @@ Base Plugin - And here it begins... =================================== -A Plugin in pyLoad is a python file located at one of the subfolders in :file:`module/plugins/`. -All different plugin types inherit from :class:`Base <module.plugins.Base.Base>`, which defines basic methods +A Plugin in pyLoad is a python file located at one of the subfolders in :file:`pyload/plugins/`. +All different plugin types inherit from :class:`Base <pyload.plugins.Base.Base>`, which defines basic methods and meta data. You should read this section carefully, because it's the base for all plugin development. It is also a good idea to look at the class diagram [1]_ for all plugin types to get an overview. At last you should look at several already existing plugin to get a more detailed idea of how @@ -14,23 +14,23 @@ Meta Data --------- All important data which must be known by pyLoad is set using class attributes pre- and suffixed with ``__``. -An overview of acceptable values can be found in :class:`Base <module.plugins.Base.Base>` source code. +An overview of acceptable values can be found in :class:`Base <pyload.plugins.Base.Base>` source code. Unneeded attributes can be left out, except ``__version__``. Nevertheless please fill out most information as you can, when you want to submit your plugin to the public repository. -Additionally :class:`Crypter <module.plugins.Crypter.Crypter>` and :class:`Hoster <module.plugins.Hoster.Hoster>` +Additionally :class:`Crypter <pyload.plugins.Crypter.Crypter>` and :class:`Hoster <pyload.plugins.Hoster.Hoster>` needs to have a specific regexp [2]_ ``__pattern__``. This will be matched against input url's and if a suited plugin is found it is selected to handle the url. For localization pyLoad supports gettext [3]_, to mark strings for translation surround them with ``_("...")``. -You don't need to subclass :class:`Base <module.plugins.Base.Base>` directly, but the +You don't need to subclass :class:`Base <pyload.plugins.Base.Base>` directly, but the intermediate type according to your plugin. As an example we choose a hoster plugin, but the same is true for all plugin types. How a basic hoster plugin header could look like:: - from module.plugin.Hoster import Hoster + from pyload.plugin.Hoster import Hoster class MyFileHoster(Hoster): __version__ = "0.1" @@ -81,10 +81,10 @@ ip_check A hoster that checks ip, that can be avoided with reconnect Basic Methods ------------- -All methods can be looked up at :class:`Base <module.plugins.Base.Base>`. To note some important ones: +All methods can be looked up at :class:`Base <pyload.plugins.Base.Base>`. To note some important ones: The pyload core instance is accessible at ``self.core`` attribute -and the :class:`Api <module.Api.Api>` at ``self.core.api`` +and the :class:`Api <pyload.Api.Api>` at ``self.core.api`` With ``self.load(...)`` you can load any url and get the result. This method is only available to Hoster and Crypter. For other plugins use ``getURL(...)`` or ``getRequest()``. diff --git a/docs/plugins/crypter_plugin.rst b/docs/plugins/crypter_plugin.rst index 8c54dccb1..b10dd27f9 100644 --- a/docs/plugins/crypter_plugin.rst +++ b/docs/plugins/crypter_plugin.rst @@ -3,12 +3,12 @@ Crypter - Extract links from pages ================================== -We are starting with the simplest plugin, the :class:`Crypter <module.plugins.Crypter.Crypter>`. +We are starting with the simplest plugin, the :class:`Crypter <pyload.plugins.Crypter.Crypter>`. It's job is to take an url as input and generate a new package or links, for example by filtering the urls or loading a page and extracting links from the html code. You need to define the ``__pattern__`` to match -target urls and subclass from :class:`Crypter <module.plugins.Crypter.Crypter>`. :: +target urls and subclass from :class:`Crypter <pyload.plugins.Crypter.Crypter>`. :: - from module.plugin.Crypter import Crypter + from pyload.plugin.Crypter import Crypter class MyFileCrypter(Crypter): __pattern__ = r"mycrypter.com/id/([0-9]+)" @@ -28,7 +28,7 @@ Generating Packages When finished with decrypting just return the urls as list and they will be added to the package. You can also create new Packages if needed by instantiating a :class:`Package` instance, which will look like the following:: - from module.plugin.Crypter import Crypter, Package + from pyload.plugin.Crypter import Crypter, Package class MyFileCrypter(Crypter): @@ -52,12 +52,12 @@ your code you can use:: SimpleCrypter ------------- -For simple crypter services there is the :class:`SimpleCrypter <module.plugins.internal.SimpleCrypter.SimpleCrypter>` class which handles most of the workflow. Only the regexp +For simple crypter services there is the :class:`SimpleCrypter <pyload.plugins.internal.SimpleCrypter.SimpleCrypter>` class which handles most of the workflow. Only the regexp pattern has to be defined. Exmaple:: - from module.plugins.internal.SimpleCrypter import SimpleCrypter + from pyload.plugins.internal.SimpleCrypter import SimpleCrypter class MyFileCrypter(SimpleCrypter): diff --git a/docs/plugins/hoster_plugin.rst b/docs/plugins/hoster_plugin.rst index 9cd99a1f5..55a973463 100644 --- a/docs/plugins/hoster_plugin.rst +++ b/docs/plugins/hoster_plugin.rst @@ -7,7 +7,7 @@ We head to the next important section, the ``process`` method of your plugin. In fact the ``process`` method is the only functionality your plugin has to provide, but its always a good idea to split up tasks to not produce spaghetti code. An example ``process`` function could look like this :: - from module.plugin.Hoster import Hoster + from pyload.plugin.Hoster import Hoster class MyFileHoster(Hoster): """ @@ -27,7 +27,7 @@ An example ``process`` function could look like this :: # download the file, destination is determined by pyLoad self.download(parsed_url) -You need to know about the :class:`PyFile <module.PyFile.PyFile>` class, since an instance of it is given as a parameter to every pyfile. +You need to know about the :class:`PyFile <pyload.PyFile.PyFile>` class, since an instance of it is given as a parameter to every pyfile. Some tasks your plugin should handle: check if the file is online, get filename, wait if needed, download the file, etc.. Common Tasks @@ -37,7 +37,7 @@ Some hosters require you to wait a specific time. Just set the time with ``self. ``self.setWait(seconds, True)`` if you want pyLoad to perform a reconnect if needed. To handle captcha input just use ``self.decryptCaptcha(url, ...)``, it will be send to clients -or handled by :class:`Addon <module.plugins.Addon.Addon>` plugins +or handled by :class:`Addon <pyload.plugins.Addon.Addon>` plugins Online status fetching @@ -54,4 +54,4 @@ Testing Examples -------- -The best examples are the already existing plugins in :file:`module/plugins/`.
\ No newline at end of file +The best examples are the already existing plugins in :file:`pyload/plugins/`.
\ No newline at end of file |