[Tutor] mp3 range violation reportage.
Tesla Coil
tescoil@irtc.net
Wed, 30 May 2001 15:58:21 -0500
On 30 May 2001, D-Man replied:
>> But don't know the system doesn't have mpg123
>> in /usr/local/bin or elsewhere on path.
>>
>> There's *gotta* be an easy answer to this one.
>
> The easiest way is to just try it.
I did a temporary rename of mpg123 and found that
clippage.py then just exits rapidly, with nothing
returned to stdout. Q&D program that this is, I'm
kinda satisfied just to have it not blow sky high.
Conveniently, it's already reading stderr, and it
does the trick here to add:
def whatwentwrong(rawreport):
# Pass error messages.
if rawreport[-1][-10:-1]=='not found':
print rawreport[-1]
elif rawreport[-1][-26:-14]=='No such file':
print rawreport[-1]
if __name__ == '__main__':
commandline = modusoperandi(argv[1])
mpgout = runtest(commandline)
whatwentwrong(mpgout)
relevantdata = slicedown(mpgout)
tracks = gettracks(relevantdata)
clips = clipsums(relevantdata)
reportout(tracks, clips)
Not sure it does the trick elsewhere, but there's
lotsa things I'm not sure about elsewhere.