From c1b0dc4225c2243c999300416cdaa043ead1acf5 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Tue, 1 Apr 2014 09:37:02 +0200 Subject: [PATCH] Add lib/ folder to the PYTHON_PATH. This way, modules inside the lib/ folder don't have to be repackaged, and allows top level folders (e.g. bs4) to move to the lib/ folder. Approach is similar to what CouchPotato does. --- Headphones.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Headphones.py b/Headphones.py index 19cc82dd..5b4a42de 100755 --- a/Headphones.py +++ b/Headphones.py @@ -14,7 +14,12 @@ # You should have received a copy of the GNU General Public License # along with Headphones. If not, see . -import os, sys, locale +import os, sys + +# Ensure lib added to path, before any other imports +sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib/')) + +import locale import time import signal @@ -34,7 +39,6 @@ signal.signal(signal.SIGTERM, headphones.sig_handler) def main(): - # Fixed paths to Headphones if hasattr(sys, 'frozen'): headphones.FULL_PATH = os.path.abspath(sys.executable)