mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Prevent reuse of Taskd after being destroyed
This commit is contained in:
parent
e615d449ac
commit
c1dbe4fc3c
1 changed files with 11 additions and 1 deletions
|
@ -18,7 +18,7 @@ _curdir = os.path.dirname(os.path.abspath(__file__))
|
|||
DEFAULT_CERT_PATH = os.path.abspath(os.path.join(_curdir, "..", "test_certs"))
|
||||
|
||||
|
||||
class TaskdServer(object):
|
||||
class Taskd(object):
|
||||
"""Manage a taskd instance
|
||||
|
||||
A temporary folder is used as data store of taskd.
|
||||
|
@ -183,4 +183,14 @@ class TaskdServer(object):
|
|||
|
||||
release_port(self.port)
|
||||
|
||||
# Prevent future reuse of this instance
|
||||
self.start = self.__destroyed
|
||||
self.config = self.__destroyed
|
||||
self.stop = self.__destroyed
|
||||
self.destroy = self.__destroyed
|
||||
|
||||
def __destroyed(self, *args, **kwargs):
|
||||
raise AttributeError("Taskd instance has been destroyed. "
|
||||
"Create a new instance if you need a new server.")
|
||||
|
||||
# vim: ai sts=4 et sw=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue