mò ‘ZEc@sãdZdkZydkZdkZWnej odZZnXdklZdZdZ dZ dZ y e Z Wn&e j odfd„ƒYZ nXd „Zd „Zeid ƒZeid ƒZd „Zd„ZdS(s4Win32 utilities. See also twisted.python.shortcut. N(splatformiii{i t WindowsErrorcBstZdZRS(sh Stand-in for sometimes-builtin exception on platforms for which it is missing. (t__name__t __module__t__doc__(((tl/home/radix/Projects/Twisted/branches/releases/twisted-core-2.5.x-2329-2/Twisted.exp/twisted/python/win32.pyRs cCsMtiƒpdSnd}titi|dtiƒ}ti |dƒdS(sžGet the path to the Programs menu. Probably will break on non-US Windows. @returns: the filesystem location of the common Start Menu->Programs. sC:\Windows\Start Menu\Programss@SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell FoldersisCommon ProgramsN( tplatformtisWinNTtkeynametwin32apit RegOpenKeyExtwin32contHKEY_LOCAL_MACHINEtKEY_READt hShellFolderstRegQueryValueEx(RR ((RtgetProgramsMenuPath%s  cCs8d}titi|dtiƒ}ti|dƒdS(s)Get the path to the Program Files folder.s)SOFTWARE\Microsoft\Windows\CurrentVersionitProgramFilesDirN(RRR R R R tcurrentVR(RR((RtgetProgramFilesPath4s  s(\\*)"s(\\+)\ZcCsXd|jpd|jp d|jodpd}|tidtid|ƒƒ|S(s Internal method for quoting a single command-line argument. @param s: an unquoted string that you want to quote so that something that does cmd.exe-style unquoting will interpret it as a single argument, even if it contains spaces. @return: a quoted string. t s t"ts\1\1s\1\1\\"N(tstquotet_cmdLineQuoteRe2tsubt_cmdLineQuoteRe(RR((Rt cmdLineQuote=s 4cCs.dig}|D]}|t|ƒq~ƒS(s^ Quote an iterable of command-line arguments for passing to CreateProcess or a similar API. This allows the list passed to C{reactor.spawnProcess} to match the child process's C{sys.argv} properly. @param arglist: an iterable of C{str}, each unquoted. @return: a single string, with the given sequence quoted as necessary. RN(tjoint_[1]t argumentstaR(RRR((RtquoteArgumentsJs (RtreRR t ImportErrortNonettwisted.python.runtimeRtERROR_FILE_NOT_FOUNDtERROR_PATH_NOT_FOUNDtERROR_INVALID_NAMEtERROR_DIRECTORYRt NameErrorRRtcompileRRRR (RR%RRR(RRR!R&R'R RRR R((Rt?s*