Ejemplo n.º 1
0
def parse(ps):
    header = read_header_items(ps)
    units = []
    try:
        while True:
            eat_whitespace(ps)
            skip_no_translate(ps)
            match = string_entry_re.match(ps.current_line)
            if match is not None:
                units.append((match.groupdict()['id'], extractpoline(match.groupdict()['str'])))
            ps.read_line()
    except StopIteration:
        pass
    return header, units
Ejemplo n.º 2
0
def parse(ps):
    header = read_header_items(ps)
    units = []
    try:
        while True:
            eat_whitespace(ps)
            skip_no_translate(ps)
            match = string_entry_re.match(ps.current_line)
            if match is not None:
                units.append((match.groupdict()['id'],
                              extractpoline(match.groupdict()['str'])))
            ps.read_line()
    except StopIteration:
        pass
    return header, units
Ejemplo n.º 3
0
def _prepare_db_string(string):
    """Helper method needed by the Berkeley DB TM converters."""
    string = '"%s"' % string
    string = unicode(extractpoline(string), 'utf-8')
    return string
Ejemplo n.º 4
0
def _prepare_db_string(string):
    """Helper method needed by the Berkeley DB TM converters."""
    string = '"%s"' % string
    string = unicode(extractpoline(string), 'utf-8')
    return string