/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/ui/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
Several levels are supported, and you can also register new factories such as
23
23
for a GUI.
24
24
 
25
 
bzrlib.ui.UIFactory
 
25
breezy.ui.UIFactory
26
26
    Semi-abstract base class
27
27
 
28
 
bzrlib.ui.SilentUIFactory
 
28
breezy.ui.SilentUIFactory
29
29
    Produces no output and cannot take any input; useful for programs using
30
 
    bzrlib in batch mode or for programs such as loggerhead.
 
30
    breezy in batch mode or for programs such as loggerhead.
31
31
 
32
 
bzrlib.ui.CannedInputUIFactory
 
32
breezy.ui.CannedInputUIFactory
33
33
    For use in testing; the input values to be returned are provided 
34
34
    at construction.
35
35
 
36
 
bzrlib.ui.text.TextUIFactory
 
36
breezy.ui.text.TextUIFactory
37
37
    Standard text command-line interface, with stdin, stdout, stderr.
38
38
    May make more or less advanced use of them, eg in drawing progress bars,
39
39
    depending on the detected capabilities of the terminal.
45
45
 
46
46
import warnings
47
47
 
48
 
from bzrlib.lazy_import import lazy_import
 
48
from breezy.lazy_import import lazy_import
49
49
lazy_import(globals(), """
50
 
from bzrlib import (
 
50
from breezy import (
51
51
    config,
52
52
    osutils,
53
53
    progress,
152
152
            "This format may be unreliable or change in the future "
153
153
            "without an upgrade path.\n"),
154
154
        deprecated_command=(
155
 
            "The command 'bzr %(deprecated_name)s' "
156
 
            "has been deprecated in bzr %(deprecated_in_version)s. "
157
 
            "Please use 'bzr %(recommended_name)s' instead."),
 
155
            "The command 'brz %(deprecated_name)s' "
 
156
            "has been deprecated in brz %(deprecated_in_version)s. "
 
157
            "Please use 'brz %(recommended_name)s' instead."),
158
158
        deprecated_command_option=(
159
 
            "The option '%(deprecated_name)s' to 'bzr %(command)s' "
160
 
            "has been deprecated in bzr %(deprecated_in_version)s. "
 
159
            "The option '%(deprecated_name)s' to 'brz %(command)s' "
 
160
            "has been deprecated in brz %(deprecated_in_version)s. "
161
161
            "Please use '%(recommended_name)s' instead."),
162
162
        recommend_upgrade=("%(current_format_name)s is deprecated "
163
163
            "and a better format is available.\n"
164
164
            "It is recommended that you upgrade by "
165
165
            "running the command\n"
166
 
            "  bzr upgrade %(basedir)s"),
 
166
            "  brz upgrade %(basedir)s"),
167
167
        locks_steal_dead=(
168
168
            u"Stole dead lock %(lock_url)s %(other_holder_info)s."),
169
169
        not_checking_ssl_cert=(
204
204
        """Seek user confirmation for an action.
205
205
 
206
206
        If the UI is noninteractive, or the user does not want to be asked
207
 
        about this action, True is returned, indicating bzr should just
 
207
        about this action, True is returned, indicating brz should just
208
208
        proceed.
209
209
 
210
210
        The confirmation id allows the user to configure certain actions to
316
316
        try:
317
317
            template = self._user_warning_templates[warning_id]
318
318
        except KeyError:
319
 
            fail = "bzr warning: %r, %r" % (warning_id, message_args)
 
319
            fail = "brz warning: %r, %r" % (warning_id, message_args)
320
320
            warnings.warn("no template for warning: " + fail)   # so tests will fail etc
321
321
            return fail
322
322
        try:
323
323
            return template % message_args
324
324
        except ValueError, e:
325
 
            fail = "bzr unprintable warning: %r, %r, %s" % (
 
325
            fail = "brz unprintable warning: %r, %r, %s" % (
326
326
                warning_id, message_args, e)
327
327
            warnings.warn(fail)   # so tests will fail etc
328
328
            return fail
454
454
    """A UI Factory which never prints anything.
455
455
 
456
456
    This is the default UI, if another one is never registered by a program
457
 
    using bzrlib, and it's also active for example inside 'bzr serve'.
 
457
    using breezy, and it's also active for example inside 'brz serve'.
458
458
 
459
459
    Methods that try to read from the user raise an error; methods that do
460
460
    output do nothing.
522
522
    """
523
523
    # this is now always TextUIFactory, which in turn decides whether it
524
524
    # should display progress bars etc
525
 
    from bzrlib.ui.text import TextUIFactory
 
525
    from breezy.ui.text import TextUIFactory
526
526
    return TextUIFactory(stdin, stdout, stderr)
527
527
 
528
528