-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.py
More file actions
29 lines (22 loc) · 708 Bytes
/
command.py
File metadata and controls
29 lines (22 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from datetime import datetime
class Command():
"""
Command class that contains the command to be
executed and its priority and timestamp
"""
def __init__(self, command, priority):
self.__command = command
self.__priority = priority
self.__timestamp = datetime.now()
def command(self):
return self.__command
def priority(self):
return self.__priority
def timestamp(self):
return self.__timestamp
def isOlderThan(self, other):
return self.timestamp() < other.timestamp()
def setCommand(self, command):
self.__command = command
def setPriority(self, priority):
self.__priority = priority