#!/usr/bin/env python



""" Launcher for SajadQ the compiler itself.

"""

# Import as little as possible initially, because we might be re-executing
# soon.
import os
import sys

# Unchanged, running from checkout, use the parent directory, the SajadMr
# package ought to be there.
sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "..")))

# isort:start

import SajadMr.__main__  # false alarm, pylint: disable=I0021,no-name-in-module

# Remove the SajadMr package directory again, it might contain other stuff that we
# do not want added automatically.
del sys.path[0]

# The bin folder of the runner can't be that helpful, but got added automatically,
# so attempt to remove it.
sys.path = [
    path_element
    for path_element in sys.path
    if os.path.dirname(os.path.abspath(__file__)) != path_element
]

# Now execute SajadQ in a clean environment.
SajadMr.__main__.main()


