-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDependencyGraphEntity.py
More file actions
executable file
·43 lines (32 loc) · 1.01 KB
/
DependencyGraphEntity.py
File metadata and controls
executable file
·43 lines (32 loc) · 1.01 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from Action import Action
from datetime import datetime
class DependencyGraphEntity:
def __init__(self, name):
self.m_name = name
self.prerequisiteList = []
self.actions = []
def addPrerequisite(self, p):
self.prerequisiteList.append(p)
return self
def name(self):
return self.m_name
def show(self, level=0, indent=" "):
print level*indent, self.name()
for p in self.prerequisiteList:
p.show(level+1)
# self.action.show()
def timestamp(self):
pass
def addAction(self, a):
self.actions.append(a)
def executeActions(self, target, allPre, changedPre):
for a in self.actions:
a.execute(target, allPre, changedPre)
def updatePrerequisites(self, changed):
for p in self.prerequisiteList:
oldStamp = p.timestamp()
p.update()
if p.timestamp() > oldStamp:
changed.append(p)
def update(self):
pass