less underscore

This commit is contained in:
2020-04-21 17:24:12 +00:00
parent b0fcc221e9
commit 471a4b0281
+9 -9
View File
@@ -4,27 +4,27 @@ from threading import Thread
class Acquisition:
def __init__(self, acquire, stopper=None, hold=True):
self._stopper = stopper
self._thread = Thread(target=acquire)
self.stopper = stopper
self.thread = Thread(target=acquire)
if not hold:
self.start()
def start(self):
self._thread.start()
self.thread.start()
def stop(self):
if self._stopper is not None:
self._stopper()
if self.stopper is not None:
self.stopper()
def wait(self):
self._thread.join()
self.thread.join()
@property
def status(self):
if self._thread.ident is None:
return "waiting"
if self.thread.ident is None:
return "ready"
else:
if self._thread.isAlive():
if self.thread.isAlive():
return "acquiring"
else:
return "done"