diff --git a/script/local.py b/script/local.py index eb71050..451eaf7 100755 --- a/script/local.py +++ b/script/local.py @@ -311,10 +311,15 @@ def _get_camtool_port(): return camtool.url[camtool.url.rfind(":")+1:] def is_camtool_running(): + """ + """ return int(exec_cmd("pgrep " + CAMTOOL_SERVER_SCRIPT + " | wc -l")) > 0 #return int(exec_cmd('pgrep -f "' + CAMTOOL_SERVER_SCRIPT + ' -p ' + _get_camtool_port() + '" | wc -l')) > 0 def kill_camtool(): + """ + Kill the private camtool instance and child pocesses + """ #return exec_cmd("killall -9 " + CAMTOOL_SERVER_SCRIPT) return exec_cmd('pkill -f " \-p ' + _get_camtool_port() + '"') @@ -328,6 +333,9 @@ def _run_camtool(): print >> sys.stderr, traceback.format_exc() def check_camtool(): + """ + Checks if private camtool server is running, otherwise starts it. + """ if is_camtool_running(): return False fork(_run_camtool)