~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Vincent Ladeuil
  • Date: 2009-10-23 16:31:03 UTC
  • mto: This revision was merged to the branch mainline in revision 4767.
  • Revision ID: v.ladeuil+lp@free.fr-20091023163103-x1h0sbrz61r0bqzx
Revert incomplete fix for bug #353370

Show diffs side-by-side

added added

removed removed

Lines of Context:
1296
1296
 
1297
1297
def terminal_width():
1298
1298
    """Return estimated terminal width."""
1299
 
    isatty = getattr(sys.stdout, 'isatty', None)
1300
 
    if  isatty is None or not isatty():
1301
 
        # If it's not a tty, the width makes no sense. We just use a value bug
1302
 
        # enough to avoid truncations. When the output is redirected, the
1303
 
        # pagers can then handle that themselves. A cleaner implementation
1304
 
        # would be to fix the callers to not try to format at all in these
1305
 
        # circumstances.
1306
 
        return 65536
1307
 
 
1308
1299
    if sys.platform == 'win32':
1309
1300
        return win32utils.get_console_size()[0]
1310
1301
    width = 0