diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-02-05 17:27:13 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-02-05 17:27:13 +0100 |
commit | da4cf026ad116518fefc3429b74a8cd94aeef73f (patch) | |
tree | f555fde96747f27ae5fb2f258b0290e368d9d5ee | |
parent | closed #261 (diff) | |
download | pyload-da4cf026ad116518fefc3429b74a8cd94aeef73f.tar.xz |
updated documentation + diagrams
-rw-r--r-- | docs/index.rst | 2 | ||||
-rw-r--r-- | docs/module_overview.rst | 2 | ||||
-rw-r--r-- | docs/plugins/base_plugin.rst | 24 | ||||
-rw-r--r-- | docs/plugins/crypter_plugin.rst | 18 | ||||
-rw-r--r-- | docs/plugins/hoster_plugin.rst | 5 | ||||
-rwxr-xr-x | docs/plugins/overview.rst | 5 | ||||
-rw-r--r-- | docs/system/hoster_diagrams.rst | 16 | ||||
-rwxr-xr-x | docs/system/overview.rst | 25 | ||||
-rw-r--r-- | docs/system/plugin_hierarchy.rst | 9 | ||||
-rw-r--r-- | docs/system/pyload_PluginHierarchy.png | bin | 0 -> 23553 bytes | |||
-rw-r--r-- | docs/system/pyload_ad_Hoster.png | bin | 0 -> 34237 bytes | |||
-rw-r--r-- | docs/system/pyload_sd_Hoster.png | bin | 0 -> 28501 bytes |
12 files changed, 92 insertions, 14 deletions
diff --git a/docs/index.rst b/docs/index.rst index 31d688e65..b18f068f2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,6 +31,8 @@ Contents api/overview.rst plugins/overview.rst + system/overview.rst + module_overview.rst .. currentmodule:: module diff --git a/docs/module_overview.rst b/docs/module_overview.rst index b8db51538..1e771f36a 100644 --- a/docs/module_overview.rst +++ b/docs/module_overview.rst @@ -10,7 +10,9 @@ A little selection of most important modules in 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.Hook.Hook module.plugins.Account.Account module.plugins.MultiHoster.MultiHoster diff --git a/docs/plugins/base_plugin.rst b/docs/plugins/base_plugin.rst index 1849f3986..911f5d429 100644 --- a/docs/plugins/base_plugin.rst +++ b/docs/plugins/base_plugin.rst @@ -5,8 +5,9 @@ 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 -and meta data. You should read this section carefully, because it's the base for all plugin development. -After that it is a good idea to look at several already existing plugin to get a more detailed idea of how +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 they have to look like and whats possible with them. Meta Data @@ -18,15 +19,15 @@ Non needed attributes can be left out, except ``__version__``. Nevertheless plea as you can, when you want to submit your plugin to the public repo. Additionally :class:`Crypter <module.plugins.Crypter.Crypter>` and :class:`Crypter <module.plugins.Hoster.Hoster>` -needs to have a specific regexp [1]_ ``__pattern__``. This will be matched against input urls and if a suited +needs to have a specific regexp [2]_ ``__pattern__``. This will be matched against input urls 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 intermediate type according to your plugin. As example we choose an Hoster plugin, but the same is true for all plugin types. -For localization pyLoad supports gettext [2]_, to mark strings for translation surround them with ``_("...")``. - How basic hoster plugin header could look like:: from module.plugin.Hoster import Hoster @@ -102,14 +103,15 @@ To enable debugging functionality start pyLoad with ``-d`` option or enable it i You should use ``self.logDebug(msg)`` when ever it is reasonable. It is a good pratice to log server output or the calculation of results and then check in the log if it really it what you are expecting. -For further debugging you can install ipython [3]_, and set breakpoints with ``self.core.breakpoint()``. -It will open the python debugger [4]_ and pause the plugin thread. +For further debugging you can install ipython [4]_, and set breakpoints with ``self.core.breakpoint()``. +It will open the python debugger [5]_ and pause the plugin thread. To open a ipython shell in the running programm use ``self.shell()``. These methods are usefull to gain access to the code flow at runtime and check or modify variables. .. rubric:: Footnotes -.. [1] http://docs.python.org/library/re.html -.. [2] http://docs.python.org/library/gettext.html -.. [3] http://ipython.org/ -.. [4] http://docs.python.org/library/pdb.html
\ No newline at end of file +.. [1] :ref:`plugin_hierarchy` +.. [2] http://docs.python.org/library/re.html +.. [3] http://docs.python.org/library/gettext.html +.. [4] http://ipython.org/ +.. [5] http://docs.python.org/library/pdb.html
\ No newline at end of file diff --git a/docs/plugins/crypter_plugin.rst b/docs/plugins/crypter_plugin.rst index 1497ced07..4e7803808 100644 --- a/docs/plugins/crypter_plugin.rst +++ b/docs/plugins/crypter_plugin.rst @@ -19,7 +19,7 @@ target urls and subclass from :class:`Crypter <module.plugins.Crypter.Crypter>`. return urls You have to overwrite at least one of ``.decryptFile``, ``.decryptURL``, ``.decryptURLs``. The first one -is only useful for container files, whereas the last is usefull when it's possible to handle a bunch of urls +is only useful for container files, whereas the last is useful when it's possible to handle a bunch of urls at once. If in doubt, just overwrite `decryptURL`. Generating Packages @@ -44,8 +44,22 @@ And that's basically all you need to know. Just as little side-note if you want your code you can use:: plugin = self.core.pluginManager.loadClass("crypter", "NameOfThePlugin") + # Core instance is needed for decrypting # decrypted will be a list of urls - decrypted = plugin.decrypt(urls) + decrypted = plugin.decrypt(core, urls) + + +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 +pattern have to be defined. + +Exmaple:: + + from module.plugins.internal.SimpleCrypter import SimpleCrypter + + class MyFileCrypter(SimpleCrypter): Testing ------- diff --git a/docs/plugins/hoster_plugin.rst b/docs/plugins/hoster_plugin.rst index e4575a001..ee112b570 100644 --- a/docs/plugins/hoster_plugin.rst +++ b/docs/plugins/hoster_plugin.rst @@ -42,6 +42,11 @@ or handled by :class:`Hook <module.plugins.Hook.Hook>` plugins User interaction ---------------- + +SimpleHoster +------------ + + Testing ------- diff --git a/docs/plugins/overview.rst b/docs/plugins/overview.rst index 68ad96dfd..0388db7e2 100755 --- a/docs/plugins/overview.rst +++ b/docs/plugins/overview.rst @@ -15,6 +15,7 @@ Extending pyLoad pyLoad offers an comfortable and powerful plugin system to make extending possible. With it you only need to have some python knowledge and can just start right away writing your own plugins. This document gives you an overwiew about the conceptual part. You should not left out the :doc:`Base <base_plugin>` part, since it contains basic functionality for all plugins types. +A class diagram visualizing the relationship can be find below [1]_ .. rubric:: Contents @@ -28,4 +29,6 @@ conceptual part. You should not left out the :doc:`Base <base_plugin>` part, sin -.. rubric:: Footnotes
\ No newline at end of file +.. rubric:: Footnotes + +.. [1] :ref:`plugin_hierarchy`
\ No newline at end of file diff --git a/docs/system/hoster_diagrams.rst b/docs/system/hoster_diagrams.rst new file mode 100644 index 000000000..313f75c57 --- /dev/null +++ b/docs/system/hoster_diagrams.rst @@ -0,0 +1,16 @@ +.. _hoster_diagrams: + +=============== +Hoster Workflow +=============== + +The basic workflow of a hoster plugin. This is only a generalization, in most cases it is more complex +and order will differ. + +Activity Diagram +---------------- +.. image:: pyload_ad_Hoster.png + +Sequence Diagram +---------------- +.. image:: pyload_sd_Hoster.png
\ No newline at end of file diff --git a/docs/system/overview.rst b/docs/system/overview.rst new file mode 100755 index 000000000..00e439f45 --- /dev/null +++ b/docs/system/overview.rst @@ -0,0 +1,25 @@ +.. _overview: + +============= +System Design +============= + +.. pull-quote:: + Programs must be written for people to read, and only incidentally for machines to execute. + + -- H. Abelson and G. Sussman + + +.. rubric:: Motivation + +In this section you will find information and diagrams to better understand the concept of pyload. + +.. rubric:: Contents + +.. toctree:: + + plugin_hierarchy.rst + hoster_diagrams.rst + + +.. rubric:: Footnotes
\ No newline at end of file diff --git a/docs/system/plugin_hierarchy.rst b/docs/system/plugin_hierarchy.rst new file mode 100644 index 000000000..b663943a3 --- /dev/null +++ b/docs/system/plugin_hierarchy.rst @@ -0,0 +1,9 @@ +.. _plugin_hierarchy: + +================ +Plugin Hierarchy +================ + +Class diagram that describes plugin relationships. + +.. image:: pyload_PluginHierarchy.png
\ No newline at end of file diff --git a/docs/system/pyload_PluginHierarchy.png b/docs/system/pyload_PluginHierarchy.png Binary files differnew file mode 100644 index 000000000..f1a753ee2 --- /dev/null +++ b/docs/system/pyload_PluginHierarchy.png diff --git a/docs/system/pyload_ad_Hoster.png b/docs/system/pyload_ad_Hoster.png Binary files differnew file mode 100644 index 000000000..0ee064edc --- /dev/null +++ b/docs/system/pyload_ad_Hoster.png diff --git a/docs/system/pyload_sd_Hoster.png b/docs/system/pyload_sd_Hoster.png Binary files differnew file mode 100644 index 000000000..e629a1949 --- /dev/null +++ b/docs/system/pyload_sd_Hoster.png |