From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Thu, 27 Sep 2018 12:21:01 +0000 (+0100) Subject: python: Update to allow tvhmeta to run in dev or in live. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e0be9cab441e826df1f5431b6df59d264762067;p=thirdparty%2Ftvheadend.git python: Update to allow tvhmeta to run in dev or in live. In development tree, the libraries are in ../lib/py. In live, we currently install the library in the same directory so need to import it differently. --- diff --git a/support/tvhmeta b/support/tvhmeta index 53dfd8b8f..78f796548 100755 --- a/support/tvhmeta +++ b/support/tvhmeta @@ -50,8 +50,15 @@ except: import json import sys import os +# In development tree, the library is in ../lib/py, but in live it's +# in the install bin directory (since it is an executable in its own +# right) sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'lib', 'py')) -import tvh.tv_meta_tmdb as tv_meta_tmdb +try: + import tvh.tv_meta_tmdb as tv_meta_tmdb +except: + sys.path.insert(0, os.path.join(os.path.dirname(__file__), '.')) + import tv_meta_tmdb as tv_meta_tmdb class TvhMeta(object): def __init__(self, host, port, user, password):