# Path: aerofiles/errors.py
# class ParserError(RuntimeError):
#     pass


import re
from aerofiles.errors import ParserError
}


class Reader:
    """
    A reader for the WELT2000 waypoint file format.

    see http://www.segelflug.de/vereine/welt2000/download/WELT2000-SPEC.TXT
    """

    def __init__(self, fp=None):
        self.fp = fp

    def __iter__(self):
        return self.next()

    def next(self):
        for line in self.fp:
            wp = self.decode_waypoint(line)
            if wp:
                yield wp

    def decode_waypoint(self, line):
        line = line.strip()

        if not line or line.startswith('$'):
            return

        # Check valid line length
        if len(line) != 64:

# Path: aerofiles/errors.py
# class ParserError(RuntimeError):
#     pass


# Path: aerofiles/welt2000/reader.py
import re
from aerofiles.errors import ParserError

}


class Reader:
    """
    A reader for the WELT2000 waypoint file format.

    see http://www.segelflug.de/vereine/welt2000/download/WELT2000-SPEC.TXT
    """

    def __init__(self, fp=None):
        self.fp = fp

    def __iter__(self):
        return self.next()

    def next(self):
        for line in self.fp:
            wp = self.decode_waypoint(line)
            if wp:
                yield wp

    def decode_waypoint(self, line):
        line = line.strip()

        if not line or line.startswith('$'):
            return

        # Check valid line length
        if len(line) != 64:

            raise ParserError('Line length does not match 64')