Example #1
0
def compileIt(path):
    msgLog('Compile Start')
    files = gci(path)
    num,length = 0,len(files)
    for file in files:
        num += 1
        token = file.split('.')
        if len(token) >= 2 and token[1] == 'cpp':
            output = token[0] + '.exe'
            call(['g++', file, '-o', output])
            msgLog('Compile Progress: ' + str(num * 100 // length) + '%')
    msgLog('Compile Complete')
Example #2
0
def unCompressIt(path):
    """
    unzip and unRar all files recursively in a dir
    :param path:dir
    :return:None
    """
    msgLog('UnCompress Start')
    for file in gci(path):
        token = file.split('.')
        if len(token) >= 2 and token[1] == 'rar':
            try:
                unRar(token[0])
            except:
                errorLog('unRar fail')
        elif len(token) >= 2 and token[1] == 'zip':
            try:
                unZip(token[0])
            except:
                errorLog('unZip fail')
    msgLog('UnCompress complete')