mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 02:29:40 +00:00
changed method of getting terminal size
This commit is contained in:
parent
0ded10325c
commit
4d13758df4
1 changed files with 2 additions and 1 deletions
3
avian.py
3
avian.py
|
@ -10,6 +10,7 @@ DONE make passing your arguments for encoding,
|
||||||
make separate audio and encode it separately,
|
make separate audio and encode it separately,
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from psutil import virtual_memory
|
from psutil import virtual_memory
|
||||||
from subprocess import Popen, call
|
from subprocess import Popen, call
|
||||||
|
@ -42,7 +43,7 @@ class ProgressBar:
|
||||||
self.print()
|
self.print()
|
||||||
|
|
||||||
def print(self):
|
def print(self):
|
||||||
terminal_size = int(os.popen('stty size', 'r').read().split()[1])
|
terminal_size, _ = shutil.get_terminal_size()
|
||||||
bar_length = terminal_size - (2 * len(str(self.tasks))) - 13
|
bar_length = terminal_size - (2 * len(str(self.tasks))) - 13
|
||||||
|
|
||||||
if self.iteration == 0:
|
if self.iteration == 0:
|
||||||
|
|
Loading…
Reference in a new issue