fۇc@@s dZddlZddlZddlZejZddddddd d d d d ddddddddgZddZddZ dekrdZ dZ ddl Ty!ddl m Z ejdWnek rYnXddlZyddl mZWqsek rYqsXnYd ekrd Z d!Z ddlTy!ddlm Z ejdWnek rqYnXddlZddlZeje e[yddlmZWqsek rYqsXnd"ekrd"Z d!Z ddlTy!ddlm Z ejdWnek r#YnXejjd#dkrKddlZnddlZdd%lmZddlZeje e[yddlmZWqsek rYqsXnd&ekrgd&Z d!Z ddlTy!ddlm Z ejdWnek r YnXddlZddlZeje e[yddlmZWqsek rcYqsXn ed'eejd(e)d?d@e)dAdBe)dCdDe)dEdFe)dGdHe)dGdIe)dJd6e+Z,e*Z+e)d-d.e+Z-e*Z+e)dKdLe)dMd0e)dNd2e)dOdPe)dQdRe+j.ee)dSdTe)dUd6e)dVd6e)dWdXedYredZre)d[dYne+Z/e*Z+e)d-d.e)d1d2e)d3d4e)d\d]e)d^d0ed_re)d`d2ne)d7d8e)dad6e)dbd4e)d3d4e)dJd6e)dcd4e+Z0[+[[([)ndZ1d$Z2ddZ3deddfdgZ5dhdiZ6djdkZ7ejdgdidkgddddldmZ:ejdme;ehe,kr0e<ehe/kr0dnddoddpdddqdrZ=dsdtZ>ejdrnye?Wne@k rRiZ?YnXdudvZAdwdxZBdydzZCd{d|ZDd}d~ZEddZFejdvdxdzd|d~dgdddZGdddZHddlImJZJGdddeJZKy eLZMWne@k r(ddZMYnXejdy eNZOWne@k r`ddZOYnXejdddZPePZ?[PdddZQe dkZRejdeRr ddZSeKe?jTeSeUeSeUeMeOZV[SdddZWejdnddZXeX\ZYZZ[Xedr ed r edr dZ[d$Z\Z]ejdddgddZ^ddZ_ddZ`ddZaddZbnedr ddZcddZdejddddgnedr+ ddZeddZfejddddgnddlgZhddZiddZjyehjkelejeiWne@k rz YnXddZmddZnyehjkeoenemWne@k r YnXddddZpGdddZqddZrdS(utOS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix', 'nt', 'os2' or 'ce'. - os.curdir is a string representing the current directory ('.' or ':') - os.pardir is a string representing the parent directory ('..' or '::') - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\') - os.extsep is the extension separator (always '.') - os.altsep is the alternate pathname separator (None or '/') - os.pathsep is the component separator used in $PATH etc - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n') - os.defpath is the default search path for executables - os.devnull is the file path of the null device ('/dev/null', etc.) Programs that import and use 'os' stand a better chance of being portable between different platforms. Of course, they must then only use functions that are defined by all platforms (e.g., unlink and opendir), and leave all pathname manipulation to os.path (e.g., split and join). iNualtsepucurdirupardirusepupathsepulinesepudefpathunameupathudevnulluSEEK_SETuSEEK_CURuSEEK_ENDufsencodeufsdecodeu get_exec_pathufdopenupopenuextsepcCs |tkS(N(uglobals(uname((u'/opt/alt/python33/lib64/python3.3/os.pyu_exists%su_existsc CsAyt|jSWn)tk r<ddt|DSYnXdS(NcSs&g|]}|ddkr|qS(iu_((u.0un((u'/opt/alt/python33/lib64/python3.3/os.pyu ,s u%_get_exports_list..(ulistu__all__uAttributeErrorudir(umodule((u'/opt/alt/python33/lib64/python3.3/os.pyu_get_exports_list(s u_get_exports_listuposixu (u*(u_exitu_exit(u_have_functionsuntu uos2uEMX GCCi(ulinkuceuno os specific module founduos.path(ucurdirupardirusepupathsepudefpathuextsepualtsepudevnullu_have_functionscCs0|tkr,|tkr,tjt|ndS(N(u_globalsu_have_functionsu_setuadd(ustrufn((u'/opt/alt/python33/lib64/python3.3/os.pyu_addsu_adduHAVE_FACCESSATuaccessu HAVE_FCHMODATuchmodu HAVE_FCHOWNATuchownu HAVE_FSTATATustatuHAVE_FUTIMESATuutimeu HAVE_LINKATulinku HAVE_MKDIRATumkdiru HAVE_MKFIFOATumkfifou HAVE_MKNODATumknodu HAVE_OPENATuopenuHAVE_READLINKATureadlinku HAVE_RENAMEATurenameuHAVE_SYMLINKATusymlinku HAVE_UNLINKATuunlinkurmdiruHAVE_UTIMENSATu HAVE_FCHDIRuchdiru HAVE_FCHMODu HAVE_FCHOWNuHAVE_FDOPENDIRulistdiru HAVE_FEXECVEuexecveuHAVE_FTRUNCATEutruncateu HAVE_FUTIMENSu HAVE_FUTIMESuHAVE_FPATHCONFupathconfustatvfsufstatvfsu HAVE_FSTATVFSu HAVE_LCHFLAGSuchflagsu HAVE_LCHMODulchownu HAVE_LCHOWNu HAVE_LUTIMESu HAVE_LSTATu MS_WINDOWSiic CsItj|\}}|s3tj|\}}n|r|rtj| ryt|||Wn=tk r}z|jtjkrnWYdd}~XnXt}t|t rt td}n||krdSnyt ||WnTtk rD}z4| s,|jtjks,tj | r2nWYdd}~XnXdS(umakedirs(path [, mode=0o777][, exist_ok=False]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. If the target directory already exists, raise an OSError if exist_ok is False. Otherwise no exception is raised. This is recursive. NuASCII( upathusplituexistsumakedirsuOSErroruerrnouEEXISTucurdiru isinstanceubytesumkdiruisdir(unameumodeuexist_okuheadutailueucdir((u'/opt/alt/python33/lib64/python3.3/os.pyumakedirss&  )umakedirsc Cst|tj|\}}|s=tj|\}}nxI|r|ryt|Wntk roPYnXtj|\}}q@WdS(uremovedirs(path) Super-rmdir; remove a leaf directory and all empty intermediate ones. Works like rmdir except that, if the leaf directory is successfully removed, directories corresponding to rightmost path segments will be pruned away until either the whole path is consumed or an error occurs. Errors during this latter phase are ignored -- they generally mean that a directory was not empty. N(urmdirupathusplituerror(unameuheadutail((u'/opt/alt/python33/lib64/python3.3/os.pyu removedirs s  u removedirscCstj|\}}|r>|r>tj| r>t|nt||tj|\}}|r|ryt|Wqtk rYqXndS(u@renames(old, new) Super-rename; create directories as necessary and delete any left empty. Works like rename, except creation of any intermediate directories needed to make the new pathname good is attempted first. After the rename, directories corresponding to rightmost path segments of the old name will be pruned way until either the whole path is consumed or a nonempty directory is found. Note: this function can fail with the new directory structure made if you lack permissions needed to unlink the leaf directory or file. N(upathusplituexistsumakedirsurenameu removedirsuerror(uoldunewuheadutail((u'/opt/alt/python33/lib64/python3.3/os.pyurenames!s    urenamesc csBtjtjtj}}}yt|}WnBtk rq}z"|dk r[||ndSWYdd}~XnXgg} } x@|D]8} |||| r| j| q| j| qW|r|| | fVnxK| D]C} ||| } |s||  rt| |||DdHqqW|s>|| | fVndS(uM Directory tree generator. For each directory in the directory tree rooted at top (including top itself, but excluding '.' and '..'), yields a 3-tuple dirpath, dirnames, filenames dirpath is a string, the path to the directory. dirnames is a list of the names of the subdirectories in dirpath (excluding '.' and '..'). filenames is a list of the names of the non-directory files in dirpath. Note that the names in the lists are just names, with no path components. To get a full path (which begins with top) to a file or directory in dirpath, do os.path.join(dirpath, name). If optional arg 'topdown' is true or not specified, the triple for a directory is generated before the triples for any of its subdirectories (directories are generated top down). If topdown is false, the triple for a directory is generated after the triples for all of its subdirectories (directories are generated bottom up). When topdown is true, the caller can modify the dirnames list in-place (e.g., via del or slice assignment), and walk will only recurse into the subdirectories whose names remain in dirnames; this can be used to prune the search, or to impose a specific order of visiting. Modifying dirnames when topdown is false is ineffective, since the directories in dirnames have already been generated by the time dirnames itself is generated. By default errors from the os.listdir() call are ignored. If optional arg 'onerror' is specified, it should be a function; it will be called with one argument, an os.error instance. It can report the error to continue with the walk, or raise the exception to abort the walk. Note that the filename is available as the filename attribute of the exception object. By default, os.walk does not follow symbolic links to subdirectories on systems that support them. In order to get this functionality, set the optional argument 'followlinks' to true. Caution: if you pass a relative pathname for top, don't change the current working directory between resumptions of walk. walk never changes the current directory, and assumes that the client doesn't either. Example: import os from os.path import join, getsize for root, dirs, files in os.walk('python/Lib/email'): print(root, "consumes", end="") print(sum([getsize(join(root, name)) for name in files]), end="") print("bytes in", len(files), "non-directory files") if 'CVS' in dirs: dirs.remove('CVS') # don't visit CVS directories N( upathuislinkujoinuisdirulistdiruerroruNoneuappenduwalk( utoputopdownuonerroru followlinksuislinkujoinuisdirunamesuerrudirsunondirsunameunew_path((u'/opt/alt/python33/lib64/python3.3/os.pyuwalk=s(9     uwalkufollow_symlinksudir_fdu.ccst|ddd|}t|td|}zR|s`tj|jr~tj|t|r~t |||||DdHnWdt |XdS(uDirectory tree generator. This behaves exactly like walk(), except that it yields a 4-tuple dirpath, dirnames, filenames, dirfd `dirpath`, `dirnames` and `filenames` are identical to walk() output, and `dirfd` is a file descriptor referring to the directory `dirpath`. The advantage of fwalk() over walk() is that it's safe against symlink races (when follow_symlinks is False). If dir_fd is not None, it should be a file descriptor open to a directory, and top should be relative; top will then be relative to that directory. (dir_fd is always supported for fwalk.) Caution: Since fwalk() yields file descriptors, those are only valid until the next iteration step, so you should dup() them if you want to keep them for a longer period. Example: import os for root, dirs, files, rootfd in os.fwalk('python/Lib/email'): print(root, "consumes", end="") print(sum([os.stat(name, dir_fd=rootfd).st_size for name in files]), end="") print("bytes in", len(files), "non-directory files") if 'CVS' in dirs: dirs.remove('CVS') # don't visit CVS directories ufollow_symlinksudir_fdNF( ustatuFalseuopenuO_RDONLYustuS_ISDIRust_modeupathusamestatu_fwalkuclose(utoputopdownuonerrorufollow_symlinksudir_fduorig_stutopfd((u'/opt/alt/python33/lib64/python3.3/os.pyufwalks#"ufwalkc cst|}gg}}x|D]}y?tjt|d|jrW|j|n |j|Wq tk ry8tjt|d|ddjr|j|nWntk rw YnXYq Xq W|r||||fVnx|D]}y1t|d|d|} t |t d|} WnBt k rj} z"|dk rT|| ndSWYdd} ~ XnXzR|st j| t| rt j||} t| | |||DdHnWdt| XqW|s||||fVndS(Nudir_fdufollow_symlinksF(ulistdirustuS_ISDIRustatust_modeuappenduFileNotFoundErroruS_ISLNKuFalseuopenuO_RDONLYuerroruNoneupathusamestatujoinu_fwalkuclose( utopfdutoppathutopdownuonerrorufollow_symlinksunamesudirsunondirsunameuorig_studirfduerrudirpath((u'/opt/alt/python33/lib64/python3.3/os.pyu_fwalks<    $    "u_fwalkcGst||dS(upexecl(file, *args) Execute the executable file with argument list args, replacing the current process. N(uexecv(ufileuargs((u'/opt/alt/python33/lib64/python3.3/os.pyuexeclsuexeclcGs(|d}t||dd|dS(uexecle(file, *args, env) Execute the executable file with argument list args and environment env, replacing the current process. iNii(uexecve(ufileuargsuenv((u'/opt/alt/python33/lib64/python3.3/os.pyuexecles uexeclecGst||dS(uexeclp(file, *args) Execute the executable file (which is searched for along $PATH) with argument list args, replacing the current process. N(uexecvp(ufileuargs((u'/opt/alt/python33/lib64/python3.3/os.pyuexeclp suexeclpcGs(|d}t||dd|dS(uexeclpe(file, *args, env) Execute the executable file (which is searched for along $PATH) with argument list args and environment env, replacing the current process. iNii(uexecvpe(ufileuargsuenv((u'/opt/alt/python33/lib64/python3.3/os.pyuexeclpes uexeclpecCst||dS(uexecvp(file, args) Execute the executable file (which is searched for along $PATH) with argument list args, replacing the current process. args may be a list or tuple of strings. N(u_execvpe(ufileuargs((u'/opt/alt/python33/lib64/python3.3/os.pyuexecvpsuexecvpcCst|||dS(uexecvpe(file, args, env) Execute the executable file (which is searched for along $PATH) with argument list args and environment env , replacing the current process. args may be a list or tuple of strings. N(u_execvpe(ufileuargsuenv((u'/opt/alt/python33/lib64/python3.3/os.pyuexecvpe$suexecvpecCs|dk r!t}||f}nt}|f}t}tj|\}}|rb|||dSd}}d} t|} tdkrt|}t t| } nx| D]} tj | |} y|| |Wqt k rT} zZ| }t j d}| jtjkrB| jtjkrB|dkrB| }|} nWYdd} ~ XqXqW|rq|j| n|j|dS(Nunti(uNoneuexecveuexecvuenvironupathusplitu get_exec_pathunameufsencodeumapujoinuerrorusysuexc_infouerrnouENOENTuENOTDIRuwith_traceback(ufileuargsuenvu exec_funcuargrestuheadutailulast_excu saved_excusaved_tbu path_listudirufullnameueutb((u'/opt/alt/python33/lib64/python3.3/os.pyu_execvpe/s<        $  u_execvpecCsddl}|dkr!t}n|j|jdty|jd}Wntk rkd}YnXtry|d}Wnt tfk rYn"X|dk rt dn|}|dk rt |t rt |}qnWdQX|dkrt}n|jtS(uReturns the sequence of directories that will be searched for the named executable (similar to a shell) when launching a process. *env* must be an environment variable dict or None. If *env* is None, os.environ will be used. iNuignoreuPATHsPATHu*env cannot contain 'PATH' and b'PATH' keys(uwarningsuNoneuenvironucatch_warningsu simplefilteru BytesWarningugetu TypeErrorusupports_bytes_environuKeyErroru ValueErroru isinstanceubytesufsdecodeudefpathusplitupathsep(uenvuwarningsu path_listu path_listb((u'/opt/alt/python33/lib64/python3.3/os.pyu get_exec_pathRs.          (uMutableMappingcBs|EeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS(u_EnvironcCsC||_||_||_||_||_||_||_dS(N(u encodekeyu decodekeyu encodevalueu decodevalueuputenvuunsetenvu_data(uselfudatau encodekeyu decodekeyu encodevalueu decodevalueuputenvuunsetenv((u'/opt/alt/python33/lib64/python3.3/os.pyu__init__s      u_Environ.__init__c CsKy|j|j|}Wn!tk r=t|dYnX|j|S(N(u_datau encodekeyuKeyErroruNoneu decodevalue(uselfukeyuvalue((u'/opt/alt/python33/lib64/python3.3/os.pyu __getitem__s  u_Environ.__getitem__cCs?|j|}|j|}|j||||j|su$_Environ.__repr__..(uformatujoinu_datauitems(uself((uselfu'/opt/alt/python33/lib64/python3.3/os.pyu__repr__s u_Environ.__repr__cCs t|S(N(udict(uself((u'/opt/alt/python33/lib64/python3.3/os.pyucopysu _Environ.copycCs!||kr|||suuputenvcCs t|dS(Nu(u_putenv(ukey((u'/opt/alt/python33/lib64/python3.3/os.pyusuunsetenvcstd krldd}|t}fdd}i}xitjD]\}}||||.check_strcs|jS(N(uupper(ukey(uencode(u'/opt/alt/python33/lib64/python3.3/os.pyu encodekeysu!_createenviron..encodekeycs;t|ts+tdt|jn|jdS(Nustr expected, not %susurrogateescape(u isinstanceustru TypeErrorutypeu__name__uencode(uvalue(uencoding(u'/opt/alt/python33/lib64/python3.3/os.pyuencodesu_createenviron..encodecs|jdS(Nusurrogateescape(udecode(uvalue(uencoding(u'/opt/alt/python33/lib64/python3.3/os.pyudecodesu_createenviron..decode(uos2unt( unameustruenvironuitemsusysugetfilesystemencodingu_Environu_putenvu _unsetenv(u check_strudecodeu encodekeyudataukeyuvalue((uencodeuencodingu'/opt/alt/python33/lib64/python3.3/os.pyu_createenvirons"   u_createenvironcCstj||S(uGet an environment variable, return None if it doesn't exist. The optional second argument can specify an alternate default. key, default and the result are str.(uenvironuget(ukeyudefault((u'/opt/alt/python33/lib64/python3.3/os.pyugetenvsugetenvusupports_bytes_environcCs/t|ts+tdt|jn|S(Nubytes expected, not %s(u isinstanceubytesu TypeErrorutypeu__name__(uvalue((u'/opt/alt/python33/lib64/python3.3/os.pyu _check_bytessu _check_bytescCstj||S(uGet an environment variable, return None if it doesn't exist. The optional second argument can specify an alternate default. key, default and the result are bytes.(uenvironbuget(ukeyudefault((u'/opt/alt/python33/lib64/python3.3/os.pyugetenvbsugetenvbuenvironbcs[tjdkr!dndfdd}fdd}||fS(NumbcsustrictusurrogateescapecsOt|tr|St|tr2|jStdt|jdS(u Encode filename to the filesystem encoding with 'surrogateescape' error handler, return bytes unchanged. On Windows, use 'strict' error handler if the file system encoding is 'mbcs' (which is the default encoding). uexpect bytes or str, not %sN(u isinstanceubytesustruencodeu TypeErrorutypeu__name__(ufilename(uencodinguerrors(u'/opt/alt/python33/lib64/python3.3/os.pyufsencode s u_fscodec..fsencodecsOt|tr|St|tr2|jStdt|jdS(u Decode filename from the filesystem encoding with 'surrogateescape' error handler, return str unchanged. On Windows, use 'strict' error handler if the file system encoding is 'mbcs' (which is the default encoding). uexpect bytes or str, not %sN(u isinstanceustrubytesudecodeu TypeErrorutypeu__name__(ufilename(uencodinguerrors(u'/opt/alt/python33/lib64/python3.3/os.pyufsdecodes u_fscodec..fsdecode(usysugetfilesystemencoding(ufsencodeufsdecode((uencodinguerrorsu'/opt/alt/python33/lib64/python3.3/os.pyu_fscodecs     u_fscodecuforkuspawnvuexecvuP_WAITuP_NOWAITu P_NOWAITOc Cst}|sWy0|dkr.|||n||||WqtdYqXnv|tkrg|Sxct|d\}}t|rqjqjt|rt| St|rt |St dqjdS(Niiu"Not stopped, signaled or exited???( uforkuNoneu_exituP_NOWAITuwaitpidu WIFSTOPPEDu WIFSIGNALEDuWTERMSIGu WIFEXITEDu WEXITSTATUSuerror(umodeufileuargsuenvufuncupiduwpidusts((u'/opt/alt/python33/lib64/python3.3/os.pyu _spawnvef7s&        u _spawnvefcCst|||dtS(uspawnv(mode, file, args) -> integer Execute file with arguments from args in a subprocess. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. N(u _spawnvefuNoneuexecv(umodeufileuargs((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnvRscCst||||tS(u:spawnve(mode, file, args, env) -> integer Execute file with arguments from args in a subprocess with the specified environment. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. (u _spawnvefuexecve(umodeufileuargsuenv((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnve[suspawnvecCst|||dtS(u8spawnvp(mode, file, args) -> integer Execute file (which is looked for along $PATH) with arguments from args in a subprocess. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. N(u _spawnvefuNoneuexecvp(umodeufileuargs((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnvpgsuspawnvpcCst||||tS(u\spawnvpe(mode, file, args, env) -> integer Execute file (which is looked for along $PATH) with arguments from args in a subprocess with the supplied environment. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. (u _spawnvefuexecvpe(umodeufileuargsuenv((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnvpeqsuspawnvpecGst|||S(uspawnl(mode, file, *args) -> integer Execute file with arguments from args in a subprocess. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. (uspawnv(umodeufileuargs((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnlsuspawnlcGs'|d}t|||dd|S(u:spawnle(mode, file, *args, env) -> integer Execute file with arguments from args in a subprocess with the supplied environment. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. iNii(uspawnve(umodeufileuargsuenv((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnles uspawnlecGst|||S(uWspawnlp(mode, file, *args) -> integer Execute file (which is looked for along $PATH) with arguments from args in a subprocess with the supplied environment. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. (uspawnvp(umodeufileuargs((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnlpsuspawnlpcGs'|d}t|||dd|S(u]spawnlpe(mode, file, *args, env) -> integer Execute file (which is looked for along $PATH) with arguments from args in a subprocess with the supplied environment. If mode == P_NOWAIT return the pid of the process. If mode == P_WAIT return the process's exit code if it exits normally; otherwise return -SIG, where SIG is the signal that killed it. iNii(uspawnvpe(umodeufileuargsuenv((u'/opt/alt/python33/lib64/python3.3/os.pyuspawnlpes uspawnlpecCs t||S(N(u stat_result(utupudict((u'/opt/alt/python33/lib64/python3.3/os.pyu_make_stat_resultsu_make_stat_resultcCs|j\}}t|fS(N(u __reduce__u_make_stat_result(usrutypeuargs((u'/opt/alt/python33/lib64/python3.3/os.pyu_pickle_stat_resultsu_pickle_stat_resultcCs t||S(N(ustatvfs_result(utupudict((u'/opt/alt/python33/lib64/python3.3/os.pyu_make_statvfs_resultsu_make_statvfs_resultcCs|j\}}t|fS(N(u __reduce__u_make_statvfs_result(usrutypeuargs((u'/opt/alt/python33/lib64/python3.3/os.pyu_pickle_statvfs_resultsu_pickle_statvfs_resulturc Cst|ts(tdt|n|d krGtd|n|dks_|dkrntdnddl}ddl}|dkr|j|dd d|j d |}t |j |j |S|j|dd d |j d |}t |j |j|SdS( Nu&invalid cmd type (%s, expected string)uruwuinvalid mode %riu+popen() does not support unbuffered streamsushellustdoutubufsizeustdin(uruwT(u isinstanceustru TypeErrorutypeu ValueErroruNoneu subprocessuiouPopenuTrueuPIPEu _wrap_closeu TextIOWrapperustdoutustdin(ucmdumodeu bufferingu subprocessuiouproc((u'/opt/alt/python33/lib64/python3.3/os.pyupopens$        cBs\|EeZdZddZddZddZddZd d Zd d Zd S(u _wrap_closecCs||_||_dS(N(u_streamu_proc(uselfustreamuproc((u'/opt/alt/python33/lib64/python3.3/os.pyu__init__s u_wrap_close.__init__cCsH|jj|jj}|dkr,dStdkr<|S|d>SdS(Niunti(u_streamucloseu_procuwaituNoneuname(uselfu returncode((u'/opt/alt/python33/lib64/python3.3/os.pyucloses   u_wrap_close.closecCs|S(N((uself((u'/opt/alt/python33/lib64/python3.3/os.pyu __enter__su_wrap_close.__enter__cGs|jdS(N(uclose(uselfuargs((u'/opt/alt/python33/lib64/python3.3/os.pyu__exit__su_wrap_close.__exit__cCst|j|S(N(ugetattru_stream(uselfuname((u'/opt/alt/python33/lib64/python3.3/os.pyu __getattr__su_wrap_close.__getattr__cCs t|jS(N(uiteru_stream(uself((u'/opt/alt/python33/lib64/python3.3/os.pyu__iter__su_wrap_close.__iter__N( u__name__u __module__u __qualname__u__init__ucloseu __enter__u__exit__u __getattr__u__iter__(u __locals__((u'/opt/alt/python33/lib64/python3.3/os.pyu _wrap_closes     u _wrap_closecOsGt|ts(tdt|nddl}|j|||S(Nu&invalid fd type (%s, expected integer)i(u isinstanceuintu TypeErrorutypeuiouopen(ufduargsukwargsuio((u'/opt/alt/python33/lib64/python3.3/os.pyufdopens iFT(uos2unt(ugetenvusupports_bytes_environ(uenvironbugetenvbi(su__doc__usysuerrnoustatustubuiltin_module_namesu_namesu__all__u_existsu_get_exports_listunameulinesepuposixu_exituappendu ImportErroru posixpathupathu_have_functionsuntuntpathuextenduos2uversionufindu os2emxpathu _emx_linkulinkuceumodulesuos.pathucurdirupardirusepupathsepudefpathuextsepualtsepudevnulluglobalsu_globalsu_addusetu_setusupports_dir_fdusupports_effective_idsuaddu supports_fdusupports_follow_symlinksuSEEK_SETuSEEK_CURuSEEK_ENDuFalseumakedirsu removedirsurenamesuTrueuNoneuwalkuopenulistdirufwalku_fwalkuenvironu NameErroruexecluexecleuexeclpuexeclpeuexecvpuexecvpeu_execvpeu get_exec_pathucollections.abcuMutableMappingu_Environuputenvu_putenvuunsetenvu _unsetenvu_createenvironugetenvusupports_bytes_environu _check_bytesu_dataubytesuenvironbugetenvbu_fscodecufsencodeufsdecodeuP_WAITuP_NOWAITu P_NOWAITOu _spawnvefuspawnvuspawnveuspawnvpuspawnvpeuspawnluspawnleuspawnlpuspawnlpeucopyregu_copyregu_make_stat_resultu_pickle_stat_resultupickleu stat_resultu_make_statvfs_resultu_pickle_statvfs_resultustatvfs_resultupopenu _wrap_closeufdopen(((u'/opt/alt/python33/lib64/python3.3/os.pyus                              :                                                Y $!, /       #-5              #%