zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
U
G=®d±Qã@s dZddlZddlZddlZddlZddlZddlmZddl    m
Z
ddl m Z ddl mZddlmZdd    „Zd
d „Zd d „Zdd„Zdadd„Zdd„Zd*dd„Zdaaadd„Zdd„Zd+dd„Zdd„Zd,d d!„Zd"d#„Z d-d$d%„Z!d.d&d'„Z"Gd(d)„d)ƒZ#dS)/zudistutils.util
 
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
éN)ÚDistutilsPlatformError)Únewer)Úspawn)Úlog)ÚDistutilsByteCompileErrorc CsÚtjdkrFdtj ¡krdSdtj ¡kr.dSdtj ¡kr@dStjSdtjkrZtjdStjd    ksnttd
ƒsttjSt ¡\}}}}}| ¡     d d ¡}|     d d¡}|     d d¡}|dd…dkrÊd||fS|dd…dkr,|ddkrÌd}dt
|dƒd|dd…f}dddœ}|d|tj 7}n |dd…dkrPdd l m }|ƒS|dd!…d"krŽd"}t d#tj¡}| |¡}|rÌ| ¡}n>|dd!…d$krÌddl}    ddl}
|     |
j ¡|||¡\}}}d%|||fS)&aúReturn a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.
 
    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u
 
    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)
 
    For other non-POSIX platforms, currently just returns 'sys.platform'.
 
    ÚntÚamd64ú    win-amd64z(arm)ú    win-arm32z(arm64)z    win-arm64Ú_PYTHON_HOST_PLATFORMÚposixÚunameú/Úú Ú_ú-NéÚlinuxz%s-%sÚsunosrÚ5Úsolarisz%d.%sééÚ32bitÚ64bit)iÿÿÿlÿÿÿÿz.%sÚaix)Ú aix_platforméÚcygwinz[\d.]+Údarwinz%s-%s-%s)ÚosÚnameÚsysÚversionÚlowerÚplatformÚenvironÚhasattrr ÚreplaceÚintÚmaxsizeZ _aix_supportrÚreÚcompileÚASCIIÚmatchÚgroupÚ _osx_supportÚdistutils.sysconfigÚget_platform_osxÚ    sysconfigÚget_config_vars) ÚosnameÚhostÚreleaser$ÚmachineÚbitnessrÚrel_reÚmr1Ú    distutils©r>úQD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/_distutils/util.pyÚget_host_platformsT
 
 
    
 
 
þ
r@cCs8tjdkr.ddddœ}| tj d¡¡p,tƒStƒSdS)NrÚwin32r    r
)Úx86Úx64ÚarmÚVSCMD_ARG_TGT_ARCH)r!r"Úgetr'r@)ÚTARGET_TO_PLATr>r>r?Ú get_platformbs
ýrHcCsztjdkr|S|s|S|ddkr.td|ƒ‚|ddkrFtd|ƒ‚| d¡}d|krd| d¡qP|sntjStjj|ŽS)aÎReturn 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    rrzpath '%s' cannot be absoluteéÿÿÿÿzpath '%s' cannot end with '/'Ú.)r!ÚsepÚ
ValueErrorÚsplitÚremoveÚcurdirÚpathÚjoin)ÚpathnameÚpathsr>r>r?Ú convert_pathms    
 
 rTcCsŽtjdkr<tj |¡s$tj ||¡Stj ||dd…¡SnNtjdkr|tj |¡\}}|ddkrn|dd…}tj ||¡Stdtjƒ‚dS)a    Return 'pathname' with 'new_root' prepended.  If 'pathname' is
    relative, this is equivalent to "os.path.join(new_root,pathname)".
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.
    r éNrrú\z!nothing known about platform '%s')r!r"rPÚisabsrQÚ
splitdriver)Únew_rootrRÚdriverPr>r>r?Ú change_root‰s
 
  r[c    CsxtrdStjdkrZdtjkrZz$ddl}| t ¡¡dtjd<Wnttfk
rXYnXdtjkrpt    ƒtjd<dadS)aLEnsure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    Nr ÚHOMErrÚPLATrU)
Ú_environ_checkedr!r"r'ÚpwdÚgetpwuidÚgetuidÚ ImportErrorÚKeyErrorrH)r_r>r>r?Ú check_environ s    
 rdc
