o $"b@sddlmZmZddlZddlmZejdkr ddlmZdZ nddl mZm Z e dd e d  d dd DZ Gd ddeZGdddeZdS))absolute_importunicode_literalsN) OrderedDict)) entry_points)rversionccs|]}t|VqdSN)int).0irr srimportlib_metadata.c@s,eZdZdZdZeddZeddZdS) PluginLoaderNcCsNtjdks tdkrtdd|j|dDStdd||iDS)N)r )rcs|] }|j|fVqdSr nameloadr errrrz0PluginLoader.entry_points_for..)groupcsrr rrrrrrr)sys version_infoimportlib_metadata_versionrrselectgetclskeyrrrentry_points_forszPluginLoader.entry_points_forcCstjdur tt_tjSr )r _ENTRY_POINTSrrrrrrs zPluginLoader.entry_points) __name__ __module__ __qualname___OPTIONSr' classmethodr& staticmethodrrrrrrs rc@s@eZdZddZeddZddZddZd d Zd d Z d S)ComponentBuildercCs<||_||_d|_||_|j|d|_||t|jdS)N)title) interpreterr _impl_classpossibleadd_argument_groupparseradd_selector_arg_parselist)selfr0r4rr2rrr__init__#s zComponentBuilder.__init__cCs|jdur |||_|jSr )r+r&r#rrroptions+s  zComponentBuilder.optionscCstr )NotImplementedError)r7rchoicesrrrr51sz'ComponentBuilder.add_selector_arg_parsecCsDt||j}||jvrtd|j|j||_|||j|S)NzNo implementation for {}) getattrrr2 RuntimeErrorformatr0r1populate_selected_argparseapp_data)r7r9selectedrrrhandle_selected_arg_parse4s   z*ComponentBuilder.handle_selected_arg_parsecCs*d|j||j_|j|j|j|dS)Nzoptions for {} {})r>rr4 descriptionr1add_parser_argumentsr0)r7rAr@rrrr?<sz+ComponentBuilder.populate_selected_argparsecCs|||jSr )r1r0)r7r9rrrcreate@szComponentBuilder.createN) r(r)r*r8r,r9r5rBr?rErrrrr."s  r.) __future__rrr collectionsrrimportlib.metadatarr rr tuplesplitobjectrr.rrrrs   $