~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export_pot.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-28 15:18:59 UTC
  • mto: This revision was merged to the branch mainline in revision 6317.
  • Revision ID: jelmer@samba.org-20111128151859-dw4nua1xiobilw4r
Fix tests.

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
 
 
31
29
import inspect
32
30
import os
33
31
 
132
130
class _PotExporter(object):
133
131
    """Write message details to output stream in .pot file format"""
134
132
 
135
 
    def __init__(self, outf, include_duplicates=False):
 
133
    def __init__(self, outf):
136
134
        self.outf = outf
137
 
        if include_duplicates:
138
 
            self._msgids = None
139
 
        else:
140
 
            self._msgids = set()
 
135
        self._msgids = set()
141
136
        self._module_contexts = {}
142
137
 
143
138
    def poentry(self, path, lineno, s, comment=None):
144
 
        if self._msgids is not None:
145
 
            if s in self._msgids:
146
 
                return
147
 
            self._msgids.add(s)
 
139
        if s in self._msgids:
 
140
            return
 
141
        self._msgids.add(s)
148
142
        if comment is None:
149
143
            comment = ''
150
144
        else:
311
305
                     1, summary)
312
306
 
313
307
 
314
 
def export_pot(outf, plugin=None, include_duplicates=False):
315
 
    exporter = _PotExporter(outf, include_duplicates)
 
308
def export_pot(outf, plugin=None):
 
309
    exporter = _PotExporter(outf)
316
310
    if plugin is None:
317
311
        _standard_options(exporter)
318
312
        _command_helps(exporter)