B { `@sfdZddlZddlZddlZddZddZddZd d Zd d Zd dZ e dkrbeej ddS)z9 Functions for converting from DOS to UNIX line endings Nc Cstj|rt|ddSt|d}|}WdQRXd|krNt|ddStdd|}||krtd|t|d }||WdQRX|St|d dS) zFReplace CRLF with LF in argument files. Print names of changed files.z Directory!NrbzBinary!z  z dos2unix:wbok) ospathisdirprintopenreadresubwrite)filefpdatanewdatafr@/tmp/pip-unpacked-wheel-4iou4664/numpy/distutils/line_endings.pydos2unix s      rcCs:x4|D],}tj||}t|}|dk r||qWdS)N)rrjoinrappend)modified_filesdir_name file_namesr full_pathrrrdos2unix_one_dirs  rcCsg}tj|t||S)N)rrwalkr)rrrrr dos2unix_dir%sr c Cstj|rt|ddSt|d}|}WdQRXd|krNt|ddStdd|}tdd|}||krtd|t|d }||WdQRX|St|d dS) zFReplace LF with CRLF in argument files. Print names of changed files.z Directory!NrrzBinary!z rz unix2dos:rr) rrr r r r r rr)rrrrrrrrunix2dos+s       r!cCs:x4|D],}tj||}t||dk r||qWdS)N)rrrr!r)rrrrrrrrunix2dos_one_dir@s  r"cCsg}tj|t||S)N)rrrr")rrrrr unix2dos_dirGsr#__main__) __doc__rr sysrrr r!r"r#__name__argvrrrrs