From f066597dcbb2980d503725defe18e62770bfa9cb Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Tue, 24 May 2016 20:19:46 +0000
Subject: [PATCH] Moved stop(kill) command to runner

---
 python/trisurf/tsmgr.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/python/trisurf/tsmgr.py b/python/trisurf/tsmgr.py
index adef0b2..fa7d20f 100644
--- a/python/trisurf/tsmgr.py
+++ b/python/trisurf/tsmgr.py
@@ -1,6 +1,7 @@
 import sys, getopt
 import tabulate
 import subprocess,re
+import psutil
 
 def printHelp():
 	print('Python module tsmgr accept following switches:\n')
@@ -9,6 +10,7 @@
 	print('[-R]               : raw output for -s switch');
 	print('[-r]               : run process');
 	print('[-s]               : process status');
+	print('[-k]               : kill process');
 	print('[-c comment text]  : write new comment for process');
 	print('[-a comment text]  : append additional comment for process');
 	print('[-h]               : print help');
@@ -29,7 +31,7 @@
 	processno=0
 	raw=False
 	try:
-		opts, args = getopt.getopt(argv,"Ra:n:hrsc:")
+		opts, args = getopt.getopt(argv,"Ra:n:hrskc:")
 	except getopt.GetoptError:
 		printHelp()
 		sys.exit(2)
@@ -76,7 +78,9 @@
 			if processno:
 				Runs[processno-1].writeComment("\n"+arg, 'a')
 
-			
+		elif opt == '-k':
+			if processno:
+				Runs[processno-1].stop()
 		else:
 			printHelp()
 			sys.exit(2)

--
Gitblit v1.9.3