comparison env/lib/python3.7/site-packages/virtualenv/activation/activator.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 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