~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-04 18:51:39 UTC
  • mfrom: (2961.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20071104185139-kaio3sneodg2kp71
Authentication ring implementation (read-only)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
 
 
18
 
17
19
"""UI abstraction.
18
20
 
19
21
This tells the library how to display things to the user.  Through this
33
35
import getpass
34
36
 
35
37
from bzrlib import (
36
 
    errors,
37
38
    osutils,
38
39
    progress,
39
40
    trace,
124
125
                return False
125
126
 
126
127
    def get_non_echoed_password(self, prompt):
127
 
        if not sys.stdin.isatty():
128
 
            raise errors.NotATerminal()
129
128
        encoding = osutils.get_terminal_encoding()
130
129
        return getpass.getpass(prompt.encode(encoding, 'replace'))
131
130