#!/usr/bin/python3

import sys

from pathlib import Path

def prepare_paths():
    # If running from source, add root directory to sys.path.
    # '__file__' attribute missing implies a frozen installation.
    if not "__file__" in globals(): return
    root = Path(__file__).parent.parent.resolve()
    if not root.joinpath("data", "io.otsaloma.nfoview.desktop.in").exists(): return
    sys.path.insert(0, str(root))

prepare_paths()
import nfoview
nfoview.main(sys.argv[1:])