CsVtƒ|fdd„}zt d||¡WStk
rP}ztd|ƒ‚W5d}~XYnXdS)aàPerform shell/Perl-style variable substitution on 'string'.  Every
    occurrence of '$' followed by a name is considered a variable, and
    variable is substituted by the value found in the 'local_vars'
    dictionary, or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    cSs,| d¡}||krt||ƒStj|SdS)NrU)r0Ústrr!r')r/Ú
local_varsÚvar_namer>r>r?Ú_substÅs
 zsubst_vars.<locals>._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s'N)rdr,ÚsubrcrL)ÚsrfrhÚvarr>r>r?Ú
subst_vars»s      rlúerror: cCs |t|ƒS©N)re)ÚexcÚprefixr>r>r?Úgrok_environment_errorÔsrqcCs(t dtj¡at d¡at d¡adS)Nz [^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r,r-ÚstringÚ
whitespaceÚ _wordchars_reÚ
_squote_reÚ
_dquote_rer>r>r>r?Ú _init_regexÝs
rwcCs„tdkrtƒ| ¡}g}d}|r€t ||¡}| ¡}|t|ƒkrZ| |d|…¡q€||tjkr| |d|…¡||d…     ¡}d}nÔ||dkrÂ|d|…||dd…}|d}n¢||dkrÜt
 ||¡}n*||dkröt  ||¡}nt d||ƒ‚|dkr t d||ƒ‚| ¡\}}|d|…||d|d…||d…}| ¡d    }|t|ƒkr| |¡q€q|S)
aSplit a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    NrrVrUú'ú"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)rtrwÚstripr/ÚendÚlenÚappendrrrsÚlstriprurvÚ RuntimeErrorrLÚspan)rjÚwordsÚposr<r{Úbegr>r>r?Ú split_quotedãs@   
 
 ,  
r„cCsP|dkr6d|j|f}|dd…dkr6|dd…d}t |¡|sL||ŽdS)aœPerform some action that affects the outside world (eg.  by
    writing to the filesystem).  Such actions are special because they
    are disabled by the 'dry_run' flag.  This method takes care of all
    that bureaucracy for you; all you have to do is supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed), and an optional message to
    print.
    Nz%s%réþÿÿÿz,)rú))Ú__name__rÚinfo)ÚfuncÚargsÚmsgÚverboseÚdry_runr>r>r?Úexecute s    
rŽcCs2| ¡}|dkrdS|dkr dStd|fƒ‚dS)zôConvert a string representation of truth to true (1) or false (0).
 
    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )ÚyÚyesÚtÚtrueÚonÚ1rU)ÚnÚnoÚfÚfalseÚoffÚ0rzinvalid truth value %rN)r%rL)Úvalr>r>r?Ú    strtobool3s rœrUc    CsTddl}tjrtdƒ‚|dkr*do(|dk}|s@zddlm}    |    dƒ\}
} Wn.tk
rzddlm} d| dƒ}
} YnXt     d| ¡|sø|
dk    r¢t
  |
d    ¡} n
t | d    ƒ} | B|   d
¡|   d  tt|ƒ¡d ¡|   d |||||f¡W5QRXtjg}| | ¡¡| | ¡t||dtt
j| fd| |dnddlm}|D]þ}|dd…dkrjqP|dkr˜|dkr‚dn|}tjj||d}n tj |¡}|}|rä|dt|ƒ…|krÔtd||fƒ‚|t|ƒd…}|røt
j ||¡}t
j  |¡}|rP|st!||ƒr>t     d||¡|sL||||ƒnt "d||¡qPdS)a~Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.
 
    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.
 
    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.
 
    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    rNzbyte-compiling is disabled.T)Úmkstempú.py)Úmktempz$writing byte-compilation script '%s'Úwz2from distutils.util import byte_compile
files = [
z,
z]
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
)rz removing %s)r-éýÿÿÿr)Ú optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#Ú
subprocessr#Údont_write_bytecoderÚtempfilerrbrŸrrˆr!ÚfdopenÚopenÚwriterQÚmapÚreprÚ
executableÚextendÚ"_optim_args_from_interpreter_flagsr}rrŽrNÚ
py_compiler-Ú    importlibÚutilÚcache_from_sourcer|rLrPÚbasenamerÚdebug)Úpy_filesÚoptimizeÚforcerpÚbase_dirrŒrÚdirectr£rÚ    script_fdÚ script_namerŸÚscriptÚcmdr-ÚfileÚoptÚcfileÚdfileÚ
cfile_baser>r>r?Ú byte_compileCsx$     
 
 û
 ÿ
 
