a oe@sddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZd d Zd d Zd dZe jdddZejddZeeddZeedddee jdddZddZdS)N) OptionError) yield_lines) pass_none)metadata) ensure_unique)consumec CsJz |jWn:tyD}z"d|d}t||WYd}~n d}~00dS)zR Exercise one of the dynamic properties to trigger the pattern match. zProblems to parse zq. Please ensure entry-point follows the spec: https://packaging.python.org/en/latest/specifications/entry-points/N)extrasAttributeErrorr)epexmsgr9C:\Program Files\Certbot\pkgs\setuptools\_entry_points.py ensure_valid s   rcCs*t|}d|dd|}tj|S)zf Given a value of an entry point or series of entry points, return each as an EntryPoint. []  )rjoinr EntryPoints _from_text)valuegrouplinestextrrr load_groupsrcCs |j|jfSN)rname)r rrrby_group_and_name'srepscCstttt|td|S)zM Ensure entry points are unique by group and name and validate each. key)rmaprrrrrrrvalidate+sr$cCs(tjdd|D}tt|S)zA Given a Distribution.entry_points, produce EntryPoints. css|]\}}t||VqdSr)r).0rrrrr 8szload..) itertoolschain from_iterableitemsr$rr)r groupsrrrload3s r,cCstttj|S)z >>> ep, = load('[console_scripts]\nfoo=bar') >>> ep.group 'console_scripts' >>> ep.name 'foo' >>> ep.value 'bar' )r$rrrrrrr_>s r-cCs|Srr)xrrrLr/cCs2td}tt||d|}ddd|DS)Nrr!rcss(|] \}}d|dt|dVqdS)rrrN) render_items)r%rr*rrrr&Tr0zrender..)operator attrgetterr'groupbysortedr)r Zby_groupr+rrrrenderOs r6cCsdddt|DS)Nrcss |]}|jd|jVqdS)z = N)rr)r%r rrrr&Xr0zrender_items..)rr5rrrrr1Wsr1) functoolsr2r'errorsrZextern.jaraco.textrZextern.jaraco.functoolsrZ _importlibr _itertoolsrZextern.more_itertoolsrrrrrr$singledispatchr,registerstrr-typer6r1rrrrs(