Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/virtualenv/run/plugin/discovery.py @ 0:26e78fe6e8c4 draft
"planemo upload commit c699937486c35866861690329de38ec1a5d9f783"
| author | shellac |
|---|---|
| date | Sat, 02 May 2020 07:14:21 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:26e78fe6e8c4 |
|---|---|
| 1 from __future__ import absolute_import, unicode_literals | |
| 2 | |
| 3 from virtualenv.run.app_data import TempAppData | |
| 4 | |
| 5 from .base import PluginLoader | |
| 6 | |
| 7 | |
| 8 class Discovery(PluginLoader): | |
| 9 """""" | |
| 10 | |
| 11 | |
| 12 def get_discover(parser, args, options): | |
| 13 discover_types = Discovery.entry_points_for("virtualenv.discovery") | |
| 14 discovery_parser = parser.add_argument_group( | |
| 15 title="discovery", description="discover and provide a target interpreter" | |
| 16 ) | |
| 17 discovery_parser.add_argument( | |
| 18 "--discovery", | |
| 19 choices=_get_default_discovery(discover_types), | |
| 20 default=next(i for i in discover_types.keys()), | |
| 21 required=False, | |
| 22 help="interpreter discovery method", | |
| 23 ) | |
| 24 options, _ = parser.parse_known_args(args, namespace=options) | |
| 25 if options.app_data == "<temp folder>": | |
| 26 options.app_data = TempAppData() | |
| 27 if options.clear_app_data: | |
| 28 options.app_data.clean() | |
| 29 discover_class = discover_types[options.discovery] | |
| 30 discover_class.add_parser_arguments(discovery_parser) | |
| 31 options, _ = parser.parse_known_args(args, namespace=options) | |
| 32 discover = discover_class(options) | |
| 33 return discover | |
| 34 | |
| 35 | |
| 36 def _get_default_discovery(discover_types): | |
| 37 return list(discover_types.keys()) |
