From 363871eeacc9bd4ebac27f6a9e43faff16e5433c Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 14 Jan 2015 09:33:24 +1300 Subject: [PATCH] Trying to fix the watchdog wrapper. --- tools/watchdog/watchdog_wrapper.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/watchdog/watchdog_wrapper.py b/tools/watchdog/watchdog_wrapper.py index 49b62af..e96c127 100644 --- a/tools/watchdog/watchdog_wrapper.py +++ b/tools/watchdog/watchdog_wrapper.py @@ -24,7 +24,7 @@ import sys # Variable templates -LIBDIR = '/usr/local/lib' +LIBDIRS = ['/usr/local/lib', '/usr/lib'] PROGRAM_PATH = 'watchdog.main' NEEDS_GTK=False NEEDS_GST=False @@ -32,12 +32,14 @@ try: # setup the project root dir = os.path.dirname(os.path.abspath(__file__)) - if os.path.exists(os.path.join(dir, '..', 'flumotion', '.svn')) or \ - os.path.exists(os.path.join(dir, '..', '.git')): - root = os.path.split(dir)[0] + + if os.path.exists(os.path.join(dir, '..', 'flumotion', '.git')): + sys.path.insert(0, os.path.join(dir, '..', 'flumotion')) else: - root = os.path.join(LIBDIR, 'flumotion', 'python') - sys.path.insert(0, root) + for libdir in LIBDIRS: + full_libdir = os.path.join(libdir, 'flumotion', 'python') + if os.path.exists(full_libdir): + sys.path.insert(0, full_libdir) import warnings warnings.filterwarnings('ignore', category=UserWarning)