~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export_pot.py

  • Committer: INADA Naoki
  • Date: 2011-05-12 12:19:35 UTC
  • mto: (5830.3.4 i18n-msgfmt)
  • mto: This revision was merged to the branch mainline in revision 5873.
  • Revision ID: songofacandy@gmail.com-20110512121935-5repm70fnk5lf3rh
Fix line no of error formats in bzr.pot

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
 
195
195
def _error_messages(outf):
196
196
    """Extract fmt string from bzrlib.errors."""
 
197
    path = errors.__file__
 
198
    if path.endswith('.pyc'):
 
199
        path = path[:-1]
 
200
    offsets = _offsets_of_literal(open(path).read())
 
201
 
197
202
    base_klass = errors.BzrError
198
203
    for name in dir(errors):
199
204
        klass = getattr(errors, name)
209
214
        if fmt:
210
215
            note("Exporting message from error: %s", name)
211
216
            _poentry(outf, 'bzrlib/errors.py',
212
 
                     inspect.findsource(klass)[1], fmt)
 
217
                     offsets.get(fmt, 9999), fmt)
213
218
 
214
219
def _help_topics(outf):
215
220
    topic_registry = help_topics.topic_registry