From: Mark Huang Date: Fri, 27 Oct 2006 15:26:44 +0000 (+0000) Subject: - append parent directory to sys.path X-Git-Tag: pycurl-7_13_1~441 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c961a3092b2e3c68b31073d904c0ea32b91db5c5;p=plcapi.git - append parent directory to sys.path - automagically add SessionAuth, too --- diff --git a/Shell.py b/Shell.py index c0073157..613d40a6 100755 --- a/Shell.py +++ b/Shell.py @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2005 The Trustees of Princeton University # -# $Id: Shell.py,v 1.7 2006/10/19 19:58:50 mlhuang Exp $ +# $Id: Shell.py,v 1.8 2006/10/20 18:25:39 mlhuang Exp $ # import os, sys @@ -16,6 +16,9 @@ import pg import xmlrpclib import getpass +# Append PLC to the system path +sys.path.append(os.path.dirname(os.path.realpath(sys.argv[0]))) + from PLC.API import PLCAPI from PLC.Parameter import Mixed from PLC.Auth import Auth @@ -178,7 +181,9 @@ class Callable: """ if self.auth and \ - (not args or not isinstance(args[0], dict) or not args[0].has_key('AuthMethod')): + (not args or not isinstance(args[0], dict) or \ + (not args[0].has_key('AuthMethod') and \ + not args[0].has_key('session'))): return self.func(auth, *args, **kwds) else: return self.func(*args, **kwds)