Files
medical-mall/fix_all_font_weights.py

27 lines
882 B
Python

import os
target_dir = r'e:\companyproject\mall'
count = 0
for root, dirs, files in os.walk(target_dir):
for file in files:
if file.endswith('.uvue'):
file_path = os.path.join(root, file)
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
# Replace font-weight: 600 with font-weight: 700
if 'font-weight: 600' in content:
print(f"Fixing {file_path}")
new_content = content.replace('font-weight: 600', 'font-weight: 700')
with open(file_path, 'w', encoding='utf-8') as f:
f.write(new_content)
count += 1
except Exception as e:
print(f"Error processing {file_path}: {e}")
print(f"Fixed {count} files.")