Author: damoxc
Revision: 5526
Log:
update documentation about the webui
Diff:
Modified: trunk/deluge/ui/web/auth.py
===================================================================
--- trunk/deluge/ui/web/auth.py 2009-07-22 23:52:18 UTC (rev 5525)
+++ trunk/deluge/ui/web/auth.py 2009-07-22 23:53:30 UTC (rev 5526)
@@ -53,6 +53,9 @@
log = logging.getLogger(__name__)
class Auth(JSONComponent):
+ """
+ The component that implements authentification into the JSON interface.
+ """
def __init__(self):
super(Auth, self).__init__("Auth")
@@ -61,8 +64,9 @@
"""
Creates a new session.
- :keyword login: str, the username of the user logging in, currently
+ :keyword login: the username of the user logging in, currently \
only for future use.
+ :type login: string
"""
m = hashlib.md5()
m.update(login)
@@ -87,7 +91,8 @@
"""
Change the password.
- :param new_password: str, the password to change to
+ :param new_password: the password to change to
+ :type new_password: string
"""
log.debug("Changing password")
d = Deferred()
@@ -106,9 +111,10 @@
"""
Check a session to see if it's still valid.
- :param session_id: str, the id for the session to remove
+ :param session_id: the id for the session to remove
+ :type session_id: string
:returns: True if the session is valid, False if not.
- :rtype: bool
+ :rtype: booleon
"""
d = Deferred()
config = component.get("DelugeWeb").config
@@ -120,7 +126,8 @@
"""
Removes a session.
- :param session_id: str, the id for the session to remove
+ :param session_id: the id for the session to remove
+ :type session_id: string
"""
d = Deferred()
config = component.get("DelugeWeb").config
@@ -133,8 +140,10 @@
"""
Test a password to see if it's valid.
- :param password: str, the password to test
+ :param password: the password to test
+ :type password: string
:returns: a session id or False
+ :rtype: string or False
"""
config = component.get("DelugeWeb").config
d = Deferred()
Modified: trunk/deluge/ui/web/common.py
===================================================================
--- trunk/deluge/ui/web/common.py 2009-07-22 23:52:18 UTC (rev 5525)
+++ trunk/deluge/ui/web/common.py 2009-07-22 23:53:30 UTC (rev 5526)
@@ -40,6 +40,9 @@
_ = lambda x: gettext.gettext(x).decode("utf-8")
class Template(MakoTemplate):
+ """
+ A template that adds some built-ins to the rendering
+ """
builtins = {
"_": _,
Modified: trunk/deluge/ui/web/gen_gettext.py
===================================================================
--- trunk/deluge/ui/web/gen_gettext.py 2009-07-22 23:52:18 UTC (rev 5525)
+++ trunk/deluge/ui/web/gen_gettext.py 2009-07-22 23:53:30 UTC (rev 5526)
@@ -1,4 +1,7 @@
#!/usr/bin/python
+"""
+Script to go through the javascript files and dynamically generate gettext.js
+"""
import os
import re
Modified: trunk/deluge/ui/web/json_api.py
===================================================================
--- trunk/deluge/ui/web/json_api.py 2009-07-22 23:52:18 UTC (rev 5525)
+++ trunk/deluge/ui/web/json_api.py 2009-07-22 23:53:30 UTC (rev 5526)
@@ -68,8 +68,10 @@
Decorator function to register an object's method as an RPC. The object
will need to be registered with an `:class:RPCServer` to be effective.
- :param func: function, the function to export
- :param auth_level: int, the auth level required to call this method
+ :param func: the function to export
+ :type func: function
+ :keyword auth_level: the auth level required to call this method
+ :type auth_level: int
"""
global AUTH_LEVEL_DEFAULT
@@ -254,8 +256,10 @@
Registers an object to export it's rpc methods. These methods should
be exported with the export decorator prior to registering the object.
- :param obj: object, the object that we want to export
- :param name: str, the name to use, if None, it will be the class name
of the object
+ :param obj: the object that we want to export
+ :type obj: object
+ :param name: the name to use, if None, it will be the class name of
the object
+ :type name: string
"""
name = name or obj.__class__.__name__
name = name.lower()
@@ -289,6 +293,11 @@
FILES_KEYS = ["files", "file_progress", "file_priorities"]
class WebApi(JSONComponent):
+ """
+ The component that implements all the methods required for managing
+ the web interface.
+ """
+
def __init__(self):
super(WebApi, self).__init__("Web")
self.host_list = ConfigManager("hostlist.conf.1.2", DEFAULT_HOSTS)
@@ -297,7 +306,8 @@
"""
Return the information about a host
- :param host_id: str, the id of the host
+ :param host_id: the id of the host
+ :type host_id: string
:returns: the host information
:rtype: list
"""
@@ -310,7 +320,8 @@
"""
Connect the client to a daemon
- :param host_id: str, the id of the daemon in the host list
+ :param host_id: the id of the daemon in the host list
+ :type host_id: string
:returns: the methods the daemon supports
:rtype: list
"""
@@ -329,7 +340,7 @@
The current connection state.
:returns: True if the client is connected
- :rtype: bool
+ :rtype: booleon
"""
d = Deferred()
d.callback(client.connected())
@@ -350,10 +361,12 @@
"""
Gather the information required for updating the web interface.
- :param keys: list, the information about the torrents to gather
- :param filter_dict: dict, the filters to apply when selecting torrents.
+ :param keys: the information about the torrents to gather
+ :type keys: list
+ :param filter_dict: the filters to apply when selecting torrents.
+ :type filter_dict: dictionary
:returns: The torrent and ui information.
- :rtype: dict
+ :rtype: dictionary
"""
ui_info = {
"torrents": None,
@@ -421,9 +434,10 @@
"""
Gets the files for a torrent in tree format
- :param torrent_id: string, the id of the torrent to retrieve.
+ :param torrent_id: the id of the torrent to retrieve.
+ :type torrent_id: string
:returns: The torrents files in a tree
- :rtype: dict
+ :rtype: dictionary
"""
main_deferred = Deferred()
d = client.core.get_torrent_status(torrent_id, FILES_KEYS)
@@ -435,9 +449,10 @@
"""
Download a torrent file from a url to a temporary directory.
- :param url: str, the url of the torrent
+ :param url: the url of the torrent
+ :type url: string
:returns: the temporary file name of the torrent file
- :rtype: str
+ :rtype: string
"""
tmp_file = os.path.join(tempfile.gettempdir(), url.split("/")[-1])
@@ -452,7 +467,8 @@
"""
Return information about a torrent on the filesystem.
- :param filename: str, the path to the torrent
+ :param filename: the path to the torrent
+ :type filename: string
:returns:
{
"filename": the torrent file
@@ -461,6 +477,7 @@
"files": the files the torrent contains
"info_hash" the torrents info_hash
}
+ :rtype: dictionary
"""
d = Deferred()
try:
@@ -509,6 +526,9 @@
def get_host_status(self, host_id):
"""
Returns the current status for the specified host.
+
+ :param host_id: the hash id of the host
+ :type host_id: string
"""
main_deferred = Deferred()
@@ -551,12 +571,12 @@
return main_deferred
@export
- def stop_daemon(self, connection_id):
+ def stop_daemon(self, host_id):
"""
Stops a running daemon.
- :param connection_id: str, the hash id of the connection
-
+ :param host_id: the hash id of the host
+ :type host_id: string
"""
main_deferred = Deferred()
host = self.get_host(connection_id)
@@ -589,10 +609,14 @@
"""
Adds a host to the list.
- :param host: str, the hostname
- :param port: int, the port
- :param username: str, the username to login as
- :param password: str, the password to login with
+ :param host: the hostname
+ :type host: string
+ :param port: the port
+ :type port: int
+ :keyword username: the username to login as
+ :type username: string
+ :keyword password: the password to login with
+ :type password: string
"""
d = Deferred()
@@ -621,8 +645,8 @@
"""
Removes a host for the list
- :param connection_Id: str, the hash id of the connection
-
+ :param host_id: the hash id of the host
+ :type host_id: string
"""
d = Deferred()
host = self.get_host(connection_id)
Modified: trunk/deluge/ui/web/pluginmanager.py
===================================================================
--- trunk/deluge/ui/web/pluginmanager.py 2009-07-22 23:52:18 UTC (rev
5525)
+++ trunk/deluge/ui/web/pluginmanager.py 2009-07-22 23:53:30 UTC (rev
5526)
@@ -49,13 +49,18 @@
PluginManagerBase.__init__(self, "web.conf", "deluge.plugin.web")
def start(self):
- """Start up the plugin manager"""
+ """
+ Start up the plugin manager
+ """
# Update the enabled plugins from the core
d = client.core.get_enabled_plugins()
d.addCallback(self._on_get_enabled_plugins)
def stop(self):
+ """
+ Stop the plugin manager
+ """
self.disable_plugins()
def update(self):
Modified: trunk/docs/source/index.rst
===================================================================
--- trunk/docs/source/index.rst 2009-07-22 23:52:18 UTC (rev 5525)
+++ trunk/docs/source/index.rst 2009-07-22 23:53:30 UTC (rev 5526)
@@ -25,6 +25,8 @@
.. toctree::
:maxdepth: 2
+ :glob:
- modules/common
- modules/config
+ modules/*
+ modules/*/*
+ modules/*/*/*
\ No newline at end of file
Added: trunk/docs/source/modules/ui/web/auth.rst
===================================================================
--- trunk/docs/source/modules/ui/web/auth.rst (rev 0)
+++ trunk/docs/source/modules/ui/web/auth.rst 2009-07-22 23:53:30 UTC (rev
5526)
@@ -0,0 +1,5 @@
+:mod:`deluge.ui.web.auth`
+=========================
+
+.. automodule:: deluge.ui.web.auth
+ :members:
Added: trunk/docs/source/modules/ui/web/common.rst
===================================================================
--- trunk/docs/source/modules/ui/web/common.rst (rev 0)
+++ trunk/docs/source/modules/ui/web/common.rst 2009-07-22 23:53:30 UTC (rev
5526)
@@ -0,0 +1,5 @@
+:mod:`deluge.ui.web.common`
+===========================
+
+.. automodule:: deluge.ui.web.common
+ :members:
Added: trunk/docs/source/modules/ui/web/json_api.rst
===================================================================
--- trunk/docs/source/modules/ui/web/json_api.rst
(rev 0)
+++ trunk/docs/source/modules/ui/web/json_api.rst 2009-07-22 23:53:30 UTC
(rev 5526)
@@ -0,0 +1,5 @@
+:mod:`deluge.ui.web.json_api`
+=============================
+
+.. automodule:: deluge.ui.web.json_api
+ :members:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---