Update copyright for TensorRT sources
(directory, depth, args, exclude_dirs=[])
| 151 | f.write(new_data) |
| 152 | |
| 153 | def copyright_scan(directory, depth, args, exclude_dirs=[]): |
| 154 | """ |
| 155 | Update copyright for TensorRT sources |
| 156 | """ |
| 157 | if directory in exclude_dirs: |
| 158 | return |
| 159 | for f in os.listdir(directory): |
| 160 | filename = os.path.join(directory,f) |
| 161 | if os.path.isdir(filename) and (depth > 0): |
| 162 | copyright_scan(filename, depth-1, args, exclude_dirs) |
| 163 | elif filename.endswith(extensions_p + extensions_c): |
| 164 | update(filename, args) |
| 165 | |
| 166 | def main(): |
| 167 | parser = argparse.ArgumentParser(description='TensorRT copyright scan') |