/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/export_pot.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-05 07:32:38 UTC
  • mto: (7290.1.21 work)
  • mto: This revision was merged to the branch mainline in revision 7311.
  • Revision ID: jelmer@jelmer.uk-20190305073238-zlqn981opwnqsmzi
Add appveyor configuration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
is also left to that stage of the process.
27
27
"""
28
28
 
 
29
from __future__ import absolute_import
 
30
 
29
31
import inspect
30
32
import os
31
 
import sys
32
33
 
33
34
import breezy
34
35
from . import (
38
39
    option,
39
40
    plugin as _mod_plugin,
40
41
    )
 
42
from .sixish import PY3
41
43
from .trace import (
42
44
    mutter,
43
45
    note,
85
87
            # string terminates on. It's more useful to have the line the
86
88
            # string begins on. Unfortunately, counting back newlines is
87
89
            # only an approximation as the AST is ignorant of escaping.
88
 
            str_to_lineno[node.s] = node.lineno - (0 if sys.version_info >= (3, 8) else node.s.count('\n'))
 
90
            str_to_lineno[node.s] = node.lineno - node.s.count('\n')
89
91
    return cls_to_lineno, str_to_lineno
90
92
 
91
93
 
156
158
            "msgstr \"\"\n"
157
159
            "\n".format(
158
160
                path=path, lineno=lineno, comment=comment, msg=_normalize(s)))
 
161
        if not PY3:
 
162
            line = line.decode('utf-8')
159
163
        self.outf.write(line)
160
164
 
161
165
    def poentry_in_context(self, context, string, comment=None):