Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/virtualenv/activation/activator.py @ 1:56ad4e20f292 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
| author | guerler |
|---|---|
| date | Fri, 31 Jul 2020 00:32:28 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:d30785e31577 | 1:56ad4e20f292 |
|---|---|
| 1 from __future__ import absolute_import, unicode_literals | |
| 2 | |
| 3 from abc import ABCMeta, abstractmethod | |
| 4 | |
| 5 from six import add_metaclass | |
| 6 | |
| 7 | |
| 8 @add_metaclass(ABCMeta) | |
| 9 class Activator(object): | |
| 10 """Generates an activate script for the virtual environment""" | |
| 11 | |
| 12 def __init__(self, options): | |
| 13 """Create a new activator generator. | |
| 14 | |
| 15 :param options: the parsed options as defined within :meth:`add_parser_arguments` | |
| 16 """ | |
| 17 self.flag_prompt = options.prompt | |
| 18 | |
| 19 @classmethod | |
| 20 def supports(cls, interpreter): | |
| 21 """Check if the activation script is supported in the given interpreter. | |
| 22 | |
| 23 :param interpreter: the interpreter we need to support | |
| 24 :return: ``True`` if supported, ``False`` otherwise | |
| 25 """ | |
| 26 return True | |
| 27 | |
| 28 @classmethod | |
| 29 def add_parser_arguments(cls, parser, interpreter): | |
| 30 """ | |
| 31 Add CLI arguments for this activation script. | |
| 32 | |
| 33 :param parser: the CLI parser | |
| 34 :param interpreter: the interpreter this virtual environment is based of | |
| 35 """ | |
| 36 | |
| 37 @abstractmethod | |
| 38 def generate(self, creator): | |
| 39 """Generate the activate script for the given creator. | |
| 40 | |
| 41 :param creator: the creator (based of :class:`virtualenv.create.creator.Creator`) we used to create this \ | |
| 42 virtual environment | |
| 43 """ | |
| 44 raise NotImplementedError |
