Module: deluge
Branch: multiuser
Commit: 144976602b3088e89fd98038ba99385c12e41637

Author: Pedro Algarvio <[email protected]>
Date:   Wed Dec 15 18:27:47 2010 +0000

Add some docstrings.

---

 deluge/core/authmanager.py |   10 ++++++++++
 deluge/core/rpcserver.py   |    3 +++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/deluge/core/authmanager.py b/deluge/core/authmanager.py
index 09ce33c..53ac13b 100644
--- a/deluge/core/authmanager.py
+++ b/deluge/core/authmanager.py
@@ -71,6 +71,16 @@ class AuthManager(component.Component):
         pass
 
     def peek(self, username):
+        """
+        Peeks users based on username and returns their auth level
+
+        :param username: str, username
+        :returns: int, the auth level for this user
+        :rtype: int
+
+        :raises BadLoginError: if the username does not exist or password does 
not match
+
+        """
         if username not in self.__auth:
             # Let's try to re-load the file.. Maybe it's been updated
             self.__load_auth_file()
diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py
index b6710d6..c99f2e4 100644
--- a/deluge/core/rpcserver.py
+++ b/deluge/core/rpcserver.py
@@ -253,6 +253,9 @@ class DelugeRPCProtocol(Protocol):
             ))
 
         if method == "daemon.peek":
+            # This is a special case and used in the initial connection process
+            # We need to peek the user here in order to get an auth level back
+            # and see if the user exists.
             try:
                 ret = component.get("AuthManager").peek(*args, **kwargs)
                 if ret:

-- 
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.

Reply via email to