
    	h.R                         " S  S\ 5      rSSKrS rS rS rS rS rS	 rS
 r	S r
S rS rS rS=S jrS rS=S jrS rS=S jrS=S jrS rS rS\R,                  S   -  rSrSr\S:X  Ga  \" \R,                  5      S:  a  \R,                  S   S;   a	  \" \5        g\" \R,                  5      S:X  d  \R,                  S   S   S;  Ga  \R:                  SS r\R,                  SS  H  r\RA                  \5        M     \RA                  S5        \RA                  S5        \RA                  S 5        \RA                  S!5        \RA                  S"5        \RA                  S#5        S$\RB                  ;   a  \RA                  S%5        O\RA                  S&5        \" S'5        \" \5        \" \5        \" S(\S)5        \" S*5        SSK"r"\"RF                  " 5         g/ r$SSK%r%\%RJ                  " \R,                  SS S+/ S,Q5      u  r&r'\' H  r\$RA                  \5        M     \& GHc  u  r(r)\(S-:X  a  \" \5        \(S.:X  a  \" \5        \(S/:X  a  \" S05        \" \$5        \(S1:X  a  \" S2\)5        \" \)S\$5        \(S3;   a  SSK*r*\" S4\)5        \*RV                  " \)5        \(S5:X  a3  SSK*r*S6RY                  \$5      r\" S7\)S8\5        \*RZ                  " \)\5        \(S9:X  d  M  \$(       d  \" S:5      eSSK*r*\*R\                  " S5      R_                  S65      r0\" \05      r1\$ H  r2\2\0;  d  M  \0RA                  \25        M     \" \05      \1:w  a9  \" S;\" \05      \1-
  -  5        \*RZ                  " SS6RY                  \05      5        GM[  \" S<5        GMf     gg)>c                       \ rS rSrSrg)error    N)__name__
__module____qualname____firstlineno____static_attributes__r       iC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\win32/scripts/regsetup.pyr   r      s    r   r       Nc                 ^    SSK n UR                  U 5        g! [         a
  n SnAgSnAff = f)z/Check if a file exists.  Returns true or false.r   N   )osstatOSError)fnamer   detailss      r   
FileExistsr      s+    
 s    
,,c                     SSK nUc  Sn[        UR                  R                  UR                  R                  X5      U5      5      $ )zvGiven a path, a ni package name, and possibly a known file name in
the root of the package, see if this path is good.
r   N.)r   r   pathjoin)r   packageNameknownFileNamer   s       r   IsPackageDirr      s9     bggll277<<#BMRSSr   c                  F    SSK n SU R                  R                  ;   a  S$ S$ )zgReturn "_d" if we're running a debug version.

This is to be used within DLL names when locating them.
r   Nz_d.pyd_d )importlib.machinery	machineryEXTENSION_SUFFIXES)	importlibs    r   IsDebugr$   !   s%    
 y22EEE4M2Mr   c                     SSK nSSKnUR                  " U 5      nU(       a  [        XPU5      (       a  US4$ U H4  n[        XPU5      (       d  M  UR                  R                  U5      nXf4s  $    [        SU -  5      e)zFind a package.

Given a ni style package name, check the package is registered.

First place looked is the registry for an existing entry.  Then
the searchPaths are searched.
r   Nz!The package %s can not be located)r   regutilGetRegisteredNamedPathr   r   abspathr   )r   r   searchPathsr   r&   pathLookrets          r   FindPackagePathr,   +   sv     --k:HLFF~}==''//(+C8O	  
 3kA
