From c961a3092b2e3c68b31073d904c0ea32b91db5c5 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Fri, 27 Oct 2006 15:26:44 +0000 Subject: [PATCH] - append parent directory to sys.path - automagically add SessionAuth, too --- Shell.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.47.0