Advertisement
BugFix

Untitled

Jan 3rd, 2014
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.98 KB | None | 0 0
  1. ; == CallPyHelp.au3
  2.  
  3. #Region - TimeStamp
  4. ; 2014-01-03 14:35:29
  5. #EndRegion - TimeStamp
  6.  
  7. #include <File.au3>
  8.  
  9. ;~ mk:@MSITStore:C:\Python27\Doc\python274.chm::/genindex.html#
  10. ;~ mk:@MSITStore:C:\Python27\Doc\python274.chm::/genindex-O.html
  11.  
  12. Global $sPathPy = _GetPythonPath()
  13.  
  14. Global $sFileHelp, $aFiles = _FileListToArray($sPathPy & '\doc', '*.chm', 1, True)
  15. ConsoleWrite(@error & @LF)
  16. For $i = 1 To $aFiles[0]
  17.     If StringInStr(StringLower($aFiles[$i]), 'python') Then
  18.         $sFileHelp = $aFiles[$i]
  19.         ExitLoop
  20.     EndIf
  21. Next
  22. Global $sHelpBase = " mk:@MSITStore:" & $sFileHelp & "::/genindex"
  23. Global $sCall = ".html#"
  24.  
  25. If $CmdLine[0] Then
  26.     $FirstChar = StringUpper(StringLeft($CmdLine[1], 1))
  27.     $sCall = "-" & $FirstChar & ".html"
  28. EndIf
  29. ShellExecute("hh.exe", $sHelpBase & $sCall)
  30.  
  31.  
  32. Func _GetPythonPath()
  33.     Local $PyExe = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe", "")
  34.     If @error Then Return ""
  35.     Return StringLeft($PyExe, StringInStr($PyExe, '\', 1, -1) -1)
  36. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement