(text, mutaData=None)
| 973 | |
| 974 | |
| 975 | def parseAdditions(text, mutaData=None): |
| 976 | items = [] |
| 977 | sMkt = Market.getInstance() |
| 978 | pattern = r'^(?P<typeName>{}+?)( x(?P<amount>\d+?))?(\s*\[(?P<mutaref>\d+?)\])?$'.format(NAME_CHARS) |
| 979 | for line in lineIter(text): |
| 980 | m = re.match(pattern, line) |
| 981 | if not m: |
| 982 | continue |
| 983 | item = sMkt.getItem(m.group('typeName')) |
| 984 | if item is None: |
| 985 | continue |
| 986 | amount = m.group('amount') |
| 987 | amount = 1 if amount is None else int(amount) |
| 988 | mutaRef = int(m.group('mutaref')) if m.group('mutaref') else None |
| 989 | if mutaRef and mutaData and mutaRef in mutaData: |
| 990 | mutation = mutaData[mutaRef] |
| 991 | else: |
| 992 | mutation = None |
| 993 | items.append((item, amount, mutation)) |
| 994 | return items |
| 995 | |
| 996 | |
| 997 | def isValidDroneImport(text): |
no test coverage detected