BBr   c                 b   SS K nSS KnSS Kn UR                  UR                  SSUR
                  5      n  UR                  Xa5      S   n[        UR                  R                  Xp5      5      (       a+  UR                  R                  U5      UR                  5         $  UR                  5         U H  n[        UR                  R                  X5      5      (       a  UR                  R                  U5      s  $ UR                  R                  US5      n[        UR                  R                  X5      5      (       d  M  UR                  R                  U5      s  $    [        SU -  5      e! UR                   a     Nf = f! UR                  5         f = f! UR                   a     Nf = f)Nr   zSoftware\Microsoft\Windows\HelpHelpz#The help file %s can not be located)r   win32apiwin32con
RegOpenKeyHKEY_LOCAL_MACHINEKEY_ALL_ACCESSRegQueryValueExr   r   r   r(   Closer   )	helpFilehelpDescr)   r   r/   r0   keyr   r*   s	            r   FindHelpPathr9   C   s\   !!''0##	
	//>qAbggll4:;;77??40 IIK <
 IIK  bggll867777??8,,77<<&1bggll867777??8,,   5@
AA >>  IIK>> sM   (F AE0 F  F !F 0F F FF FF F.-F.c                    SSK nSSKnUR                  " U 5      nU(       a  UR                  S5      S   nU(       a+  [	        UR
                  R                  WU5      5      (       a  gU HI  n[	        UR
                  R                  Xa5      5      (       d  M.  UR
                  R                  U5      s  $    [        SU SU  35      e)ztFind an application.

First place looked is the registry for an existing entry.  Then
the searchPaths are searched.
r   N;z	The file z$ can not be located for application )	r   r&   r'   splitr   r   r   r(   r   )appNamer   r)   r   r&   regPathr*   s          r   FindAppPathr?   e   s     ,,W5G==%a(:bggll8]CDDbggll8;<<77??8,,   
M?"FwiP r   c                 >   SSK nSSKnSSKnSSKnUc  U nUR                  R                  UR                  U5      n[        U5      (       d`  SUR                  ;   a)  UR                  R                  UR                  SSU5      nO'UR                  R                  UR                  SU5      n[        U5      (       d  [        X5      nSn UR                  UR                  " 5       UR                  " 5       S-   U -   5      n	Xy:H  nXx4$ ! UR                   a     Xx4$ f = f)zFind an exe.

Returns the full path to the .exe, and a boolean indicating if the current
registered entry is OK.  We don't trust the already registered version even
if it exists - it may be wrong (ie, for a different Python version)
r   N64 bitPCBuildamd64\)r   sysr&   r/   r   r   prefixr   versionLocateFileNameRegQueryValue
GetRootKeyGetAppPathsKeyr   )
exeAliaspossibleRealNamesr)   r   rE   r&   r/   foundregistered_ok
registereds
             r   FindPythonExerQ      s     $GGLL%67Ees{{"GGLLYARSEGGLLY8IJEe0>M++ '"8"8":T"AH"L

 +  >> s   
:D DDc                 \    SSK n U R                  S5        SU -  $ ! [         a    U s $ f = f)z6Given a filename, return a quoted version if necessaryr   N z"%s")r&   index
ValueError)r   r&   s     r   QuotedFileNamerV      s6     C~ s    ++c                    SSK nSSKnU R                  S5      nU HB  nU H0  n UR                  R	                  XV5      nUR                  U5          O   W(       d  MB    O   US   n SSKnSSKn	UR                  n
UR                  R                  U5      S   nSU SU S3nU	R                  SSXjUS5      nUR                  S	U-   5        UR                  5       UR                   :w  a  [#        S
5      eUR%                  5       nUR                  R'                  U5      $ ! [         a    Sn GM  f = f! [         a    [        SU-  5      ef = f)zLocate a file name, anywhere on the search path.

If the file can not be located, prompt the user to find it for us
(using a common OpenFile dialog)

Raises KeyboardInterrupt if the user cancels.
r   Nr;   zNeed to locate the file %s, but the win32ui module is not available
Please run the program again, passing as a parameter the path to this file.r   zFiles of requested type (*z)|*z||zLocate zUser cancelled the process)r   r&   r<   r   r   r   r   r0   win32uiImportErrorr   OFN_FILEMUSTEXISTsplitextCreateFileDialogSetOFNTitleDoModalIDOKKeyboardInterruptGetPathNamer(   )fileNamesStringr)   r   r&   	fileNamesr   fileNameretPathr0   rX   flagsextfilterdlgs                 r   rH   rH      sU    %%c*I!H'',,t6 	 " 7  Q<	 **ggx(+-cU#cU"=&&q$N	H,-;;=HMM)#$@AA//#77??7##/    	 c 	s   ,D (D4  D10D14Ec                     SSK nUR                  R                  UR                  R                  [	        X5      5      S   5      $ )z2Like LocateFileName, but returns a directory only.r   N)r   r   r(   r<   rH   )rd   r)   r   s      r   
LocatePathrk      s0    77??277==)NOPQRSSr   c                 :     [        X5      $ ! [         a     gf = f)z6Like LocatePath, but returns None if the user cancels.N)rk   r`   rd   r)   s     r   LocateOptionalPathrn      s$    (00    
 
c                 :     [        X5      $ ! [         a     gf = f)z:Like LocateFileName, but returns None if the user cancels.N)rH   r`   rm   s     r   LocateOptionalFileNamerq      s$    h44 ro   c                    SSK nSSKnUR                  " S5      nU(       a  UR                  S5      nOUR                  R                  S5      /nSnU H1  n[        UR                  R                  US5      5      (       d  M/  Un  O   Uc  U b  [        SU 5      nUc  [        S5      eSn[        5       nU H4  n[        UR                  R                  USU-  5      5      (       d  M2  Un  O   Uc  U b  [        SU-  U 5      nUc  [        S5      eUR                  R                  UR                  R                  US	5      5      n	XU/4$ )
zLocate and validate the core Python directories.  Returns a list
of paths that should be used as the core (ie, un-named) portion of
the Python path.
r   Nr;   r   zos.pyz-The core Python library could not be located.zunicodedata%s.pydz*The core Python path could not be located...)r   r&   r'   r<   r   r(   r   r   rk   r   r$   )
r)   r   r&   currentPathpresearchPathslibPathr   corePathsuffixinstallPaths
             r   LocatePythonCorerz      s:   
 006K$**3/''//#./Gbggll4122G  ;2Wk2CDDHYFbggll4)<v)EFGGH  K31F:KH@AA''//"'',,w"=>K(+++r   c                    SSK nU (       d  [        S5      eUR                  " S5      R                  S5      nU(       d  UnU=(       d    U n [	        XU5      u  pgUb  Xu;   a  SnUR
                  " X75        U$ ! [         a<  n[        SU  SU 35        [        S5        [        S	5        [        S
5         SnAgSnAff = f)aN  Find and Register a package.

