
    	h1                         S SK r S SKrS SKrS SKrSrSrSrS rS rSS jr	SS jr
S	 rSS
 jrS rS rS rS rS rS rS rS rSS jrSS jrSS jrS rSS jrS rg)    Nz&{b51df050-06ae-11cf-ad3b-524153480001}zPython.FilezPython.CompiledFilec                  (    S[         R                  -   $ )zBuilds a string containing the path to the current registry key.

The Python registry key contains the Python version.  This function
uses the version of the DLL used by the current process to get the
registry key currently in use.
zSoftware\Python\PythonCore\)syswinver     dC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\win32/lib/regutil.pyBuildDefaultPythonKeyr	      s     ,cjj88r   c                      [        5       n  [        R                  " [        R                  U 5      nUR                  5         [        R                  $ ! [        R                   a    [        R                  s $ f = f)z-Retrieves the Registry root in use by Python.)r	   win32api
RegOpenKeywin32conHKEY_CURRENT_USERcloseerrorHKEY_LOCAL_MACHINE)keynameks     r   
GetRootKeyr      s[    #%G+ : :GD		)))>> +***+s   AA $A87A8c                 H    Uc
  [        5       n[        R                  " X5      $ )z?A helper to return the default value for a key in the registry.)r   r   RegQueryValue)subkeyrootkeys     r   GetRegistryDefaultValuer   $   s    ,!!'22r   c                    Uc
  [        5       n[        U[        5      (       a  [        R                  nO5[        U[
        5      (       a  [        R                  nO[        SU< 35      e[        R                  " X X15        g)z;A helper to set the default value for a key in the registryNz-Value must be string or integer - was passed )
r   
isinstancestrr   REG_SZint	REG_DWORD	TypeErrorr   RegSetValue)subKeyvaluer   typeIds       r   SetRegistryDefaultValuer%   +   s_    ,%	E3		##GyQRR&8r   c                      g)Nz3Software\Microsoft\Windows\CurrentVersion\App Pathsr   r   r   r   GetAppPathsKeyr'   9   s    Dr   c                     U(       a  [        S5      eUc  [        R                  R                  U 5      n[        R
                  " [        5       [        5       S-   U-   [        R                  U 5        g)a_  Register a .exe file that uses Python.

Registers the .exe with the OS.  This allows the specified .exe to
be run from the command-line or start button without using the full path,
and also to setup application specific path (ie, os.environ['PATH']).

Currently the exeAppPath is not supported, so this function is general
purpose, and not specific to Python at all.  Later, exeAppPath may provide
a reasonable default that is used.

exeFullPath -- The full path to the .exe
exeAlias = None -- An alias for the exe - if none, the base portion
          of the filename is used.
exeAppPath -- Not supported.
z,Do not support exeAppPath argument currentlyN\)

ValueErrorospathbasenamer   r!   r   r'   r   r   )exeFullPathexeAlias
exeAppPaths      r   RegisterPythonExer1   =   sW    " GHH77##K0n&-8(//;r   c                 \    [         R                  " [        5       [        5       S-   U -   5      $ )zGet a registered .exer)   )r   r   r   r'   )r/   s    r   GetRegisteredExer3   W   s$    !!*,0@40G(0RSSr   c                      [         R                  " [        5       [        5       S-   U -   5        g! [         R                   a)  nSSKnUR
                  UR                  :w  a  e  SnAgSnAff = f)z(Unregister a .exe file that uses Python.r)   r   N)r   RegDeleteKeyr   r'   r   winerrorERROR_FILE_NOT_FOUND)r/   excr6   s      r   UnregisterPythonExer9   \   sU    jlN,<t,Ch,NO>> <<8888   -0 A-A((A-c                     [        5       S-   nU (       a  USU -   -  n[        R                  " [        5       U[        R
                  U5        g)z5Register a named path - ie, a named PythonPath entry.\PythonPathr)   N)r	   r   r!   r   r   r   )namer,   keyStrs      r   RegisterNamedPathr?   h   s:    "$~5F$+vxEr   c                     [        5       S-   U -   n [        R                  " [        5       U5        g! [        R                   a)  nSSKnUR
                  UR                  :w  a  e  SnAgSnAff = f)z7Unregister a named path - ie, a named PythonPath entry.z\PythonPath\r   N)r	   r   r5   r   r   r6   r7   r=   r>   r8   r6   s       r   UnregisterNamedPathrB   p   s[    "$'77$>FjlF3>> <<8888s   2 A/A**A/c                     [        5       S-   nU (       a  USU -   -  n [        R                  " [        5       U5      $ ! [        R                   a)  nSSKnUR
                  UR                  :w  a  e  SnAgSnAff = f)z9Get a registered named path, or None if it doesn't exist.r<   r)   r   N)r	   r   r   r   r   r6   r7   rA   s       r   GetRegisteredNamedPathrD   }   si    "$~5F$+%%jlF;;>> <<8888s   = A:A55A:c                      SSK nUR                  " U5        [        R
                  " [        5       [        5       SU -  -   [        R                  U5        g! [         a    [        SU-  5         NXf = f)a<  Register an explicit module in the registry.  This forces the Python import
mechanism to locate this module directly, without a sys.path search.  Thus
a registered module need not appear in sys.path at all.

modName -- The name of the module, as used by import.
modPath -- The full path and file name of the module.
r   Nz+Warning: Registering non-existant module %s\Modules\%s)
r+   statOSErrorprintr   r!   r   r	   r   r   )modNamemodPathr+   s      r   RegisterModulerL      sg    G
 /G";;	  G;gEFGs   A A10A1c                      [         R                  " [        5       [        5       SU -  -   5        g! [         R                   a)  nSSKnUR
                  UR                  :w  a  e  SnAgSnAff = f)zfUnregister an explicit module in the registry.

modName -- The name of the module, as used by import.
rF   r   N)r   r5   r   r	   r   r6   r7   )rJ   r8   r6   s      r   UnregisterModulerN      s]    
L/1Og4MM	
 >> <<8888 9r:   c                      [        [        5       S-   U -   5      $ ! [        R                   aG     [        [        5       S-   U -   [        R
                  5      s $ ! [        R                   a      gf = ff = f)z1Given a description, return the registered entry.z\Help\N)r   r	   r   r   r   r   )helpDescs    r   GetRegisteredHelpFilerQ      sy    	&'<'>'Kh'VWW>> 	*%'*4x?**  ~~ 		s,    A6'AA6A2.A61A22A6c                 4   Uc  U n[         R                  R                  X5      n U(       a  [         R                  " U5        [        R                  " [        5       [        5       SU-  -   [        R                  U5        g! [         a    [        S5      ef = f)a  Register a help file in the registry.

  Note that this used to support writing to the Windows Help
  key, however this is no longer done, as it seems to be incompatible.

helpFile -- the base name of the help file.
helpPath -- the path to the help file
helpDesc -- A description for the help file.  If None, the helpFile param is used.
bCheckFile -- A flag indicating if the file existence should be checked.
NzHelp file does not exist\Help\%s)r+   r,   joinrG   rH   r*   r   r!   r   r	   r   r   )helpFilehelpPathrP   
bCheckFilefullHelpFiles        r   RegisterHelpFilerY      s     77<<3L5GGL! ,"99	  53445s   B Bc                 f   [         R                  " [        R                  SS[        R                  5      n  [         R
                  " X 5        [         R                  " U5        Uc  U n [         R                  " [        5       [        5       SU-  -   5        g! [         R                   a)  nSSKnUR                  UR                  :w  a  e  SnANSnAff = f! [         R                  " U5        f = f! [         R                   a)  nSSKnUR                  UR                  :w  a  e  SnAgSnAff = f)zUnregister a help file in the registry.

helpFile -- the base name of the help file.
helpDesc -- A description for the help file.  If None, the helpFile param is used.
zSoftware\Microsoft\Windows\Helpr   NrS   )r   r   r   r   KEY_ALL_ACCESSRegDeleteValuer   r6   r7   RegCloseKeyr5   r   r	   )rU   rP   keyr8   r6   s        r   UnregisterHelpFiler_      s     

##,		C	"	##C2 	S! L/1L84KK	
 ~~ 	||x<<< =	 	S! >> <<8888 9sA   B *-C3 C,CC CC C03D0D++D0c                 8   U c%  [         R                  " [        R                  5      n O [        R
                  " U 5        [         R                  " [        5       [        5       5      n [         R                  " US[        R                  U 5        [         R                  " U5        [         R                  " [        5       S[        R                  [        R                  5        g! [         a    [        SU -  5         Nf = f! [         R                  " U5        f = f)zRegisters the core DLL in the registry.

If no params are passed, the name of the Python DLL used in
the current process is used and registered.
Nz-Warning: Registering non-existant core DLL %sDllz)Software\Python\PythonCore\CurrentVersion)r   GetModuleFileNamer   	dllhandler+   rG   rH   rI   RegCreateKeyr   r	   r!   r   r   r]   r   )coredllNamehKeys     r   RegisterCoreDLLrg     s     00?	QGGK    /D/FGD#T5(//;GT"6

	  	QAKOP	Q 	T"s   C# ('D #C>=C>Dc                    [         n[        R                  " [        R                  S[        R
                  U5        [        R                  " [        R                  U[        R
                  S5        [        R                  " [        R                  SU-  [        R
                  [        5        [        R                  " [        R                  SU-  [        R
                  U 5        S[         -  n[        R                  " [        R                  US-   [        R
                  S5        [        R                  " [        R                  US-   [        R
                  U5        [        n[        R                  " [        R                  S	[        R
                  U5        [        R                  " [        R                  U[        R
                  S
5        [        R                  " [        R                  SU-  [        R
                  U5        SU-  n[        R                  " [        R                  US-   [        R
                  S5        [        R                  " [        R                  US-   [        R
                  U5        g)a  Register the core Python file extensions.

defPyIcon -- The default icon to use for .py files, in 'fname,offset' format.
defPycIcon -- The default icon to use for .pyc files, in 'fname,offset' format.
runCommand -- The command line to use for running .py files
z.pyzPython Filez%s\CLSIDz%s\DefaultIcon%s\Shellz\OpenRunz\Open\Commandz.pyczCompiled Python FileN)RegistryIDPyFiler   r!   r   HKEY_CLASSES_ROOTr   CLSIDPyFileRegistryIDPycFile)	defPyIcon
defPycIcon
runCommandpythonFileIdbases        r   RegisterFileExtensionsrt     s    $L""E8??L ""L(//= ""l"	 ""L(	 ))D""D8OX__e ""  	 %L""FHOO\ ""	 ""L(	 %D""D8OX__e ""  	r   c                    S[         -  nU(       a;  [        R                  " [        R                  USU -  -   [        R
                  U5        [        R                  " [        R                  USU -  -   [        R
                  U5        g )Nri   z\%sz\%s\Commandrk   r   r!   r   rl   r   )shellCommand
exeCommandshellUserCommandrs   s       r   RegisterShellCommandrz   b  sp    
 ))D&&6\**OO		
 "",//	r   c                 x   S[         -  n[        R                  " [        R                  USU -  -   [        R
                  U5        [        R                  " [        R                  USU -  -   [        R
                  U5        [        R                  " [        R                  USU -  -   [        R
                  U5        g )Nri   z\%s\ddeexecz\%s\ddeexec\Applicationz\%s\ddeexec\Topicrv   )rw   ddeAppddeTopic
ddeCommandrs   s        r   RegisterDDECommandr   x  s    ))D"",//	 ""+|<<	 ""%66	r   )N)NN)N   )r+   r   r   r   rm   rk   rn   r	   r   r   r%   r'   r1   r3   r9   r?   rB   rD   rL   rN   rQ   rY   r_   rg   rt   rz   r   r   r   r   <module>r      s    	 
   7  ) 9+39E4T
	F
, 8"J:@F,r   