o $"b@sHddlmZmZddlmZddlmZddlmZGdddeZ dS) )absolute_importunicode_literals)ArgumentTypeError) OrderedDict)ComponentBuildercs<eZdZfddZddZddZddZd d ZZS) ActivationSelectorcsNd|_tfdd|dD}tt||d|d|j_d|_ dS)Nc3s&|]\}}|r||fVqdS)N)supports.0kv interpreterB/usr/lib/python3/dist-packages/virtualenv/run/plugin/activators.py s  z.ActivationSelector.__init__..zvirtualenv.activate activatorszoptions for activation scripts) defaultroptionsitemssuperr__init__parser descriptionactive)selfrrpossible __class__rrr s   zActivationSelector.__init__cCs2d||_|jjd||jddd|jddS)N,z--{}comma_sep_listFz1activators to generate - default is all supported)rmetavarrequiredhelptype)joinrr add_argumentformat_extract_activators)rnamechoicesrrradd_selector_arg_parses  z)ActivationSelector.add_selector_arg_parsecsBdd|dD}fdd|D}|rtdd||S)NcSsg|] }|r|qSr)stripr errr sz:ActivationSelector._extract_activators..r csg|] }|jvr|qSr)rr.rrrr0 sz-the following activators are not available {})splitrr(r&)r entered_strelementsmissingrr1rr)s z&ActivationSelector._extract_activatorscsr|j|jur ||jn|jfdd|jD|_|jjdddddd|jD] }| |j|j q,dS)Ncsi|] \}}|vr||qSrrr selected_activatorsrr )sz@ActivationSelector.handle_selected_arg_parse..z--promptpromptzsprovides an alternative prompt prefix for this environment (value of . means name of the current working directory))destr"r$r) rrr)rrrrr'valuesadd_parser_argumentsr)rr activatorrr6rhandle_selected_arg_parse%s z,ActivationSelector.handle_selected_arg_parsecsfdd|jDS)Ncsg|]}|qSrr)r activator_classrrrr08sz-ActivationSelector.create..)rr;)rrrr@rcreate7szActivationSelector.create) __name__ __module__ __qualname__rr,r)r>rA __classcell__rrrrr s    rN) __future__rrargparser collectionsrbaserrrrrrs