/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 bzrlib/export_pot.py

  • Committer: INADA Naoki
  • Date: 2011-05-12 12:06:00 UTC
  • mto: (5830.3.4 i18n-msgfmt)
  • mto: This revision was merged to the branch mainline in revision 5873.
  • Revision ID: songofacandy@gmail.com-20110512120600-v9jt33nb9otrm1mf
Fix lineno of command help in pot

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
    for node in ast.walk(root):
97
97
        if not isinstance(node, ast.Str):
98
98
            continue
99
 
        offsets[node.s] = node.lineno
 
99
        offsets[node.s] = node.lineno - node.s.count('\n')
100
100
 
101
101
    _LAST_CACHED_SRC = src
102
102
    _LAST_CACHE = offsets.copy()
150
150
    if path.endswith('.pyc'):
151
151
        path = path[:-1]
152
152
    path = os.path.relpath(path)
153
 
    lineno = inspect.findsource(cmd.__class__)[1]
 
153
    src, lineno = inspect.findsource(cmd.__class__)
 
154
    offsets = _offsets_of_literal(''.join(src))
 
155
    lineno = offsets[cmd.__doc__]
154
156
    doc = inspect.getdoc(cmd)
155
157
 
156
158
    _poentry_per_paragraph(outf, path, lineno, doc)