Permalink
Browse files

Merge branch 'master' of github.com:djs55/dbus-test

  • Loading branch information...
2 parents a6b5494 + 3b9cb0b commit 4ea6c5524a5d551463b216312f8ed038c924ab10 David Scott committed Feb 11, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −6 dbus/vm/python/dbus-resource-script.py
View
12 dbus/vm/python/dbus-resource-script.py
@@ -72,13 +72,13 @@ def error(message):
class Canceller(threading.Thread):
"""A thread which attempts to cleanly shutdown a process, resorting
to SIGKILL if it fails to respond after a timeout"""
- def __init__(self, process, dbus_object):
+ def __init__(self, process, task):
threading.Thread.__init__(self)
self.process = process
- self.dbus_object = dbus_object
+ self.task = task
self.start()
def run(self):
- info("%s: cancelling: sending SIGTERM to %d" % (self.dbus_object.path, self.process.pid))
+ info("%s: cancelling: sending SIGTERM to %d" % (self.task.path, self.process.pid))
try:
self.process.terminate()
except:
@@ -89,7 +89,7 @@ def run(self):
sys.stdout.flush()
time.sleep(1)
if self.process.poll() <> None:
- info("%s: cancelling: sending SIGKILL to %d" % (self.dbus_object.path, self.process.pid))
+ info("%s: cancelling: sending SIGKILL to %d" % (self.task.path, self.process.pid))
try:
self.process.kill()
except:
@@ -98,8 +98,8 @@ def run(self):
self.process.wait()
except:
pass
- info("%s: cancelling: deleting object" % self.dbus_object.path)
- self.dbus_object.remove_from_connection()
+ info("%s: cancelling: deleting object" % self.task.path)
+ self.task.remove_from_connection()
class Task(dbus.service.Object, threading.Thread):

0 comments on commit 4ea6c55

Please sign in to comment.