-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudit_fix.py
More file actions
50 lines (42 loc) · 1.82 KB
/
Copy pathaudit_fix.py
File metadata and controls
50 lines (42 loc) · 1.82 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
files_to_check = ['admin.html', 'admin.js', 'portal.html', 'portal.js', 'index.html']
replacements = {
'Anita Sharma': 'Anjali Gupta',
'Ramesh Kumar': 'Sneha Reddy',
'Rakesh S.': 'Karan Verma',
'Rakesh S': 'Karan Verma',
'Anita J.': 'Neha Joshi',
'Anita J': 'Neha Joshi',
'Vijay K.': 'Vikram Singh',
'Vijay K': 'Vikram Singh',
'Officer V. Singh': 'Vikram Singh'
}
for file in files_to_check:
if os.path.exists(file):
with open(file, 'r', encoding='utf-8') as f:
content = f.read()
modified = False
for old_name, new_name in replacements.items():
if old_name in content:
content = content.replace(old_name, new_name)
modified = True
# Additional cleanup for consistency in admin.html Accountability & Performance
if file == 'admin.html':
# Fix specific details
if 'Zone 4 • 98% Validation Success' in content:
content = content.replace('Zone 4 • 98% Validation Success', 'Public Works • 98% Validation Success')
modified = True
if 'Electricity Division' in content:
content = content.replace('Electricity Division', 'Electricity Board')
modified = True
if 'Electricity • 92% Validation Success' in content:
content = content.replace('Electricity • 92% Validation Success', 'Electricity Board • 92% Validation Success')
modified = True
if file == 'admin.js':
# Rakesh S was in admin.js? Only in admin.html perhaps.
pass
if modified:
with open(file, 'w', encoding='utf-8') as f:
f.write(content)
print(f"Updated {file}")
print("Audit corrections applied.")