From 6bd249a5ae9ab5d6c06d4ad341e17912bccd2b5d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 24 Feb 2012 22:37:55 +0530 Subject: [PATCH] use local ffmpeg2theora if available --- ox/file.py | 6 +++++- ox/html.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ox/file.py b/ox/file.py index 3636a0b..9ddc4c1 100644 --- a/ox/file.py +++ b/ox/file.py @@ -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: diff --git a/ox/html.py b/ox/html.py index a93a868..2b7406e 100644 --- a/ox/html.py +++ b/ox/html.py @@ -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')