Skip to content

Commit

Permalink
fabric_generator:utilities: Make expandListPorts public
Browse files Browse the repository at this point in the history
Make the expandListPorts function public, since it coudl be useful in other parts of FABulous.

Remove useless return at the end of the expandListPorts function.

Signed-off-by: Jonas K. <[email protected]>
  • Loading branch information
EverythingElseWasAlreadyTaken committed May 13, 2024
1 parent e408d08 commit cd778a2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions FABulous/fabric_generator/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def parseList(

leftList = []
rightList = []
_expandListPorts(left, leftList)
_expandListPorts(right, rightList)
expandListPorts(left, leftList)
expandListPorts(right, rightList)
resultList += list(zip(leftList, rightList))

result = list(dict.fromkeys(resultList))
Expand All @@ -120,7 +120,7 @@ def parseList(
return result


def _expandListPorts(port, PortList):
def expandListPorts(port, PortList):
"""
expand the .list file entry into list of tuple.
"""
Expand All @@ -140,12 +140,11 @@ def _expandListPorts(port, PortList):
ExpandList = re.split(r"\|", port[left_index + 1 : right_index])
for entry in ExpandList:
ExpandListItem = before_left_index + entry + after_right_index
_expandListPorts(ExpandListItem, PortList)
expandListPorts(ExpandListItem, PortList)

else:
# print('DEBUG: else, just:',port)
PortList.append(port)
return


# Default parameters (will be overwritten if defined in fabric between 'ParametersBegin' and 'ParametersEnd'
Expand Down

0 comments on commit cd778a2

Please sign in to comment.