@@ -0,0 +1,1688 @@
+#coding=utf-8  %0A%0Aimport os%0Aimport os.path%0Aimport shutil%0Aimport sys%0Aimport getopt%0Aimport string  %0Aimport fnmatch%0Aimport md5%0Aimport hashlib%0Aimport zipfile%0Aimport time%0Aimport threading%0Aimport struct%0Afrom pprint import pprint %0Afrom struct import *%0A%0Adef iter_find_files(path, fnexp):%0A    for root, dirs, files, in os.walk(path):%0A        for filename in fnmatch.filter(files, fnexp):%0A            yield os.path.join(root, filename)%0A%0Adef work_file(filepath):%0A    filepath = os.path.realpath(filepath)%0A%0A    with open(filepath, 'rb') as tmpFile:%0A        tmpContent = tmpFile.read(3)%0A        if tmpContent%5B0%5D == '%5Cx1f' and tmpContent%5B1%5D == '%5Cx8b':%0A            print %22Gzip File, pass.%22%0A            return%0A    %0A    gzip_cmd = %22gzip %22 + filepath + %22 -n -f -9%22%0A    os.system(gzip_cmd)%0A    %0A    if os.path.exists(filepath):%0A        os.remove(filepath)%0A    %0A    if os.path.exists(filepath + %22.gz%22):%0A        os.rename(filepath + %22.gz%22, filepath) %0A    pass%0A    %0Adef work_async(tardir):%0A    for filename in iter_find_files(tardir, %22*.*%22):%0A        if filename.find(%22.map%22) != -1:%0A            work_file(filename)%0A            pass             %0A            %0Adef work():   %0A    if len(sys.argv) %3E 1:%0A        inputFile = sys.argv%5B1%5D%0A        for i in range(1, len(sys.argv)):%0A            filepath = os.path.realpath(sys.argv%5Bi%5D)%0A            if os.path.isdir(filepath):%0A                work_async(filepath)%0A            else:%0A                work_file(filepath)%0A    else:%0A        curdir = r%22E:%5CWorkspace%5CMobilephone_DDT%5Ctrunk%5CClient%5CDevelop%5CResource_JPG%22%0A        work_async(curdir)    %0A    os.system(%22pause%22)%0A    %0Aif __name__ == '__main__': %0A    try:%0A        work()%0A    except Exception, e:%0A        print Exception, e

add tools for retools