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.
This commit is contained in:
Bas Stottelaar
2014-04-01 09:37:02 +02:00
parent 31ed56bcc9
commit c1b0dc4225

View File

@@ -14,7 +14,12 @@
# You should have received a copy of the GNU General Public License
# along with Headphones. If not, see <http://www.gnu.org/licenses/>.
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)