- Command.dump can now output commands pastable into sh

- Command no longer leaves zombies everywhere and exports process return codes
- fixed --audio copy/--video copy - it actually copies streams now
- files with a colon in their names can be processed now
- files with multiple audio streams are sort of handled
- halt when ffmpeg returns an error
This commit is contained in:
Overwatch 2014-08-28 23:33:58 +02:00
parent 93777058bd
commit 3fff52fedc
2 changed files with 36 additions and 22 deletions

8
aux.py
View file

@ -63,7 +63,7 @@ class Command:
self.__dict__["fifo"] = None
self.__dict__["terminated"] = False
def dump(self, sequence=None):
def dump(self, sequence=None, pretty=False):
out = []
if not sequence:
@ -77,7 +77,10 @@ class Command:
elif item is not None:
out.append(str(item))
return out
if pretty:
return [('"%s"' %(a) if ' ' in a else a) for a in out]
else:
return out
def run(self, stderr=False):
"""
@ -118,6 +121,7 @@ class Command:
if None in buffer:
self.__dict__["terminated"] = True
self.__dict__["returncode"] = self.process.poll()
if len(buffer) == 1:
return None