~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Robert J. Tanner
  • Date: 2009-04-29 05:53:21 UTC
  • mfrom: (4311 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4312.
  • Revision ID: tanner@real-time.com-20090429055321-v2s5l1mgki9f6cgn
[merge] 1.14 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
        return username
218
218
 
219
219
    def prompt(self, prompt, **kwargs):
220
 
        """Emit prompt on the CLI."""
221
 
        prompt = prompt % kwargs
 
220
        """Emit prompt on the CLI.
 
221
        
 
222
        :param kwargs: Dictionary of arguments to insert into the prompt,
 
223
            to allow UIs to reformat the prompt.
 
224
        """
 
225
        if kwargs:
 
226
            # See <https://launchpad.net/bugs/365891>
 
227
            prompt = prompt % kwargs
222
228
        prompt = prompt.encode(osutils.get_terminal_encoding(), 'replace')
223
229
        self.clear_term()
224
230
        self.stdout.write(prompt)