~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-09 10:21:57 UTC
  • mto: (5830.3.4 i18n-msgfmt)
  • mto: This revision was merged to the branch mainline in revision 5873.
  • Revision ID: songofacandy@gmail.com-20110509102157-wz9vb8jct2yr0sbp
Add some tests for export_pot module.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
           'msgstr ""\n')
78
78
 
79
79
def _poentry_per_paragraph(outf, path, lineno, msgid):
 
80
    # TODO: How to split long help?
80
81
    paragraphs = msgid.split('\n\n')
81
82
    for p in paragraphs:
82
83
        _poentry(outf, path, lineno, p)
85
86
def _offset(src, doc, default):
86
87
    """Compute offset or issue a warning on stdout."""
87
88
    # Backslashes in doc appear doubled in src.
 
89
    # TODO: Use ast to more 
88
90
    end = src.find(doc.replace('\\', '\\\\'))
89
91
    if end == -1:
 
92
        mutter("Can't find where %r is.", doc[:20])
90
93
        return default
91
94
    else:
92
95
        return src.count('\n', 0, end)