From e5ef91a4db0876f8c258db5b81b0305b0f74ba65 Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Mon, 11 Mar 2013 13:39:34 +0100 Subject: [PATCH] Fix examples_dir location when not yet installed --- urlwatch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/urlwatch b/urlwatch index 6c696e2..8fca850 100755 --- a/urlwatch +++ b/urlwatch @@ -64,11 +64,14 @@ hooks_py = os.path.join(scripts_dir, 'hooks.py') # Check if we are installed in the system already (prefix, bindir) = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0]))) -if bindir != 'bin': +if bindir == 'bin': + # Installed system-wide + examples_dir = os.path.join(prefix, 'share', pkgname, 'examples') +else: # Assume we are not yet installed sys.path.insert(0, os.path.join(prefix, bindir, 'lib')) + examples_dir = os.path.join(prefix, bindir, 'share', pkgname, 'examples') -examples_dir = os.path.join(prefix, 'share', pkgname, 'examples') urls_txt_example = os.path.join(examples_dir, 'urls.txt.example') hooks_py_example = os.path.join(examples_dir, 'hooks.py.example') -- 2.11.4.GIT