projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c8d32d
)
Use subprocess to call stty size when COLUMNS is not set
author
Philipp Hagemeister
<phihag@phihag.de>
Wed, 24 Aug 2011 21:28:30 +0000
(23:28 +0200)
committer
Philipp Hagemeister
<phihag@phihag.de>
Wed, 24 Aug 2011 21:28:30 +0000
(23:28 +0200)
youtube-dl
patch
|
blob
|
history
diff --git
a/youtube-dl
b/youtube-dl
index 1ae68b2b5d017c3d530eb986cb48f50c3b368234..32bd99e98e4f1e575fdb2a2881f833b6adae3ce3 100755
(executable)
--- a/
youtube-dl
+++ b/
youtube-dl
@@
-2996,11
+2996,12
@@
def parseOpts():
if columns:
return int(columns)
- # TODO: Breaks on phihag's system
- #if sys.platform.startswith('linux'):
- # try:
- # return os.popen('stty size', 'r').read().split()[1]
- # except: pass
+ try:
+ sp = subprocess.Popen(['stty', 'size'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out,err = sp.communicate()
+ return out.split()[1]
+ except:
+ pass
return None
max_width = 80