from pathlib import Path from html.parser import HTMLParser from collections import Counter import re,json,subprocess,hashlib,argparse p=argparse.ArgumentParser();p.add_argument('--source',required=True);a=p.parse_args();r=Path(__file__).resolve().parents[3];c=r/'docs/design-system/implementation-v3/candidates'/a.source[:12];m=json.loads((c/'manifest.json').read_text());new=Path(m['staticRoot']);old=Path('/private/tmp/progcode-ds-frozen-7b11bf22fd24') class Times(HTMLParser): def __init__(self,html):super().__init__();self.current=None;self.values=[];self.feed(html) def handle_starttag(self,tag,attrs): if tag=='time':self.current=[dict(attrs).get('datetime'),''] def handle_data(self,value): if self.current is not None:self.current[1]+=value def handle_endtag(self,tag): if tag=='time' and self.current is not None:self.values.append(tuple(self.current));self.current=None def inner(html): match=re.search(r']*class="[^"]*\barticle-content\b[^"]*"[^>]*>',html);assert match;start=match.end();depth=1 for tag in re.finditer(r']*>',html[start:]): depth+=-1 if tag.group().startswith('