Assumes the core registry setup correctly.

In addition, if the location located by the package is already
in the **core** path, then an entry is registered, but no path.
(no other paths are checked, as the application whose path was used
may later be uninstalled.  This should not happen with the core)
r   NzA package name must be suppliedr;   r   z*** The z# package could not be registered - zH*** Please ensure you have passed the correct paths on the command line.zL*** - For packages, you should pass a path to the packages parent directory,z-*** - and not the package directory itself...)r&   r   r'   r<   r,   RegisterNamedPathprint)	r   	knownFiler)   registryAppNamer&   	corePathsr*   pathAddr   s	            r   FindRegisterPackager     s     566..t4::3?I%4O?+KKP#%%o? ?%H	RSV	
 	Z	
 	=>>?s   +A9 9
B?2B::B?c                 *   SSK n[        U[        5      (       a  U/n/ n U H)  n[        XU5      nU(       d  M  UR	                  U5        M+     UR                  " U SR                  U5      5        g! [
         a  n[        SU5         SnAgSnAff = f)zJFind and Register a package.

Assumes the core registry setup correctly.

r   N*** r;   )	r&   
isinstancestrr?   appendr   r}   r|   r   )r=   
knownFilesr)   r&   pathsr~   r*   r   s           r   FindRegisterAppr   @  s     *c"" \
E#I"7{CHxX& $ gsxx7	  fgs   A2 A2 2
B<BBc                 \    SSK n[        XU5      u  pEU(       d  UR                  " X@5        U$ )znFind and Register a Python exe (not necessarily *the* python.exe)

Assumes the core registry setup correctly.
r   N)r&   rQ   RegisterPythonExe)rL   r)   actualFileNamesr&   r   oks         r   FindRegisterPythonExer   X  s+     hEIE!!%2Lr   c                     SS K n [        XU5      nUR                  " XU5        g ! [         a  n[        SU5         S nAg S nAff = f)Nr   r   )r&   r9   r   r}   RegisterHelpFile)r6   r)   r7   r&   r*   r   s         r   FindRegisterHelpFiler   f  sG    K@
 X:	  fgs   & 
AAAc           	          SSK nU  H  nUR                  R                  U5        M      SSKnSSKnSSKnSSKn[        U 5      u  px[        U5        UR                  " SSR                  U5      5        UR                  UR                  " 5       UR                  " 5       5      n	 UR                  U	SUR                  U5        UR!                  U	5        UR                  R#                  UR                  R%                  UR&                  5      S   5      S-   UR                  R#                  UR                  R%                  [)        SUR                  5      5      S   5      -   n
UR                  R                  UR*                  S5      nSUR,                  ;   a  UR                  R                  US5      nUR                  R/                  U5      (       a  UR                  " SU5        gg! UR!                  U	5        f = f)	zSetup the core Python information in the registry.

This function makes no assumptions about the current state of sys.path.

After this function has completed, you should have access to the standard
Python library, and the standard Win32 extensions
r   Nr;   InstallPathzwin32con.py;win32con.pycrB   rA   rC   )rE   r   r   r   r&   r/   r0   rz   r}   r|   r   RegCreateKeyrJ   BuildDefaultPythonKeyRegSetValueREG_SZRegCloseKeyr(   r<   __file__rH   rF   rG   isdir)r)   rE   r   r   r&   r/   r0   ry   r   hKey
win32pathschecks               r   	SetupCorer   r  s      -k:K	)dCHHY$78   !3!3!5w7T7T7VWD#T=(//;OT" 	h&7&78;<
	
