JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrў fc@sdZddlZddlmZddlmZidd6dd6dd 6Zdd d ZddddddddZ ddddZ ddZ dS(uFdistutils.file_util Utility functions for operating on single files. iN(uDistutilsFileError(ulogucopyingu hard linkinguhardusymbolically linkingusymiicNCsd}d}zyt|d}WnAtjk re}ztd||jfWYdd}~XnXtjj|rytj|Wqtjk r}ztd||jfWYdd}~XqXnyt|d}WnAtjk r&}ztd||jfWYdd}~XnXxy|j |}WnAtjk r}ztd||jfWYdd}~XnX|sPny|j |Wq*tjk r}ztd||jfWYdd}~Xq*Xq*Wd|r|j n|r |j nXdS( u5Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files. urbucould not open '%s': %sNucould not delete '%s': %suwbucould not create '%s': %sucould not read from '%s': %sucould not write to '%s': %s( uNoneuopenuosuerroruDistutilsFileErrorustrerrorupathuexistsuunlinkureaduwriteuclose(usrcudstu buffer_sizeufsrcufdstueubuf((u8/opt/alt/python33/lib64/python3.3/distutils/file_util.pyu_copy_file_contentssF ,,))0 u_copy_file_contentsicCsddlm}ddlm} m} m} m} tjj |sWt d|ntjj |r|} tjj |tjj |}ntjj|} |r||| r|dkrtjd|n|dfSyt|}Wn"tk rtd|YnX|dkrytjj |tjj |kr`tjd||| qytjd|||n|r|dfS|d krtjj|otjj||stj||qn|d krtjj|otjj||stj||qnut|||s4|rtj|}|rjtj||| || fn|rtj|| || qn|dfS( uCopy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' is true (the default), the file's mode (type and permission bits, or whatever is analogous on the current platform) is copied. If 'preserve_times' is true (the default), the last-modified and last-access times are copied as well. If 'update' is true, 'src' will only be copied if 'dst' does not exist, or if 'dst' does exist but is older than 'src'. 'link' allows you to make hard links (os.link) or symbolic links (os.symlink) instead of copying: set it to "hard" or "sym"; if it is None (the default), files are copied. Don't set 'link' on systems that don't support it: 'copy_file()' doesn't check if hard or symbolic linking is available. Under Mac OS, uses the native file copy function in macostools; on other systems, uses '_copy_file_contents()' to copy file contents. Return a tuple (dest_name, copied): 'dest_name' is the actual name of the output file, and 'copied' is true if the file was copied (or would have been copied, if 'dry_run' true). i(unewer(uST_ATIMEuST_MTIMEuST_MODEuS_IMODEu4can't copy '%s': doesn't exist or not a regular fileiu"not copying %s (output up-to-date)u&invalid value '%s' for 'link' argumentu %s %s -> %suhardusym(udistutils.dep_utilunewerustatuST_ATIMEuST_MTIMEuST_MODEuS_IMODEuosupathuisfileuDistutilsFileErroruisdirujoinubasenameudirnameulogudebugu _copy_actionuKeyErroru ValueErroruinfouexistsusamefileulinkusymlinku_copy_file_contentsuutimeuchmod(usrcudstu preserve_modeupreserve_timesuupdateulinkuverboseudry_rununeweruST_ATIMEuST_MTIMEuST_MODEuS_IMODEudiruactionust((u8/opt/alt/python33/lib64/python3.3/distutils/file_util.pyu copy_fileCsJ "$    $  ' '  ! u copy_filec(Cs(ddlm}m}m}m}m}ddl} |dkrVtjd||n|r`|S||st d|n||rt j j |||}n%||rt d||fn|||st d||fnd } yt j||Wnet jk rz} zB| \} } | | jkrOd } nt d ||| fWYdd} ~ XnX| r$t||d |yt j|Wq$t jk r } zV| \} } yt j|Wnt jk rYnXt d |||| fWYdd} ~ Xq$Xn|S(u%Move a file 'src' to 'dst'. If 'dst' is a directory, the file will be moved into it with the same name; otherwise, 'src' is just renamed to 'dst'. Return the new full name of the file. Handles cross-device moves on Unix using 'copy_file()'. What about other systems??? i(uexistsuisfileuisdirubasenameudirnameNiumoving %s -> %su#can't move '%s': not a regular fileu0can't move '%s': destination '%s' already existsu2can't move '%s': destination '%s' not a valid pathucouldn't move '%s' to '%s': %suverboseuAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %sFT(uos.pathuexistsuisfileuisdirubasenameudirnameuerrnouloguinfouDistutilsFileErroruosupathujoinuFalseurenameuerroruEXDEVuTrueu copy_fileuunlink(usrcudstuverboseudry_runuexistsuisfileuisdirubasenameudirnameuerrnoucopy_itueunumumsg((u8/opt/alt/python33/lib64/python3.3/distutils/file_util.pyu move_filesR (       ) ,u move_filec CsGt|d}z&x|D]}|j|dqWWd|jXdS(u{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. uwu N(uopenuwriteuclose(ufilenameucontentsufuline((u8/opt/alt/python33/lib64/python3.3/distutils/file_util.pyu write_files  u write_filei@( u__doc__uosudistutils.errorsuDistutilsFileErroru distutilsuloguNoneu _copy_actionu_copy_file_contentsu copy_fileu move_fileu write_file(((u8/opt/alt/python33/lib64/python3.3/distutils/file_util.pyus   3 [=