Exemplo n.º 1
0
def get_block_totaltime(block):
    time_line = ut.regex_search('Pystone time: [0-9.]* s', block)
    time_str  = ut.regex_search('[0-9.]+', time_line)
    if time_str is not None:
        return float(time_str)
    else:
        return None
Exemplo n.º 2
0
def get_block_totaltime(block):
    time_line = ut.regex_search('Pystone time: [0-9.]* s', block)
    time_str  = ut.regex_search('[0-9.]+', time_line)
    if time_str is not None:
        return float(time_str)
    else:
        return None
Exemplo n.º 3
0
def fix_youtube_names_ccl(r):
    import utool
    cwd = os.getcwd()
    fpath_list = utool.glob(cwd, '*.mp4')
    for fpath in fpath_list:
        #print(fpath)
        dpath, fname = split(fpath)
        found = utool.regex_search(r'Crash Course .*-', fname)
        if found is not None:
            found = found.replace('English', '').replace('-', ' - ')
            new_fpath = join(dpath, found + fname.replace(found, ''))
            print(new_fpath)
            shutil.move(fpath, new_fpath)
Exemplo n.º 4
0
def fix_youtube_names_ccl(r):
    import utool
    cwd = os.getcwd()
    fpath_list = utool.glob(cwd, '*.mp4')
    for fpath in fpath_list:
        #print(fpath)
        dpath, fname = split(fpath)
        found = utool.regex_search(r'Crash Course .*-', fname)
        if found is not None:
            found = found.replace('English', '').replace('-', ' - ')
            new_fpath = join(dpath, found + fname.replace(found, ''))
            print(new_fpath)
            shutil.move(fpath, new_fpath)