def canAcceptAndIsRequested(self, callerObject=None): station=self from Queue import Queue from Exit import Exit # loop to next stations until a Queue or Exit is reached while 1: next=station.next[0] # if a Queue or Exit is reached break if issubclass(next.__class__, Queue) or issubclass(next.__class__, Exit): break # if the object is not free return False if len(next.getActiveObjectQueue()): return False station=next # return according to parent return BatchDecomposition.canAcceptAndIsRequested(self, callerObject)