#!/usr/local/bin/python3.14

import os
import sys

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
    bindir = os.path.dirname(os.path.abspath(__file__))
    if not os.path.isfile(os.path.join(
        bindir, "..", "data", "io.otsaloma.nfoview.desktop.in")): return
    sys.path.insert(0, os.path.abspath(os.path.join(bindir, "..")))

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