| 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 gmic |
| 15 |
import editorstate # Used to decide which translations from file system are used |
| 16 |
# and SDL playback consumer version for Flatpak. |
| 17 |
root_dir = modules_path.split("/")[1] |
| 18 |
if root_dir == "home": |
| 19 |
editorstate.app_running_from = editorstate.RUNNING_FROM_DEV_VERSION |
| 20 |
elif root_dir == "app": |
| 21 |
editorstate.app_running_from = editorstate.RUNNING_FROM_FLATPAK |
| 22 |
else: |
| 23 |
editorstate.app_running_from = editorstate.RUNNING_FROM_INSTALLATION |
| 24 |
|
| 25 |
except Exception as err: |
| 26 |
print ("Failed to import gmic") |
| 27 |
print ("ERROR:", err) |
| 28 |
print ("Installation was assumed to be at:", modules_path) |
| 29 |
sys.exit(1) |
| 30 |
|
| 31 |
|
| 32 |
gmic.main(modules_path) |