コード例 #1
0
ファイル: fixnames.py プロジェクト: lihuan545890/webrtc_old
def replaceall(my_table, extension_list):
    size_of_table = len(my_table)
    for index in range(len(my_table)):
        old_name = my_table[index][0]
        new_name = my_table[index][1]
        new_name = new_name
        for extension in extensions_to_edit:
            filemanagement.replacestringinallsubfolders(
                old_name, new_name, extension)
        print 100 * (size_of_table + index) / (size_of_table * 2)
コード例 #2
0
def replaceall( my_table, extension_list ):
    size_of_table = len(my_table)
    for index in range(len(my_table)):
        old_name = my_table[index][0]
        new_name = my_table[index][1]
        new_name = new_name
        for extension in extensions_to_edit:
            filemanagement.replacestringinallsubfolders(old_name, new_name,
                                                        extension)
        print 100*(size_of_table + index) / (size_of_table*2)
コード例 #3
0
        new_file_name = filename

        new_file_name = stringmanipulation.removeallprefix(new_file_name,\
                                                       'gips')
        new_file_name = stringmanipulation.removealloccurances(new_file_name,\
                                                       'module')
        new_file_name = stringmanipulation.changeextension(new_file_name,\
                                           old_extension,\
                                           new_extension)
        new_file_name = stringmanipulation.fixabbreviations( new_file_name )
        new_file_name = stringmanipulation.lowercasewithunderscore(new_file_name)
    if(not commit):
        print 'File ' + filename + ' will be replaced with ' + new_file_name
        continue
    full_new_file_name = path_dir + new_file_name
    full_old_file_name = path_dir + filename
    if(full_new_file_name != full_old_file_name):
        p4commands.integratefile(full_old_file_name,full_new_file_name)
    else:
        print 'skipping ' + new_file_name + ' due to no change'
    for extension in extensions:
        print 'replacing ' + filename
        if (extension == ".gyp"):
            filemanagement.replacestringinallsubfolders(
                filename,new_file_name,extension)
        else:
            filemanagement.replacestringinallsubfolders(
                '\"' + filename + '\"', '\"' + new_file_name + '\"', extension)
if(commit):
    p4commands.revertunchangedfiles()