~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

terminal_width can now returns None.

* bzrlib/win32utils.py:
(get_console_size): Fix typo in comment.

* bzrlib/ui/text.py:
(TextProgressView._show_line): Handle the no terminal present case.

* bzrlib/tests/test_osutils.py:
(TestTerminalWidth): Update tests.

* bzrlib/tests/blackbox/test_too_much.py:
Fix some imports.
(OldTests.test_bzr): Handle the no terminal present case.

* bzrlib/tests/__init__.py:
(VerboseTestResult.report_test_start): Handle the no terminal
present case.

* bzrlib/status.py:
(show_pending_merges): Handle the no terminal present case.
(show_pending_merges.show_log_message): Factor out some
code. Handle the no terminal present case.

* bzrlib/osutils.py:
(terminal_width): Return None if no precise value can be found.

* bzrlib/log.py:
(LineLogFormatter.__init__): Handle the no terminal present case.
(LineLogFormatter.truncate): Accept None as max_len meaning no
truncation.
(LineLogFormatter.log_string): 

* bzrlib/help.py:
(_help_commands_to_text): Handle the no terminal present case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
    shown_commands = [(n, o) for n, o in commands if o.hidden == hidden]
79
79
    max_name = max(len(n) for n, o in shown_commands)
80
80
    indent = ' ' * (max_name + 1)
81
 
    width = osutils.terminal_width() - 1
 
81
    width = osutils.terminal_width()
 
82
    if width is None:
 
83
        width = osutils.default_terminal_width
 
84
    # we need one extra space for terminals that wrap on last char
 
85
    width = width - 1
82
86
 
83
87
    for cmd_name, cmd_object in sorted(shown_commands):
84
88
        plugin_name = cmd_object.plugin_name()