oi1ddlZddlZddlZddlZdZdZdZdZdZddZ ddZ d Z dd Z d Z d Zd ZdZdZdZdZdZddZddZddZdZddZdZdS)Nz&{b51df050-06ae-11cf-ad3b-524153480001}z Python.FilezPython.CompiledFilec dtjzS)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. zSoftware\Python\PythonCore\)syswinverAC:\PYTHON\Scheduler\python\Lib\site-packages\win32/lib/regutil.pyBuildDefaultPythonKeyr s ,cj 88rct} tjtj|}|tjS#tj$rtjcYSwxYw)z-Retrieves the Registry root in use by Python.)r win32api RegOpenKeywin32conHKEY_CURRENT_USERcloseerrorHKEY_LOCAL_MACHINE)keynameks r GetRootKeyrsi#%%G+   :G D D  )) >+++****+s>AA-,A-cL|t}tj||S)z?A helper to return the default value for a key in the registry.)rr RegQueryValue)subkeyrootkeys rGetRegistryDefaultValuer$s#,,  !'6 2 22rc|t}t|tr tj}n4t|t r tj}ntd|tj ||||dS)z;A helper to set the default value for a key in the registryNz-Value must be string or integer - was passed ) r isinstancestrr REG_SZint REG_DWORD TypeErrorr RegSetValue)subKeyvaluertypeIds rSetRegistryDefaultValuer%+s},,%S E3  S#QQQRRR &&%88888rcdS)Nz3Software\Microsoft\Windows\CurrentVersion\App PathsrrrrGetAppPathsKeyr'9s D Drc|rtd|tj|}t jt tdz|ztj |dS)aRegister 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\) ValueErrorospathbasenamer r!rr'r r) exeFullPathexeAlias exeAppPaths rRegisterPythonExer1=su"IGHHH7##K00  n&&-8(/;rchtjttdz|zS)zGet a registered .exer))r rrr')r/s rGetRegisteredExer3Ws)  !*,,0@0@40G(0R S SSrc tjttdz|zdS#tj$r }ddl}|j|jkrYd}~dSd}~wwxYw)z(Unregister a .exe file that uses Python.r)rN)r RegDeleteKeyrr'rwinerrorERROR_FILE_NOT_FOUND)r/excr6s rUnregisterPythonExer9\s~jllN,<, <88 8 8  37A&A!!A&ctdz}|r|d|zz }tjt|tj|dS)z5Register a named path - ie, a named PythonPath entry. \PythonPathr)N)r r r!rr r)namer,keyStrs rRegisterNamedPathr?hsK " $ $~ 5F $+ vxEEEEErctdz|z} tjt|dS#tj$r }ddl}|j|jkrYd}~dSd}~wwxYw)z7Unregister a named path - ie, a named PythonPath entry.z \PythonPath\rN)r r r5rrr6r7r=r>r8r6s rUnregisterNamedPathrBps " $ $'7 7$ >FjllF33333 > <88 8 8  s!9A(A##A(ctdz}|r|d|zz } tjt|S#tj$r }ddl}|j|jkrYd}~dSd}~wwxYw)z9Get a registered named path, or None if it doesn't exist.r<r)rN)r r rrrr6r7rAs rGetRegisteredNamedPathrD}s " $ $~ 5F $+%jllF;;; > <88 8 8 ttttt s >A- A((A-c ddl}|j|n"#t$rtd|zYnwxYwt jt td|zztj |dS)aPRegister 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. rNz+Warning: Registering non-existant module %s \Modules\%s) r+statOSErrorprintr r!rr r r)modNamemodPathr+s rRegisterModulerLsG  GGG ;gEFFFFFG  /G";; s 66c tjttd|zzdS#tj$r }ddl}|j|jkrYd}~dSd}~wwxYw)znUnregister an explicit module in the registry. modName -- The name of the module, as used by import. rFrN)r r5rr rr6r7)rJr8r6s rUnregisterModulerNs  LL/11Og4MM      > <88 8 8  9 8 8 8 8 8r:c ttdz|zS#tj$rG ttdz|ztjcYS#tj$rYnwxYwYnwxYwdS)z1Given a description, return the registered entry.z\Help\N)rr r rr r)helpDescs rGetRegisteredHelpFilerQs &'<'>'>'Kh'VWWW > *%''*4x?*   ~    D  D 4s2 #A9+A!A9!A30A92A33A98A9c6||}tj||} |rtj|n#t$rt dwxYwt jttd|zztj |dS)aRegister 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. NzHelp file does not exist\Help\%s) r+r,joinrGrHr*r r!rr r r)helpFilehelpPathrP bCheckFile fullHelpFiles rRegisterHelpFilerZs7<<(33L5  " GL ! ! ! 55534445  ,"99 s =Actjtjddtj} tj||n1#tj$r}ddl}|j|jkrYd}~nd}~wwxYwtj |n#tj |wxYw||} tj ttd|zzdS#tj$r }ddl}|j|jkrYd}~dSd}~wwxYw)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. zSoftware\Microsoft\Windows\HelprNrT) r r r rKEY_ALL_ACCESSRegDeleteValuerr6r7 RegCloseKeyr5rr )rVrPkeyr8r6s rUnregisterHelpFiler`sa  #,    C "   #C 2 2 2 2~    OOO|x<<<=<<<<  S!!!!S!!!! LL/11L84KK      > <88 8 8  9 8 8 8 8 8sGAB A2A-(B -A22B B (3CD ,DD c |tjtj}n8 t j|n"#t $rtd|zYnwxYwtjtt} tj |dtj |tj|n#tj|wxYwtj tdtj tjdS)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 %sDllz)Software\Python\PythonCore\CurrentVersion)r GetModuleFileNamer dllhandler+rGrHrI RegCreateKeyrr r!r rr^r) coredllNamehKeys rRegisterCoreDLLrhs  0??  Q GK  Q Q Q AKO P P P P P Q  /D/F/F G GD#T5(/;GGGT""""T""""  6 s8AA!B>>Cc&t}tjtjdtj|tjtj|tjdtjtjd|ztjt tjtjd|ztj|dtz}tjtj|dztjdtjtj|dztj|t}tjtjd tj|tjtj|tjd tjtjd|ztj|d|z}tjtj|dztjdtjtj|dztj|d S) aRegister 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\OpenRunz \Open\Commandz.pyczCompiled Python FileN)RegistryIDPyFiler r!r HKEY_CLASSES_ROOTr CLSIDPyFileRegistryIDPycFile) defPyIcon defPycIcon runCommand pythonFileIdbases rRegisterFileExtensionsrus$L "E8?L "L(/= "l"   "L(  ) )D "D8OX_e "    %L "FHO\ "   "L(   %D "D8OX_e "    rcdtz}|r1tjtj|d|zztj|tjtj|d|zztj|dS)Nrjz\%sz \%s\Commandrlr r!r rmr) shellCommand exeCommandshellUserCommandrts rRegisterShellCommandr{bs ) )D   & 6\* * O      " ,// rc@dtz}tjtj|d|zztj|tjtj|d|zztj|tjtj|d|zztj|dS)Nrjz \%s\ddeexecz\%s\ddeexec\Applicationz\%s\ddeexec\Topicrw)rxddeAppddeTopic ddeCommandrts rRegisterDDECommandrxs ) )D " ,//   " +|<<   " %66 r)N)NN)NrR)r+rr r rnrlror rrr%r'r1r3r9r?rBrDrLrNrQrZr`rhrur{rrrrrs 7  )999+++3333 9 9 9 9EEE4TTT   FFF      ,      8""""J:@@@F,r