[Opensrf-commits] r1342 - trunk/src/python

svn at svn.open-ils.org svn at svn.open-ils.org
Fri May 23 11:43:50 EDT 2008


Author: erickson
Date: 2008-05-23 11:43:48 -0400 (Fri, 23 May 2008)
New Revision: 1342

Modified:
   trunk/src/python/opensrf.py
Log:
defaulting to config.opensrf for config context.  added some initial settings server loading

Modified: trunk/src/python/opensrf.py
===================================================================
--- trunk/src/python/opensrf.py	2008-05-23 15:18:05 UTC (rev 1341)
+++ trunk/src/python/opensrf.py	2008-05-23 15:43:48 UTC (rev 1342)
@@ -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 @@
 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 @@
     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()



More information about the opensrf-commits mailing list