| 1 |
#!/usr/bin/python3 |
| 2 |
|
| 3 |
import sys |
| 4 |
import os |
| 5 |
|
| 6 |
|
| 7 |
modules_path = os.path.dirname(os.path.abspath(sys.argv[0])).rstrip("/launch") |
| 8 |
|
| 9 |
sys.path.insert(0, modules_path) |
| 10 |
import processutils |
| 11 |
processutils.update_sys_path(modules_path) |
| 12 |
|
| 13 |
try: |
| 14 |
import medialinker |
| 15 |
import editorstate # Used to decide which translations from file system are used |
| 16 |
root_dir = modules_path.split("/")[1] |
| 17 |
if root_dir != "home": |
| 18 |
editorstate.app_running_from = editorstate.RUNNING_FROM_INSTALLATION |
| 19 |
else: |
| 20 |
editorstate.app_running_from = editorstate.RUNNING_FROM_DEV_VERSION |
| 21 |
except Exception as err: |
| 22 |
print ("Failed to import medialinker") |
| 23 |
print ("ERROR:", err) |
| 24 |
print ("Installation was assumed to be at:", modules_path) |
| 25 |
sys.exit(1) |
| 26 |
|
| 27 |
|
| 28 |
medialinker.main(modules_path, sys.argv[1]) # sys.argv[1] is possibly a file path to project to be opened at startup |