#!/usr/bin/env python3
import os.path
import sys

CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))

# We prevent to import some module from this dir instead of e.g. standard module.
# There is no reason to import anything from this module.
sys.path.remove(CURRENT_DIR)

# Add pcs package.
PACKAGE_DIR = os.path.dirname(CURRENT_DIR)
sys.path.insert(0, PACKAGE_DIR)


from pcs import (
    pcs_internal,
    settings,
)

if settings.pcs_bundled_pacakges_dir not in sys.path:
    sys.path.insert(0, settings.pcs_bundled_pacakges_dir)

settings.pcsd_exec_location = os.path.join(PACKAGE_DIR, "pcsd")
pcs_internal.main()
