You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UIModell.py 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from subprocess import *
  2. from threading import Thread
  3. import time
  4. class Modell(Thread):
  5. def __init__(self,c):
  6. Thread.__init__(self)
  7. self.controller = c
  8. def setFunktion(self, func, args=None, kwargs=None):
  9. pass
  10. def startCopySpelling(self):
  11. pass
  12. def trainXDawn(self):
  13. pass
  14. def trainClassifier(self):
  15. pass
  16. def freeSpelling(self):
  17. pass
  18. def killProzessParent(self):
  19. print('Parent start killing')
  20. pidOV = 0
  21. items = []
  22. prozesse = Popen(["ps", "-e"], stdout=PIPE).communicate()[0].strip()
  23. zeilen = prozesse.split('\n')
  24. for z in zeilen:
  25. if(z.find("openvibe-design") != -1):
  26. z = z.strip()
  27. items = z.split(' ')
  28. pidOV = items[0]
  29. #kill -TERM veranlasst dem Prozess sich selbst zu beenden (nicht erzwungen)
  30. Popen(["kill", "-TERM", str(pidOV)], stdout=PIPE).communicate()
  31. print("killed openvibe-designer")