28
28
displays no output.
35
31
import bzrlib.progress
38
class TextUIFactory(object):
34
class UIFactory(object):
37
This tells the library how to display things to the user. Through this
38
layer different applications can choose the style of UI.
39
40
def progress_bar(self):
41
# this in turn is abstract, and creates either a tty or dots
42
# bar depending on what we think of the terminal
43
return bzrlib.progress.ProgressBar()
46
class SilentUIFactory(object):
41
"""Return a progress bar object"""
42
raise NotImplementedError
44
def get_password(self, prompt='', **kwargs):
45
"""Prompt the user for a password.
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
51
:return: The password string, return None if the user
54
raise NotImplementedError
57
class SilentUIFactory(UIFactory):
58
"""A UI Factory which never prints anything.
60
This is the default UI, if another one is never registered.
47
62
def progress_bar(self):
48
63
return bzrlib.progress.DummyProgress()
65
def get_password(self, prompt='', **kwargs):
51
69
ui_factory = SilentUIFactory()