# D2 + licence badges: Founding Member kept, main licence badge (premium), secondary ratings/instructor (existing .tag style) import re h=open('d2.html').read() old='FOUNDING MEMBERCPL(A)NightFIRGrade III Instructor' assert old in h new=('FOUNDING MEMBER' '' 'CPL Aeroplane' '' 'Night ratingInstrument ratingGrade 3 InstructorGrade 2 Instructor') h=h.replace(old,new) css=''' .bdg-brk{flex-basis:100%;height:0} .tag.lic-main{padding:5px 12px 5px 9px;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#fff; background:linear-gradient(135deg,color-mix(in srgb,var(--acc) 70%,#fff) 0%,var(--acc) 45%,color-mix(in srgb,var(--acc) 70%,#000) 100%); box-shadow:inset 0 1px 0 rgba(255,255,255,.45),inset 0 0 0 .5px rgba(255,255,255,.25),0 6px 16px -6px color-mix(in srgb,var(--acc) 70%,transparent);position:relative;overflow:hidden} .tag.lic-main svg{width:13px;height:13px;fill:currentColor} .tag.lic-main::after{content:"";position:absolute;inset:0;background:linear-gradient(120deg,transparent 35%,rgba(255,255,255,.35) 50%,transparent 65%);background-size:250% 100%;animation:sheen 6s ease-in-out infinite} ''' h=h.replace('',css+'',1) js='' h=h.replace('',js+'') h=re.sub(r'.*?','Pilot profile - D2 with licence badges',h) open('d2badges.html','w').write(h);print('ok')