/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 bzrlib/osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-12 01:34:46 UTC
  • mfrom: (5597.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110112013446-le2folid2nfkgncn
(vila) Accept 0 to mean no limit for BZR_COLUMNS (Neil
        Martinsen-Burrell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1461
1461
    # a similar effect.
1462
1462
 
1463
1463
    # If BZR_COLUMNS is set, take it, user is always right
 
1464
    # Except if they specified 0 in which case, impose no limit here
1464
1465
    try:
1465
 
        return int(os.environ['BZR_COLUMNS'])
 
1466
        width = int(os.environ['BZR_COLUMNS'])
1466
1467
    except (KeyError, ValueError):
1467
 
        pass
 
1468
        width = None
 
1469
    if width is not None:
 
1470
        if width > 0:
 
1471
            return width
 
1472
        else:
 
1473
            return None
1468
1474
 
1469
1475
    isatty = getattr(sys.stdout, 'isatty', None)
1470
1476
    if isatty is None or not isatty():