-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanup_duplicates.py
More file actions
31 lines (23 loc) · 892 Bytes
/
Copy pathcleanup_duplicates.py
File metadata and controls
31 lines (23 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Remove duplicate functions from main.cpp"""
target_file = r"D:\codeWorks\graphicstics\graphicstuff\main.cpp"
with open(target_file, 'r', encoding='utf-8') as f:
lines = f.readlines()
# Remove all test functions
cleaned_lines = []
skip_until_brace = False
test_functions = ['test_sync_func', 'baseline_test_func', 'normal_add_func',
'staging_test', 'integrity_test', 'helper_function']
for line in lines:
# Check if this line contains any test function
if any(func in line for func in test_functions):
skip_until_brace = True
continue
if skip_until_brace:
if '}' in line:
skip_until_brace = False
continue
cleaned_lines.append(line)
with open(target_file, 'w', encoding='utf-8') as f:
f.writelines(cleaned_lines)
print("Cleaned up all test functions")
print("File reset to clean state")