Commit 769106f1 authored by Nicolas Dumazet's avatar Nicolas Dumazet

continue_recursivity variable was just unneeded, difficult to read trickery


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35972 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2d335c7d
...@@ -188,9 +188,12 @@ class SupplyChain(Path, XMLObject): ...@@ -188,9 +188,12 @@ class SupplyChain(Path, XMLObject):
previous_link_list = self.getPreviousSupplyLinkList(current_supply_link) previous_link_list = self.getPreviousSupplyLinkList(current_supply_link)
# Test each link # Test each link
for previous_link in previous_link_list: for previous_link in previous_link_list:
continue_recursivity = False if not previous_link.isProductionSupplyLink():
# Great, we find a valid one # current is invalid
if previous_link.isProductionSupplyLink(): if not recursive:
continue
else:
# Great, we found a valid one
transformation_link_list.append(previous_link) transformation_link_list.append(previous_link)
# Prevent infinite loop when 2 production_link have the same # Prevent infinite loop when 2 production_link have the same
# destination # destination
...@@ -200,19 +203,15 @@ class SupplyChain(Path, XMLObject): ...@@ -200,19 +203,15 @@ class SupplyChain(Path, XMLObject):
"Those SupplyLinks are in conflict: %r and %r" %\ "Those SupplyLinks are in conflict: %r and %r" %\
(current_supply_link.getRelativeUrl(),\ (current_supply_link.getRelativeUrl(),\
previous_link.getRelativeUrl()) previous_link.getRelativeUrl())
if all: if not recursive and not all:
continue_recursivity = True continue
# Reject the current
elif recursive: # Browse the previous link
continue_recursivity = True transformation_link_list.extend(
# Continue to browse the chain ? self.getPreviousProductionSupplyLinkList(
if continue_recursivity: previous_link,
# Browse the previous link recursive=recursive, all=all,
transformation_link_list.extend( checked_link_list=checked_link_list))
self.getPreviousProductionSupplyLinkList(
previous_link,
recursive=recursive, all=all,
checked_link_list=checked_link_list))
# Return result # Return result
return transformation_link_list return transformation_link_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment