ó `8(Zc@sÁdZddlZddlZddlZddlZddlmZm Z ddl Z ddl m Z ddlmZddlmZdZid d 6d d 6d d6ZeƒZidd6dd6dfidd6dd6dffZdddddhZejdƒZejdƒZedd'ƒZd„Zd„Zdd„Zd „Z d!„Z!d"„Z"d#„Z#d$„Z$d%„Z%e&d&kr½ddl'Z'ddl(Z(e(j(ee'j)dƒƒndS((s2 Tools for converting old- to new-style metadata. iÿÿÿÿN(t namedtuplet OrderedDicti(t __version__(t read_pkg_info(tOrderedDefaultDicts2.0t classifierst classifiertprovidest provides_disttextrastprovides_extrat author_emailtemailtauthortnametmaintainer_emailt maintainertplatformt home_pagetlicensesF^(?P.*?)(;\s*(?P.*?)(extra == '(?P.*?)')?)$s[-,]+tMayRequiresKeyt conditiontextraccs?tƒ}x/|D]'}||kr|j|ƒ|VqqWdS(s< Yield unique values in iterable, preserving order. N(tsettadd(titerabletseentvalue((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pytunique)s     c Cs¬ttƒ}x­t|j|ƒƒD]–}tj|ƒ}|r†|jƒ}|d}|d}|d} |jdƒr˜|d }q˜nd \}}|} t ||ƒ}||j | ƒq"W|r¨g|d}|jd dƒ}|tkrqqGn|tkr˜|j|ƒdkr˜qGn|ttƒkrÄ|j|ƒ|t|t|ƒD]0}|||krj|j'||ƒ||ls(R(((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pyR7lss bdist_wheel (t)t generatortrbsutf-8NtSummarytsummaryt Descriptiont descriptioncss|]}|jƒVqdS(N(tlower(t.0tk((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pys ‰st-t_tUNKNOWNt requires_distR R RtHomet extensionsspython.detailst project_urlstkeywordstmetadata_versiont test_requirest tests_requireR$troletcontactssentry_points.txttrs = ispython.exportstconsole_scriptst wrap_consolet gui_scriptstwrap_guispython.commands(RKRL((RKRL(sconsole_scriptsRQ(s gui_scriptsRS(5Rt wheel_versiontunicodeRt NameErrortopenR tparsertParsertparsestrtreadtdecodeR tpkginfo_unicodetdedent_descriptiont get_payloadt isinstancetbytesR'RR0treplacet SKIP_FIELDStUNKNOWN_FIELDStgett PLURAL_FIELDSR(R6R/t KEYWORDS_REtsplittMETADATA_VERSIONRtgetattrR&tconvert_requirementstAttributeErrortCONTACT_FIELDSRtpopR-tostpathtjointdirnamet pkg_resourcest EntryPointt parse_mapR.tmaptstrtvaluestIOError(Rpt distributionR1R2t pkg_info_fileR>tpayloadR"tlow_keyR$tattrt requirementstnew_requirementsRNt contact_typeRMtcontacttep_filetep_maptexportstgroupR.R!Rtexportt ep_scriptt wrap_script((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pytpkginfo_to_dict`s¨   1        ) !             -  " (cCsRg}x(|jD]\}}|j||ƒqW|s;dSddjt|ƒƒS(sBCompose the version predicates for requirement in PEP 345 fashion.Rs (%s)t,(tspecsR-RqR'(t requirementREtoptver((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pytrequires_to_requires_distÝs ccshxa|D]Y}tjj|ƒ}t|ƒ}dj|jƒ}|rPd|}n|j||VqWdS(s=Yield Requires-Dist: strings for parsed requirements strings.R‹s[%s]N(Rst RequirementtparseRRqR t project_name(Rtreqtparsed_requirementtspecR ((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pyRkçs   ccsÑxÊ|jƒD]¼\}}d}|r[d|kr[|jddƒ\}}tj|ƒ}n|rd|fV|r|d7}n|d|7}n|r£d|}nx#t|ƒD]}d||fVq°Wq Wd S( s, Convert requirements from a setup()-style dictionary to ('Requires-Dist', 'requirement') and ('Provides-Extra', 'extra') tuples. extras_require is a dictionary of {extra: [requirements]} as passed to setup(), using the empty extra {'': [requirements]} to hold install_requires. Rt:isProvides-Extras and s extra == '%s's; s Requires-DistN(R.RhRst safe_extraRk(textras_requireRtdependsRtnew_req((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pytgenerate_requirementsòs   c Cs÷t|ƒ}|jddƒtjj|dƒ}tjj|ƒrÆt|ƒ}|jƒ}WdQXx_tt j |ƒdd„ƒD]<\}}x-t i||6ƒD]}|d||d((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pytpkginfo_to_metadata s   cCs•||}|jƒ}t|tƒs‘t|dƒs>t|ƒSxP|jƒD]?}|djƒ|krK|djddƒjdƒ}PqKqKWn|S(s<Hack to coax Unicode out of an email Message() - Python 3.3+t raw_itemsiitasciitsurrogateescapesutf-8(R?R`RwthasattrR¨tencodeR\(R2tfieldttextR!((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pyR]"s     cCs£|d}t}t|tƒs7t}t|dƒ}n|jƒ}dj|djƒtj dj|dƒƒdfƒ}|rŸ|j dƒj ddƒ}n|S(s@ Dedent and convert pkg_info['Description'] to Unicode. R=s iitutf8R©Rª( tFalseR`RwtTrueR]t splitlinesRqtlstripttextwraptdedentR¬R\(R2R>t surrogatestdescription_linestdescription_dedent((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pyR^2s     t__main__(s conditionsextra(*t__doc__t email.parserR tos.pathRotreR´t collectionsRRRsRRRTtpkginfoRtutilRRiRfRRcRmRdtcompileR)RgRRR6R RŠRRkRœR§R]R^t__name__tsystpprinttargv(((s-/tmp/pip-build-0nEYGB/wheel/wheel/metadata.pytsF          , }