INNER CODE UNIT · Python

search_files

crocs-muni/JCAlgTest · AlgTest_JavaCard/preprocess_jcapi.py:7

def search_files(folder):
    for root, dirs, files in os.walk(folder):
        yield from [os.path.join(root, x) for x in files]


def process_file(file_name, enable_api_map):
    with open(file_name, 'r') as f:
        lines = f.readlines()

    output_lines = []
    for line in lines:
        output_line = line
        for api in enable_api_map.keys():
            if line.find(api) != -1:
                # we found line with api to enable or disable
                if enable_api_map[api]:
                    # make sure there is no '//' at the begin of the line
                    if line.startswith('//'):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…