4 while '@' in repr(seqList)
and level<maxLevel:
6 for specifiedCommand
in seqList:
7 if specifiedCommand.startswith(
'@'):
8 location=specifiedCommand[1:]
9 if not location
in mapping:
10 raise Exception(
"Impossible to map "+location+
" from "+repr(mapping))
11 mappedTo=mapping[location]
16 insertAt=seqList.index(specifiedCommand)
17 seqList.remove(specifiedCommand)
18 if key
in mappedTo
and mappedTo[key]
is not None:
19 allToInsert=mappedTo[key].
split(
'+')
20 for offset,toInsert
in enumerate(allToInsert):
21 seqList.insert(insertAt+offset,toInsert)
24 raise Exception(
"Could not fully expand "+repr(seqList)+
" from "+repr(mapping))
def expandNanoMapping(seqList, mapping, key)
def split(sequence, size)