Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 12689:c52c629ce19e
termwidth: move to ui.ui from util
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sun, 10 Oct 2010 10:06:36 -0500 |
parents | cf24b6b5517c |
children | ad2506f097d3 |
comparison
equal
deleted
inserted
replaced
12688:8c034a825cfe | 12689:c52c629ce19e |
---|---|
400 # usually those are non-interactive | 400 # usually those are non-interactive |
401 return False | 401 return False |
402 | 402 |
403 return i | 403 return i |
404 | 404 |
405 def termwidth(self): | |
406 '''how wide is the terminal in columns? | |
407 ''' | |
408 if 'COLUMNS' in os.environ: | |
409 try: | |
410 return int(os.environ['COLUMNS']) | |
411 except ValueError: | |
412 pass | |
413 return util.termwidth() | |
414 | |
405 def formatted(self): | 415 def formatted(self): |
406 '''should formatted output be used? | 416 '''should formatted output be used? |
407 | 417 |
408 It is often desirable to format the output to suite the output medium. | 418 It is often desirable to format the output to suite the output medium. |
409 Examples of this are truncating long lines or colorizing messages. | 419 Examples of this are truncating long lines or colorizing messages. |