''//GGMM.)CSXXNOPQR
	
  GGLLY/E3;;UG,	ww}}U!!)U3 % 	T"s   $G* *G=c                 8   SSK nSSKn[        5       n[        SU-  U 5      nUR                  " SSUR
                  5        UR                  " S[        U5      S-   S5        UR                  " S	S
U-  UR
                  5        [        SU S5        [        SU S5        g)zRegisters key parts of the Python installation with the Windows Shell.

Assumes a valid, minimal Python installation exists
(ie, SetupCore() has been previously successfully run)
r   NzPython%s.exez.pyzPython.FileOpenz "%1" %*z&RunzPython.File\DefaultIconz%s,0z
Python.hlpzMain Python DocumentationzActivePython.chm)	r&   r0   r$   r   SetRegistryDefaultValueHKEY_CLASSES_ROOTRegisterShellCommandrV   r   )r)   r&   r0   rx   exePaths        r   RegisterShellInfor     s     YF#NV$;[IG##E=(:T:TU  )@:)MvV##"FW$4h6P6P {4OP+[:UVr   a  regsetup.py - Setup/maintain the registry for Python apps.

Run without options, (but possibly search paths) to repair a totally broken
python registry setup.  This should allow other options to work.

Usage:   %s [options ...] paths ...
-p packageName  -- Find and register a package.  Looks in the paths for
                   a sub-directory with the name of the package, and
                   adds a path entry for the package.
