# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2005 The Trustees of Princeton University
#
-# $Id: Shell.py,v 1.5 2006/10/03 19:34:05 mlhuang Exp $
+# $Id: Shell.py,v 1.6 2006/10/18 19:42:46 tmack Exp $
#
import os, sys
# Figure out if the function requires an authentication
# structure as its first argument.
self.auth = False
- func = api.callable(method)
try:
- #func = api.callable(method)
+ func = api.callable(method)
if func.accepts and \
(isinstance(func.accepts[0], Auth) or \
(isinstance(func.accepts[0], Mixed) and \
filter(lambda param: isinstance(param, Auth), func.accepts[0]))):
self.auth = True
except:
+ traceback.print_exc()
# XXX Ignore undefined methods for now
pass
(not args or not isinstance(args[0], dict) or not args[0].has_key('AuthMethod')):
return self.func(auth, *args, **kwds)
else:
- return self.func(*args)
+ return self.func(*args, **kwds)
if server is not None:
methods = server.system.listMethods()
result = eval(command)
if result is not None:
print result
- except:
+ except SyntaxError:
# Fall back to executing as a statement
exec command
except Exception, err: