From d15b2792c45b1fb355c93778f941e82ab19a2e99 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 23 May 2008 15:43:48 +0000 Subject: [PATCH] defaulting to config.opensrf for config context. added some initial settings server loading git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1342 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/opensrf.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/python/opensrf.py b/src/python/opensrf.py index 2c3aad8..1204f40 100755 --- a/src/python/opensrf.py +++ b/src/python/opensrf.py @@ -20,7 +20,7 @@ # ----------------------------------------------------------------------- import sys, getopt, os, signal -import osrf.system, osrf.server, osrf.app +import osrf.system, osrf.server, osrf.app, osrf.set, osrf.json def do_help(): print ''' @@ -70,7 +70,7 @@ if '-a' not in options or '-s' not in options or '-f' not in options: action = options['-a'] service = options['-s'] config_file = options['-f'] -config_ctx = options.get('-c', 'opensrf') +config_ctx = options.get('-c', 'config.opensrf') pid_dir = options.get('-p', '/tmp') as_daemon = '-d' in options pidfile = "%s/osrf_py_%s.pid" % (pid_dir, service) @@ -82,6 +82,13 @@ def do_start(): osrf.system.System.net_connect( config_file = config_file, config_context = config_ctx) + osrf.set.load(osrf.conf.get('domain')) + settings = osrf.json.to_json(osrf.set.get('apps/%s' % service)) + + if settings['language'].lower() != 'python': + print '%s is not a Python application' % service + return + # XXX load the settings configs... osrf.app.Application.load(service, 'osrf.apps.example') # XXX example only for now osrf.app.Application.register_sysmethods() -- 2.11.0