From a8b34916611a83f70cc6315e9370ff4219daa58a Mon Sep 17 00:00:00 2001 From: Michael Pivato Date: Thu, 17 Jan 2019 14:46:11 +1030 Subject: [PATCH] Remove obsolete, unimplemented classes --- DecisionSystem/centralisedvoter.py | 5 ---- DecisionSystem/decentralisedvoter.py | 7 ----- DecisionSystem/executor.py | 2 -- DecisionSystem/mqttvoter.py | 32 --------------------- DecisionSystem/timeoutexecutor.py | 5 ---- DecisionSystem/vote.py | 43 ---------------------------- DecisionSystem/voter.py | 9 ------ 7 files changed, 103 deletions(-) delete mode 100644 DecisionSystem/centralisedvoter.py delete mode 100644 DecisionSystem/decentralisedvoter.py delete mode 100644 DecisionSystem/executor.py delete mode 100644 DecisionSystem/mqttvoter.py delete mode 100644 DecisionSystem/timeoutexecutor.py delete mode 100644 DecisionSystem/vote.py delete mode 100644 DecisionSystem/voter.py diff --git a/DecisionSystem/centralisedvoter.py b/DecisionSystem/centralisedvoter.py deleted file mode 100644 index e577d05..0000000 --- a/DecisionSystem/centralisedvoter.py +++ /dev/null @@ -1,5 +0,0 @@ -import voter - -class BallotVoter(Voter): - def submit_vote(self): - pass \ No newline at end of file diff --git a/DecisionSystem/decentralisedvoter.py b/DecisionSystem/decentralisedvoter.py deleted file mode 100644 index ecf9ad0..0000000 --- a/DecisionSystem/decentralisedvoter.py +++ /dev/null @@ -1,7 +0,0 @@ -import voter - -class VoteReplicator(Voter): - def __init__(self): - pass - - \ No newline at end of file diff --git a/DecisionSystem/executor.py b/DecisionSystem/executor.py deleted file mode 100644 index 607ae6c..0000000 --- a/DecisionSystem/executor.py +++ /dev/null @@ -1,2 +0,0 @@ -class Executor: - pass \ No newline at end of file diff --git a/DecisionSystem/mqttvoter.py b/DecisionSystem/mqttvoter.py deleted file mode 100644 index c6e8dd3..0000000 --- a/DecisionSystem/mqttvoter.py +++ /dev/null @@ -1,32 +0,0 @@ -from DecisionSystem.voter import Voter -import Messaging.mqttsession as ms -from Messaging.packmessage import PackMessage -from DecisionSystem.vote import Vote - -class MqttVoter(Voter): - def __init__(self, host = "10.0.123.11"): - # Should use a factory here to always get the same session. - # Just going to use a singleton for now, as there should only be - # one session in the program. - ms.client = ms.Client() - ms.connect() - - def submit_vote(self): - - - pass - - def set_vote(self, vote): - if isinstance(vote, Vote): - self._vote = vote - return True - else: - return False - - def get_vote(self): - return self._vote - - # This is meant to be the mqtt callback... Should've documented this earlier. - def request_vote(self, client, userdata, message): - # Perhaps do some checking to see what is being voted on... - self.submit_vote() \ No newline at end of file diff --git a/DecisionSystem/timeoutexecutor.py b/DecisionSystem/timeoutexecutor.py deleted file mode 100644 index 39f56b6..0000000 --- a/DecisionSystem/timeoutexecutor.py +++ /dev/null @@ -1,5 +0,0 @@ -import executor - -class TimeoutExecutor(Executor): - pass - \ No newline at end of file diff --git a/DecisionSystem/vote.py b/DecisionSystem/vote.py deleted file mode 100644 index 28c34cf..0000000 --- a/DecisionSystem/vote.py +++ /dev/null @@ -1,43 +0,0 @@ -from Messaging.packmessage import PackMessage - -class Vote(PackMessage): - def __init__(self, client, vote = None): - self._vote = vote - self._client = client - - - @property - def vote(self): - return self._vote - - @vote.setter - def vote(self, value): - self._vote = value - - def __eq__(self, other): - if not isinstance(other, Vote): - return False - - if other.vote == self.vote: - return True - - def serialise(self): - - # Still need associated device as well? to know who went the message, - # to check that we don't add too many messages in case of multiple - # sends. - self.message = {"vote": self.vote} - - # Call super method equivalent. - super(Vote, self).serialise() - - def deserialise(self): - super(Vote, self).deserialise() - - if "vote" in self.message: - self.vote = self.message["vote"] - else: - # Do something. - pass - - \ No newline at end of file diff --git a/DecisionSystem/voter.py b/DecisionSystem/voter.py deleted file mode 100644 index 4c0fcbf..0000000 --- a/DecisionSystem/voter.py +++ /dev/null @@ -1,9 +0,0 @@ -from Messaging.packmessage import PackMessage -import umsgpack - -class Voter: - def submit_vote(self): - raise NotImplementedError() - - def send_connected(self): - raise NotImplementedError() \ No newline at end of file