diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/build_docs.py | 8 | ||||
-rw-r--r-- | docs/docs.conf | 2 | ||||
-rw-r--r-- | docs/write_addons.rst | 11 | ||||
-rw-r--r-- | docs/write_plugins.rst | 3 |
4 files changed, 20 insertions, 4 deletions
diff --git a/docs/build_docs.py b/docs/build_docs.py index 15fc2070d..8a7ab7a18 100644 --- a/docs/build_docs.py +++ b/docs/build_docs.py @@ -34,7 +34,9 @@ sys.path.append(dir_name) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', + 'sphinx.ext.viewcode'] autosummary_generate = True autodoc_default_flags = ['members'] @@ -201,8 +203,8 @@ htmlhelp_basename = 'pyLoaddoc' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'pyLoad.tex', u'pyLoad Documentation', - u'pyLoad Team', 'manual'), + ('index', 'pyLoad.tex', u'pyLoad Documentation', + u'pyLoad Team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/docs/docs.conf b/docs/docs.conf index 51bab49fb..61a2c45ee 100644 --- a/docs/docs.conf +++ b/docs/docs.conf @@ -1,5 +1,5 @@ -# usage: epydoc --conf docs.conf , results goes to ~/.pyload/docs +#@NOTE: usage: epydoc --conf docs.conf , results goes to ~/.pyload/docs [epydoc] diff --git a/docs/write_addons.rst b/docs/write_addons.rst index 9f4436cc5..b7f6dfdb8 100644 --- a/docs/write_addons.rst +++ b/docs/write_addons.rst @@ -18,6 +18,7 @@ All addons should start with something like this: :: from pyload.plugin.Addon import Addon + class YourAddon(Addon): __name = "YourAddon" __version = "0.1" @@ -53,6 +54,7 @@ A basic excerpt would look like: :: from pyload.plugin.Addon import Addon + class YourAddon(Addon): """ Your Addon code here. @@ -61,6 +63,7 @@ A basic excerpt would look like: :: def activate(self): print "Yay, the core is ready let's do some work." + def downloadFinished(self, pyfile): print "A Download just finished." @@ -73,20 +76,25 @@ It requires a `dict` that maps event names to function names or a `list` of func from pyload.plugin.Addon import Addon + class YourAddon(Addon): """ Your Addon code here. """ + event_map = {'downloadFinished': "doSomeWork", 'allDownloadsFnished': "someMethod", 'activate': "initialize"} + def initialize(self): print "Initialized." + def doSomeWork(self, pyfile): print "This is equivalent to the above example." + def someMethod(self): print "The underlying event (allDownloadsFinished) for this method is not available through the base class" @@ -109,6 +117,7 @@ Sounds complicated but is very easy to do. Just use the ``Expose`` decorator: :: from pyload.plugin.Addon import Addon, Expose + class YourAddon(Addon): """ Your Addon code here. @@ -134,6 +143,7 @@ Just store everything in ``self.info``. :: from pyload.plugin.Addon import Addon + class YourAddon(Addon): """ Your Addon code here. @@ -142,6 +152,7 @@ Just store everything in ``self.info``. :: def setup(self): self.info = {'running': False} + def activate(self): self.info['running'] = True diff --git a/docs/write_plugins.rst b/docs/write_plugins.rst index 64868d638..af35a8d55 100644 --- a/docs/write_plugins.rst +++ b/docs/write_plugins.rst @@ -21,6 +21,7 @@ How basic hoster plugin header could look like: :: from pyload.plugin.Hoster import Hoster + class MyFileHoster(Hoster): __name = "MyFileHoster" __version = "0.1" @@ -43,6 +44,7 @@ An example ``process`` function could look like this :: from pyload.plugin.Hoster import Hoster + class MyFileHoster(Hoster): """ plugin code @@ -83,6 +85,7 @@ Example: :: from pyload.plugin.Crypter import Crypter + class MyFileCrypter(Crypter): """ plugin code |