diff options
| author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2015-02-28 21:42:16 +0100 | 
|---|---|---|
| committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2015-02-28 21:44:57 +0100 | 
| commit | 003c69a84b68cadb46aeb8e03115848a722fd675 (patch) | |
| tree | c562f029a2868fc1f8efa3753f8acedcd0583a97 /youtube_dl/utils.py | |
| parent | 01349011088b10861e283c245f5da56aa3d5fba0 (diff) | |
Use shutil.get_terminal_size for getting the terminal width if it's available (python >= 3.3)
Diffstat (limited to 'youtube_dl/utils.py')
| -rw-r--r-- | youtube_dl/utils.py | 17 | 
1 files changed, 0 insertions, 17 deletions
| diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 1f3bfef7d..d4938ec36 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -35,7 +35,6 @@ import zlib  from .compat import (      compat_basestring,      compat_chr, -    compat_getenv,      compat_html_entities,      compat_http_client,      compat_parse_qs, @@ -1173,22 +1172,6 @@ def parse_filesize(s):      return int(float(num_str) * mult) -def get_term_width(): -    columns = compat_getenv('COLUMNS', None) -    if columns: -        return int(columns) - -    try: -        sp = subprocess.Popen( -            ['stty', 'size'], -            stdout=subprocess.PIPE, stderr=subprocess.PIPE) -        out, err = sp.communicate() -        return int(out.split()[1]) -    except: -        pass -    return None - -  def month_by_name(name):      """ Return the number of a month by (locale-independently) English name """ | 