ÿ ÿ ÿrÂcCs| d¡}d}| |¡S)zŒReturn a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    Ú
z    
        )rMrQ)ÚheaderÚlinesrKr>r>r?Ú rfc822_escapeØs
rÆcCsV|sdSddlm}m}Gdd„d|ƒ}|dkr8|dƒ}|||d}|j|dd    dS)
a Invoke 2to3 on a list of Python files.
    The files should all come from the build area, as the
    modification is done in-place. To reduce the build time,
    only files modified since the last invocation of this
    function should be passed in the files argument.Nr)ÚRefactoringToolÚget_fixers_from_packagec@s$eZdZdd„Zdd„Zdd„ZdS)z*run_2to3.<locals>.DistutilsRefactoringToolc_stj|f|žŽdSrn)rÚerror)Úselfr‹rŠÚkwr>r>r?Ú    log_errorïsz4run_2to3.<locals>.DistutilsRefactoringTool.log_errorcWstj|f|žŽdSrn)rrˆ©rÊr‹rŠr>r>r?Ú log_messageòsz6run_2to3.<locals>.DistutilsRefactoringTool.log_messagecWstj|f|žŽdSrn)rr³rÍr>r>r?Ú    log_debugõsz4run_2to3.<locals>.DistutilsRefactoringTool.log_debugN)r‡Ú
__module__Ú __qualname__rÌrÎrÏr>r>r>r?ÚDistutilsRefactoringToolîsrÒz lib2to3.fixes)ÚoptionsT)r¨)Úlib2to3.refactorrÇrÈÚrefactor)ÚfilesÚ fixer_namesrÓÚexplicitrÇrÈrÒÚrr>r>r?Úrun_2to3âs
 rÚc    Csddlm}ddlm}ddlm}|ƒ}    t ¡}
t |¡z |         ¡W5t |
¡X|    j
|    j dd…<|r|  ¡D]} |   ¡} | s„qr|     | ¡qrg} |    j D]L} tj || ¡}|tj |¡ƒ|tj || ¡|dd}|drš|  |¡qštdd    „| Dƒ|||d
| S) zÏRecursively copy a directory, only copying new and changed files,
    running run_2to3 over all newly copied Python modules afterward.
 
    If you give a template string, it's parsed like a MANIFEST.in.
    r)Úmkpath)Ú    copy_file)ÚFileListNrU)ÚupdatecSsg|]}| ¡ d¡r|‘qS)rž)r%Úendswith)Ú.0Úfnr>r>r?Ú
<listcomp>sz$copydir_run_2to3.<locals>.<listcomp>)r×rÓrØ)Údistutils.dir_utilrÛÚdistutils.file_utilrÜÚdistutils.filelistrÝr!ÚgetcwdÚchdirÚfindallÚallfilesrÖÚ
splitlinesrzÚprocess_template_linerPrQÚdirnamer}rÚ)ÚsrcÚdestÚtemplater×rÓrØrÛrÜrÝÚfilelistrOÚlineÚcopiedÚfilenameÚoutnameÚresr>r>r?Úcopydir_run_2to3ýs:   
 
 ÿröc@s$eZdZdZdZdZdZdd„ZdS)Ú    Mixin2to3zÀMixin class for commands that run 2to3.
    To configure 2to3, setup scripts may either change
    the class variables, or inherit from individual commands
    to override how 2to3 is invoked.NcCst||j|j|jƒSrn)rÚr×rÓrØ)rÊrÖr>r>r?rÚ.szMixin2to3.run_2to3)r‡rÐrÑÚ__doc__r×rÓrØrÚr>r>r>r?r÷s
r÷)rm)Nrr)rrNNrUrN)NNN)NNNN)$rør!r,Úimportlib.utilr¯rrr#Údistutils.errorsrÚdistutils.dep_utilrÚdistutils.spawnrr=rrr@rHrTr[r^rdrlrqrtrurvrwr„rŽrœrÂrÆrÚrör÷r>r>r>r?Ú<module>sN     P 
 =
ü

 
ÿ
!