-a appName      -- Unconditionally add an application name to the path.
                   A new path entry is create with the app name, and the
                   paths specified are added to the registry.
-c              -- Add the specified paths to the core Pythonpath.
                   If a path appears on the core path, and a package also
                   needs that same path, the package will not bother
                   registering it.  Therefore, By adding paths to the
                   core path, you can avoid packages re-registering the same path.
-m filename     -- Find and register the specific file name as a module.
                   Do not include a path on the filename!
--shell         -- Register everything with the Win95/NT shell.
--upackage name -- Unregister the package
--uapp name     -- Unregister the app (identical to --upackage)
--umodule name  -- Unregister the module

--description   -- Print a description of the usage.
--examples      -- Print examples of usage.
a  If no options are processed, the program attempts to validate and set
the standard Python path to the point where the standard library is
available.  This can be handy if you move Python to a new drive/sub-directory,
in which case most of the options would fail (as they need at least string.py,
os.py etc to function.)
Running without options should repair Python well enough to run with
the other options.

paths are search paths that the program will use to seek out a file.
For example, when registering the core Python, you may wish to
provide paths to non-standard places to look for the Python help files,
library files, etc.

See also the "regcheck.py" utility which will check and dump the contents
of the registry.
a  
Examples:
"regsetup c:\weird\spot\1 c:\weird\spot\2"
Attempts to setup the core Python.  Looks in some standard places,
as well as the 2 weird spots to locate the core Python files (eg, Python.exe,
pythonXX.dll, the standard library and Win32 Extensions).

"regsetup -a myappname . .\subdir"
Registers a new Pythonpath entry named myappname, with "C:\I\AM\HERE" and
"C:\I\AM\HERE\subdir" added to the path (ie, all args are converted to
absolute paths)

"regsetup -c c:\my\python\files"
Unconditionally add "c:\my\python\files" to the 'core' Python path.

"regsetup -m some.pyd \windows\system"
Register the module some.pyd in \windows\system as a registered
module.  This will allow some.pyd to be imported, even though the
windows system directory is not (usually!) on the Python Path.

"regsetup --umodule some"
Unregister the module "some".  This means normal import rules then apply
for that module.
__main__r   )z/?z-?z-helpz-h)/-z..\Buildz..\Librs   z..\..z	..\..\libz..\buildrA   z..\..\pcbuild\amd64z..\..\pcbuildz*Attempting to setup/repair the Python corezPyWin32.chmzPythonwin Referencez0Registration complete - checking the registry...zp:a:m:c)shellz	upackage=zuapp=zumodule=descriptionexamplesz--descriptionz
--examplesz--shellzRegistering the Python core.z-pzRegistering package)z
--upackagez--uappz!Unregistering application/packagez-ar;   zRegistering applicationzto pathz-cz3-c option must provide at least one additional pathzRegistering %d new core pathsz+All specified paths are already registered.)N)3	Exceptionr   rE   r   r   r$   r,   r9   r?   rQ   rV   rH   rk   rn   rq   rz   r   r   r   r   r   r   argvusager   r   r   lenr}   r   
searchPathargr   rG   regcheckCheckRegistryr)   getoptoptsargsoar&   UnregisterNamedPathr   r|   r'   r<   currentPathsoldLennewPathr   r   r   <module>r      s  	I 	 TNC0BD4! H
*$ZT$,N"?J80	;24jW6	6 
hhqk7	:&2 z
388}qSXXa[,GGe	SXX!	388A;q>Z#?XXa[
88AB<Cc"  
 	+&)$$(# 	-(+&s{{"67/0:;**%]J8MN@A ]]HHQRLR

d
 Cs# DAqO#k"L hI~45!+.Dy+Q/#At[9,,91=++A.Dyxx,/ItD))!T2Dy" UVV&==dCII#N\**Gl2$++G4  + |$.73|;Lv;UV --dCHH\4JKGHM ] r   