From 9dd85bf154dee827bd8e215b466a10188eca2ca2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 14 Dec 2009 21:36:21 +0100 Subject: [PATCH] Updated and documented a little bit the sys.path alteration --- jack_mixer.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/jack_mixer.py b/jack_mixer.py index 50897a4..04f9c8d 100755 --- a/jack_mixer.py +++ b/jack_mixer.py @@ -26,28 +26,29 @@ import gobject import sys import os -old_path = sys.path -sys.path.insert(0, os.path.dirname(sys.argv[0]) + os.sep + ".." + os.sep + "share"+ os.sep + "jack_mixer") - -import jack_mixer_c -import scale - try: import lash except: lash = None + print >> sys.stderr, "Cannot load LASH python bindings, you want them unless you enjoy manual jack plumbing each time you use this app" + +# temporary change Python modules lookup path to look into installation +# directory ($prefix/share/jack_mixer/) +old_path = sys.path +sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), '..', 'share', 'jack_mixer')) +import jack_mixer_c +import scale from channel import * + import gui from preferences import PreferencesDialog -sys.path = old_path - from serialization_xml import xml_serialization from serialization import serialized_object, serializator -if lash is None: - print >> sys.stderr, "Cannot load LASH python bindings, you want them unless you enjoy manual jack plumbing each time you use this app" +# restore Python modules lookup path +sys.path = old_path class jack_mixer(serialized_object): -- 2.39.2