use local ffmpeg2theora if available

This commit is contained in:
j 2012-02-24 22:37:55 +05:30
parent 60839de99c
commit 6bd249a5ae
2 changed files with 7 additions and 1 deletions

View file

@ -62,7 +62,11 @@ def oshash(filename):
def avinfo(filename):
if os.path.getsize(filename):
p = subprocess.Popen(['ffmpeg2theora', '--info', filename],
ffmpeg2theora = 'ffmpeg2theora'
local = os.path.expanduser('~/.ox/bin/ffmpeg2theora')
if os.path.exists(local):
ffmpeg2theora = local
p = subprocess.Popen([ffmpeg2theora, '--info', filename],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
info, error = p.communicate()
try:

View file

@ -160,6 +160,8 @@ def decodeHtml(html):
return match.group(0)
return charrefpat.sub(entitydecode, html).replace(u'\xa0', ' ')
decode_hmtl = decodeHtml
def highlight(text, query, hlClass="hl"):
"""
>>> highlight('me & you and $&%', 'and')