# AUTOGENERATED! DO NOT EDIT! File to edit: ../../../pts/mod/cmds/09_create_user_symlinks.pct.py.

# %% top_export
from pathlib import Path

from repoyard.config import get_config
from repoyard import const

def create_user_symlinks(
    config_path: Path,
    user_repos_path: Path|None = None,
    user_repo_groups_path: Path|None = None,
):
    """
    """
    
    # AUTOGENERATED! DO NOT EDIT! File to edit: ../../../pts/mod/cmds/09_create_user_symlinks.pct.py.
    
    # %% auto 0
    __all__ = ['config', 'repoyard_meta', 'included_repo_metas']
    
    # %% ../../../pts/mod/cmds/09_create_user_symlinks.pct.py 11
    config = get_config(config_path)
    
    if user_repos_path is None:
        user_repos_path = config.user_repos_path
    if user_repo_groups_path is None:
        user_repo_groups_path = config.user_repo_groups_path
    
    # %% ../../../pts/mod/cmds/09_create_user_symlinks.pct.py 13
    from .._models import create_user_repos_symlinks, get_repoyard_meta
    
    repoyard_meta = get_repoyard_meta(config)
    included_repo_metas = [repo_meta for repo_meta in repoyard_meta.repo_metas if repo_meta.check_included(config)]
    create_user_repos_symlinks(
        config=config,
        repo_metas=included_repo_metas,
    )
    
    # %% ../../../pts/mod/cmds/09_create_user_symlinks.pct.py 16
    from .._models import create_user_repo_group_symlinks
    
    create_user_repo_group_symlinks(
        config=config,
    )