출처 : http://ppiazi.springnote.com/pages/973536

 

import os
import sys
import time

AUTOBUILD_PATH = "D:\\dev-util\\autobuild\\"
SVN_ROOT = ["C:\\EWC_OFP_DEV\\", ]
WWW_PATH = "C:\\wamp\\www\\autobuild\\ewc\\"
TODAY = time.strftime("%Y_%m_%d", time.localtime(time.time()))
BATCH_FILES = {"auto_build_ewc_tor.bat":"gcc", "auto_build_ewc_vis.bat":"cl"}
TOR_REPORT_FILE = "REPORT_%s_%s.txt"
VIS_REPORT_FILE = "REPORT_%s_%s.txt"

def start_build():
    print "Update all source"
    # updatine all source tree
    for svn_root in SVN_ROOT:
        os.chdir(svn_root)
        os.system("svn update")

    for batch_file in BATCH_FILES.keys():
        f = os.popen(batch_file)
        compiler_type = BATCH_FILES.get(batch_file)
        print "AutoBuild : %s (%s)"%(batch_file, compiler_type)
        if compiler_type == "gcc":
            capture_output_gcc(f)
        elif compiler_type == "cl":
            capture_output_cl(f)
        else:
            print "Unsupported Compiler Type"
            continue
        f.flush()
        f.close()

    print "All jobs done."

def capture_output_gcc(f):
    buff = []
    print "GCC Parser"
    for line in f.readlines():
        print line
        if line.find("@title:") != -1:
            buff.append(line[7:])
        elif line.find(": error")  != -1:
            if not line in buff:
                buff.append(line)
        elif line.find(": warning") != -1:
            if not line in buff:
                buff.append(line)
   
    buff

def capture_output_cl(f):
    buff = []
    lines = f.readlines()
    print "CL Parser"
    for line in lines:
        if line.find("@title:") != -1:
            buff.append(line[7:])
        if line.find(": error")  != -1:
            if not line in buff:
                buff.append(line)
        if line.find(": warning") != -1:
            if not line in buff:
                buff.append(line)
    buff

if __name__ == '__main__':
    start_build()

auto_build.pyauto_build_ewc_tor.bat

 

 

 

아마 파이썬인듯...

 

파이썬 공부를 해야하나...

안정적인 DNS서비스 DNSEver DNS server, DNS service
Posted by 키르히아이스
,