comparison env/lib/python3.7/site-packages/virtualenv/activation/activator.py @ 5:9b1c78e6ba9c draft default tip

"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
author shellac
date Mon, 01 Jun 2020 08:59:25 -0400
parents 79f47841a781
children
comparison
equal deleted inserted replaced
4:79f47841a781 5:9b1c78e6ba9c
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