# Path: evepaste/exceptions.py
# class Unparsable(Exception):
#     """
#     This exception is raised whenever the given text is not parsable.
#     """
#     pass
# 
# Path: evepaste/utils.py
# def f_int(num):
#     """ Converts a given numeric string into an integer
# 
#     :param string num: A string of the format "123,456", "123'456", "123 456"
#                     or "123456"
#     """
#     if num is None:
#         return
#     try:
#         return int(sub(r"[,'\. ']", '', num))
# 
#     except ValueError:
#         return 0


import re
from evepaste.exceptions import Unparsable
from evepaste.utils import f_int
        if match:
            key, val, killing_blow = match.groups()
            player[format_key(key)] = val
            if killing_blow:
                player['killing_blow'] = True
        else:
            raise Unparsable('Failed parsing at line %s: %s' % (offset, line))

    if player:
        player['killing_blow'] = player.get('killing_blow', False)
        player['damage_done'] = int(player.get('damage_done', 0))
        yield 'involved', player
    yield 'state_change', (transition, offset)


def parse_destroyed_items(lines, offset):
    transition = None
    for line in lines[offset:]:
        offset += 1
        transition = common_transitions(line)
        if transition:
            break

        match = ITEM_RE.search(line)
        if match:
            name, _, quantity, _, location = match.groups()
            yield 'destroyed', {'name': name,
                                'quantity': f_int(quantity) or 1,
                                'location': location}
        else:

# Path: evepaste/exceptions.py
# class Unparsable(Exception):
#     """
#     This exception is raised whenever the given text is not parsable.
#     """
#     pass
# 
# Path: evepaste/utils.py
# def f_int(num):
#     """ Converts a given numeric string into an integer
# 
#     :param string num: A string of the format "123,456", "123'456", "123 456"
#                     or "123456"
#     """
#     if num is None:
#         return
#     try:
#         return int(sub(r"[,'\. ']", '', num))
# 
#     except ValueError:
#         return 0


# Path: evepaste/parsers/killmail.py
import re
from evepaste.exceptions import Unparsable
from evepaste.utils import f_int

        if match:
            key, val, killing_blow = match.groups()
            player[format_key(key)] = val
            if killing_blow:
                player['killing_blow'] = True
        else:
            raise Unparsable('Failed parsing at line %s: %s' % (offset, line))

    if player:
        player['killing_blow'] = player.get('killing_blow', False)
        player['damage_done'] = int(player.get('damage_done', 0))
        yield 'involved', player
    yield 'state_change', (transition, offset)


def parse_destroyed_items(lines, offset):
    transition = None
    for line in lines[offset:]:
        offset += 1
        transition = common_transitions(line)
        if transition:
            break

        match = ITEM_RE.search(line)
        if match:
            name, _, quantity, _, location = match.groups()
            yield 'destroyed', {'name': name,
                                'quantity': f_int(quantity) or 1,
                                'location': location}
        else:

            raise Unparsable('Failed parsing at line %s: %s' % (offset, line))