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

svn at svn.open-ils.org svn at svn.open-ils.org
Fri May 23 10:49:27 EDT 2008


Author: erickson
Date: 2008-05-23 10:49:25 -0400 (Fri, 23 May 2008)
New Revision: 1339

Modified:
   trunk/src/python/opensrf.py
Log:
moved stop/start actions out to functions

Modified: trunk/src/python/opensrf.py
===================================================================
--- trunk/src/python/opensrf.py	2008-05-23 02:04:10 UTC (rev 1338)
+++ trunk/src/python/opensrf.py	2008-05-23 14:49:25 UTC (rev 1339)
@@ -66,8 +66,9 @@
 pidfile = "%s/osrf_py_%s.pid" % (pid_dir, service)
 
 
-if action == 'start':
+def do_start():
 
+
     # connect to the OpenSRF network
     osrf.system.System.net_connect(
         config_file = config_file, config_context = config_ctx)
@@ -90,7 +91,7 @@
 
     controller.run()
 
-elif action == 'stop':
+def do_stop():
     file = open(pidfile)
     pid = file.read()
     file.close()
@@ -98,3 +99,12 @@
     os.remove(pidfile)
 
 
+if action == 'start':
+    do_start()
+
+elif action == 'stop':
+    do_stop()
+
+elif action == 'restart':
+    do_stop()
+    do_start()



More information about the opensrf-commits mailing list