~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export_pot.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-27 11:31:35 UTC
  • mto: This revision was merged to the branch mainline in revision 6174.
  • Revision ID: jriddell@canonical.com-20110927113135-4evq3zsaika1iw92
change export-pot --plugins option to --plugin which takes a plugin name rather than command name

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
    _command_options(outf, path, cmd)
170
170
 
171
171
 
172
 
def _command_helps(outf, plugins=None):
 
172
def _command_helps(outf, plugin_name=None):
173
173
    """Extract docstrings from path.
174
174
 
175
175
    This respects the Bazaar cmdtable/table convention and will
182
182
        command = _mod_commands.get_cmd_object(cmd_name, False)
183
183
        if command.hidden:
184
184
            continue
185
 
        if plugins is not None:
 
185
        if plugin_name is not None:
186
186
            # only export builtins if we are not exporting plugin commands
187
187
            continue
188
188
        note(gettext("Exporting messages from builtin command: %s"), cmd_name)
197
197
        command = _mod_commands.get_cmd_object(cmd_name, False)
198
198
        if command.hidden:
199
199
            continue
200
 
        if plugins is not None and cmd_name not in plugins:
 
200
        if plugin_name is not None and command.plugin_name() != plugin_name:
201
201
            # if we are exporting plugin commands, skip plugins we have not specified.
202
202
            continue
203
 
        if plugins is None and command.plugin_name() not in core_plugins:
 
203
        if plugin_name is None and command.plugin_name() not in core_plugins:
204
204
            # skip non-core plugins
205
205
            # TODO: Support extracting from third party plugins.
206
206
            continue
252
252
            _poentry(outf, 'dummy/help_topics/'+key+'/summary.txt',
253
253
                     1, summary)
254
254
 
255
 
def export_pot(outf, plugins=None):
 
255
def export_pot(outf, plugin=None):
256
256
    global _FOUND_MSGID
257
257
    _FOUND_MSGID = set()
258
 
    if plugins is None:
 
258
    if plugin is None:
259
259
        _standard_options(outf)
260
260
        _command_helps(outf)
261
261
        _error_messages(outf)
262
262
        _help_topics(outf)
263
263
    else:
264
 
        plugin_commands = plugins.split(',')
265
 
        _command_helps(outf, plugins)
 
264
        _command_helps(outf, plugin)