>
def is_Ack(self,recursive = 0):
print “dependencies 1 – “,datetime.datetime.min.now()
dependencies = self.get_pending_dependencies()
print “dependencies 2 – “,datetime.datetime.min.now()
testresult = self.testresult_set.all()
if not dependencies :
if testresult.count() == 0:
if recursive == 0:
print “dependencies 3 – “,datetime.datetime.min.now()
return True
else:
print “dependencies 3 – “,datetime.datetime.min.now()
return None
else:
for state in testresult :
if state.result == “no”:
print “dependencies 3 – “,datetime.datetime.min.now()
return False
print “dependencies 3 – “,datetime.datetime.min.now()
return True
for state in testresult:
if state.result == “no”:
print “dependencies 3 – “,datetime.datetime.min.now()
return False
result = None
for bin in dependencies:
if (bin.is_Ack(1) == False ):
result = False
print “dependencies 3 – “,datetime.datetime.min.now()
return result
print “dependencies 1 – “,datetime.datetime.min.now()
dependencies = self.get_pending_dependencies()
print “dependencies 2 – “,datetime.datetime.min.now()
testresult = self.testresult_set.all()
if not dependencies :
if testresult.count() == 0:
if recursive == 0:
print “dependencies 3 – “,datetime.datetime.min.now()
return True
else:
print “dependencies 3 – “,datetime.datetime.min.now()
return None
else:
for state in testresult :
if state.result == “no”:
print “dependencies 3 – “,datetime.datetime.min.now()
return False
print “dependencies 3 – “,datetime.datetime.min.now()
return True
for state in testresult:
if state.result == “no”:
print “dependencies 3 – “,datetime.datetime.min.now()
return False
result = None
for bin in dependencies:
if (bin.is_Ack(1) == False ):
result = False
print “dependencies 3 – “,datetime.datetime.min.now()
return result
Bu kodu optimize etmeye çalışıyorum kendisi uzun bir sürede sonuç üretmekte 🙁
0 Comments.