(filename)
return root_path
Determines the root path for the purposes of includes.

    PICO-8 restricts include paths to files in the PICO-8 cart root directory.
    If picotool detects that the input cart file is in such a path, it uses the
    cart root for includes. If the input cart is not in a recognized PICO-8
    cart path, includes are restricted to the directory containing the input
    file.

    Args:
        filename: The filename of the input cart.

    Returns:
        The include root path, or None if filename is None.
Determines the root path for the purposes of includes.
Determines the root path for the purposes of includes .
def get_root_include_path(filename):
    """Determines the root path for the purposes of includes.

    PICO-8 restricts include paths to files in the PICO-8 cart root directory.
    If picotool detects that the input cart file is in such a path, it uses the
    cart root for includes. If the input cart is not in a recognized PICO-8
    cart path, includes are restricted to the directory containing the input
    file.

    Args:
        filename: The filename of the input cart.

    Returns:
        The include root path, or None if filename is None.
    """
    if filename is None:
        return None
    root_path = None
    full_file_path = os.path.abspath(
        os.path.normpath(
            os.path.expanduser(filename)))
    for candidate in PICO8_CART_PATHS:
        full_candidate_path = os.path.abspath(
            os.path.normpath(
                os.path.expanduser(candidate)))
        if full_file_path.startswith(full_candidate_path):
            root_path = full_candidate_path
    if root_path is None:
        root_path = os.path.dirname(full_file_path)
    return root_path
def get_root_include_path ( filename ) : if filename is None : return None root_path = None full_file_path = os . path . abspath ( os . path . normpath ( os . path . expanduser ( filename ) ) ) for candidate in PICO8_CART_PATHS : full_candidate_path = os . path . abspath ( os . path . normpath ( os . path . expanduser ( candidate ) ) ) if full_file_path . startswith ( full_candidate_path ) : root_path = full_candidate_path if root_path is None : root_path = os . path . dirname ( full_file_path ) return root_path