~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2005-11-30 16:41:08 UTC
  • mto: (1185.50.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1518.
  • Revision ID: john@arbash-meinel.com-20051130164108-f5d8517a01eee379
Added get_password to the UIFactory, using it inside of sftp.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    layer different applications can choose the style of UI.
39
39
    """
40
40
    def progress_bar(self):
41
 
        raise NotImplementedError
42
 
 
 
41
        """Return a progress bar object"""
 
42
        raise NotImplementedError
 
43
 
 
44
    def get_password(self, prompt='', **kwargs):
 
45
        """Prompt the user for a password.
 
46
 
 
47
        :param prompt: The prompt to present the user
 
48
        :param kwargs: Arguments which will be expanded into the prompt.
 
49
                       This lets front ends display different things if
 
50
                       they so choose.
 
51
        :return: The password string, return None if the user 
 
52
                 canceled the request.
 
53
        """
 
54
        raise NotImplementedError
 
55
        
43
56
 
44
57
class SilentUIFactory(UIFactory):
45
58
    """A UI Factory which never prints anything.
49
62
    def progress_bar(self):
50
63
        return bzrlib.progress.DummyProgress()
51
64
 
 
65
    def get_password(self, prompt='', **kwargs):
 
66
        return None
 
67
 
 
68
 
52
69
ui_factory = SilentUIFactory()