From b48992ea6f0dd765cafbb38fdd798f1bb1a2d600 Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 6 Nov 2007 19:33:49 +0000 Subject: [PATCH] Enable srfsh.py to load with the standard .srfsh.xml (no plugins) git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1123 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/srfsh.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/python/srfsh.py b/src/python/srfsh.py index 3c9cff9..6528f1b 100755 --- a/src/python/srfsh.py +++ b/src/python/srfsh.py @@ -1,4 +1,5 @@ #!/usr/bin/python2.4 +# vim:et:ts=4 import os, sys, time, readline, atexit, re from string import * from osrf.system import osrfConnect @@ -99,7 +100,7 @@ def handle_help(): # ------------------------------------------------------------------- -# performs an opesnrf request +# performs an opensrf request # ------------------------------------------------------------------- def handle_request(parts): service = parts.pop(0) @@ -221,7 +222,14 @@ def do_connect(): def load_plugins(): # Load the user defined external plugins # XXX Make this a real module interface, with tab-complete words, commands, etc. - plugins = osrfConfigValue('plugins') + try: + plugins = osrfConfigValue('plugins') + + except: + # XXX standard srfsh.xml does not yet define element + print_red("No plugins defined in /srfsh/plugins/plugin\n") + return + plugins = osrfConfigValue('plugins.plugin') if not isinstance(plugins, list): plugins = [plugins] -- 2.43.2