Prepend instead of append to path

When an activity is launched, an import should first search the activity
bundle source rather than /usr/bin

Fixes the need to change activity sources every time a system package
conflicts with an import.

May impact any activity that relies on a system package being in search
path before the bundle source.  Forty activities were tested, and none
relied on this.
This commit is contained in:
James Cameron 2017-03-27 19:07:37 +11:00
parent b6d449681d
commit 495eed8737

View File

@ -114,7 +114,7 @@ def main():
os.environ['SUGAR_BUNDLE_PATH'] = os.path.abspath(os.curdir) os.environ['SUGAR_BUNDLE_PATH'] = os.path.abspath(os.curdir)
bundle_path = os.environ['SUGAR_BUNDLE_PATH'] bundle_path = os.environ['SUGAR_BUNDLE_PATH']
sys.path.append(bundle_path) sys.path.insert(0, bundle_path)
try: try:
bundle = ActivityBundle(bundle_path) bundle = ActivityBundle(bundle_path)