From: Florent Bruneau Date: Sat, 27 Nov 2010 15:19:24 +0000 (+0100) Subject: Lists RPC: print the name of method to execute and fix annoying warning about X-Git-Tag: xorg/1.0.2~32^2~33 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ae525b0ebeec40cfeb7d14328fd7f15feb711792;p=platal.git Lists RPC: print the name of method to execute and fix annoying warning about int not being subscriptable. Signed-off-by: Florent Bruneau --- diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index 074c681..514bb5c 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -241,6 +241,7 @@ def list_call_dispatcher(method, userdesc, perms, vhost, *arg): @root: the handler requires site admin rights """ try: + print "calling method: %s" % method if has_annotation(method, "root") and perms != "admin": return 0 if has_annotation(method, "mlist"): @@ -312,7 +313,7 @@ def get_list_info(userdesc, perms, mlist, front_page=0): 'nbsub': len(members) } return (details, members) - return 0 + return None def get_options(userdesc, perms, mlist, opts): """ Get the options of a list. @@ -365,8 +366,9 @@ def get_lists(userdesc, perms, vhost, email=None): except: continue try: - details = get_list_info(udesc, perms, mlist, (email is None and vhost == PLATAL_DOMAIN))[0] - result.append(details) + details = get_list_info(udesc, perms, mlist, (email is None and vhost == PLATAL_DOMAIN)) + if details is not None: + result.append(details[0]) except Exception, e: sys.stderr.write('Can\'t get list %s: %s\n' % (name, str(e))) continue