# Path: openformats/utils/newlines.py
# def find_newline_type(content):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN = "\r"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN = b"\r"
# 
#     try:
#         first_newline_pos = content.index(NEWLINE)
#     except ValueError:
#         return 'UNIX'
#     else:
#         if (first_newline_pos > 0 and
#                 content[first_newline_pos - 1] == CARRIAGE_RETURN):
#             return 'DOS'
#         else:
#             return 'UNIX'
# 
# def force_newline_type(content, newline_type):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN_NEWLINE = "\r\n"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN_NEWLINE = b"\r\n"
# 
#     new_content = content.replace(CARRIAGE_RETURN_NEWLINE, NEWLINE)
#     if newline_type == 'DOS':
#         new_content = new_content.replace(NEWLINE, CARRIAGE_RETURN_NEWLINE)
#     return new_content


import six
from .utils.newlines import find_newline_type, force_newline_type
            ptr:                                       ^
            destination: ['<string name="foo">', 'ee8cc2abd5abd5a87cd784be_tr']

            >>> transcriber.copy_until(source.index("</string>") +
            ...                        len("</string>"))

            source:      <string name="foo">hello world</string>
            ptr:                                                ^
            destination: ['<string name="foo">', 'ee8cc2abd5abd5a87cd784be_tr',
                          '</string>']

            >>> print transcriber.get_destination()

            <string name="foo">aee8cc2abd5abd5a87cd784be_tr</string>
    """

    class SectionStart:
        pass

    class SectionEnd:
        pass

    def __init__(self, source):
        self.source = source
        self.destination = []
        self.ptr = 0

        self.newline_count = 0

        # Handle newlines

# Path: openformats/utils/newlines.py
# def find_newline_type(content):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN = "\r"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN = b"\r"
# 
#     try:
#         first_newline_pos = content.index(NEWLINE)
#     except ValueError:
#         return 'UNIX'
#     else:
#         if (first_newline_pos > 0 and
#                 content[first_newline_pos - 1] == CARRIAGE_RETURN):
#             return 'DOS'
#         else:
#             return 'UNIX'
# 
# def force_newline_type(content, newline_type):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN_NEWLINE = "\r\n"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN_NEWLINE = b"\r\n"
# 
#     new_content = content.replace(CARRIAGE_RETURN_NEWLINE, NEWLINE)
#     if newline_type == 'DOS':
#         new_content = new_content.replace(NEWLINE, CARRIAGE_RETURN_NEWLINE)
#     return new_content


# Path: openformats/transcribers.py
import six
from .utils.newlines import find_newline_type, force_newline_type

            ptr:                                       ^
            destination: ['<string name="foo">', 'ee8cc2abd5abd5a87cd784be_tr']

            >>> transcriber.copy_until(source.index("</string>") +
            ...                        len("</string>"))

            source:      <string name="foo">hello world</string>
            ptr:                                                ^
            destination: ['<string name="foo">', 'ee8cc2abd5abd5a87cd784be_tr',
                          '</string>']

            >>> print transcriber.get_destination()

            <string name="foo">aee8cc2abd5abd5a87cd784be_tr</string>
    """

    class SectionStart:
        pass

    class SectionEnd:
        pass

    def __init__(self, source):
        self.source = source
        self.destination = []
        self.ptr = 0

        self.newline_count = 0

        # Handle newlines

        self.newline_type = find_newline_type(self.source)