id ddlZddlZddlmZddlmZddlmZddlm Z m Z Gdde Z Gd d e e Z dd gZ dS) N)ABCMeta)Path)fs_supports_symlink)Creator CreatorMetacJeZdZfdZedZedZxZS)ViaGlobalRefMetactd|_d|_t s d|_dSdS)Nz(the filesystem does not supports symlink)super__init__ copy_error symlink_errorrself __class__s Y/opt/cloudlinux/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/api.pyr zViaGlobalRefMeta.__init__ sQ !"$$ L!KD    L Lc|j SN)rrs rcan_copyzViaGlobalRefMeta.can_copys ?""rc|j Sr)rrs r can_symlinkzViaGlobalRefMeta.can_symlinks%%%r)__name__ __module__ __qualname__r propertyrr __classcell__rs@rr r ssLLLLL##X#&&X&&&&&rr cteZdZfdZedZefdZdZdZ dZ fdZ fdZ xZ S) ViaGlobalRefApict|||||_|j|_dSr)r r _should_symlinksymlinks system_siteenable_system_site_package)roptions interpreterrs rr zViaGlobalRefApi.__init__sC +...,,W55 *1*='''rct|ddt|dd}}|d|d}}dD]/}||kr|nd}||kr|nd}|dur|durdS|durdS|durdS0dS)NcopiesFr%)clizenv varfiledefaultT)getattr get_source)r(r+r%copy_srcsym_srclevels_optc_opts rr$zViaGlobalRefApi._should_symlink"s#7He<a>a#..x88':L:LZ:X:X':  E '5 0 0HHdE&%//FFTE}}$uu}}tt}}uuurc|t|||||ddddd|}|js|jst d|jr|dd dd d |jr#|d d |j ddddSdS)Nz--system-site-packagesF store_truer&zCgive the virtual environment access to the system site-packages dir)r.actiondesthelpz(neither symlink or copy method supportedz --symlinksTr%zZtry to use symlinks rather than copies, when symlinks are not the default for the platformz--copiesz --always-copyr+z[try to use copies rather than symlinks, even when symlinks are the default for the platform)r add_parser_arguments add_argumentadd_mutually_exclusive_grouprr RuntimeError)clsparserr)metaapp_datagrouprs rr;z$ViaGlobalRefApi.add_parser_arguments3s $$V[$III $V    3355 K  KIJJ J      #q     =     ,,#r        rc.|dSr) install_patchrs rcreatezViaGlobalRefApi.createRs rc|}|rj|jdz }tjd||d|jdz }tjd|||dSdS)Nz_virtualenv.pthz%create virtualenv import hook file %szimport _virtualenv_virtualenv.pyz create %s)env_patch_textpurelibloggingdebug write_text)rtextpth dest_paths rrEzViaGlobalRefApi.install_patchUs""$$  ',!22C MA3 G G G NN/ 0 0 0 '77I M+y 1 1 1   & & & & &  ' 'rc |jttjdz 5}|}|dttj t|j t|j cdddS#1swxYwYdS)zIPatch the distutils package to not be derailed by its configuration filesrHz"__SCRIPT_DIR__"N)rBensure_extractedr__file__parent read_textreplacereprospathrelpathstr script_dirrJ)r resolved_pathrNs rrIzViaGlobalRefApi.env_patch_text_s ] + +DNN,ADT,T U U tYf **,,D<< 2DT_I]I]_bcgco_p_p9q9q4r4rss t t t t t t t t t t t t t t t t t tsA9B;;B?B?cZtd|jfgzS)Nglobal)r _argsr'rs rr`zViaGlobalRefApi._argses%ww}}8T-L"M!NNNrcnt|jrdnd|jd<dS)Ntruefalsezinclude-system-site-packages)r set_pyenv_cfgr' pyenv_cfgrs rrdzViaGlobalRefApi.set_pyenv_cfghs9 CGCb9oho5666r)rrrr staticmethodr$ classmethodr;rFrErIr`rdrr s@rr"r"s>>>>> \ [<'''ttt OOOOOppppppppprr") metaclass)rKrXabcrpathlibrvirtualenv.inforcreatorrrr r"__all__rrros //////********&&&&&{&&&"NpNpNpNpNpgNpNpNpNpd r