From 8130579c31982c4faa4c8bdff16ec67f43536b52 Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Wed, 29 Dec 2010 16:10:29 +0100 Subject: [PATCH] Updated documentation. --- sjrpc/utils/handlers.py | 8 ++++++-- sjrpc/utils/proxies.py | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sjrpc/utils/handlers.py b/sjrpc/utils/handlers.py index d0eedf9..7529f9d 100644 --- a/sjrpc/utils/handlers.py +++ b/sjrpc/utils/handlers.py @@ -4,6 +4,9 @@ class RpcHandler(object): ''' Basic RPC functions handler. + + Derive this call in your handler and define some methods. All the defined + methods (including privates) are available to your peer. ''' def __getitem__(self, name): @@ -12,8 +15,9 @@ class RpcHandler(object): else: raise KeyError(name) - +# # Decorators: +# def threadless(func): ''' @@ -27,7 +31,7 @@ def threadless(func): def pure(func): ''' Function handler decorator -- the function is a pure fonction, caller will - not pass :class:`RpcConnection` object in call parameters. + not pass :class:`RpcConnection` object as first call parameters. ''' func.__pure__ = True diff --git a/sjrpc/utils/proxies.py b/sjrpc/utils/proxies.py index b58d21a..242f98f 100644 --- a/sjrpc/utils/proxies.py +++ b/sjrpc/utils/proxies.py @@ -20,6 +20,9 @@ class ConnectionProxy(object): >>> proxy.unknown_function() [Traceback] NameError: remote name 'unknown_function' is not defined + + >>> proxy['myfunc']() # You can also use this syntax + ... ''' def __init__(self, connection): -- GitLab