import os

import cfgtools

delivery_store_pickup_config = None


def should_ask_delivery_type():
    # type: (...) -> bool

    global delivery_store_pickup_config

    if delivery_store_pickup_config is None:
        config = cfgtools.read(os.environ["LOADERCFG"])
        delivery_store_pickup_config = config.find_value("Customizations.ManualDeliveryStorePickup", "false")

    return delivery_store_pickup_config.lower() == "true"
