prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Integration with virtualenvwrapper
  Congratulations on the rewrite.
  
  I notice that `virtualenvwrapper` doesn't integrate with the new beta:
  
  ```
  $ mkvirtualenv foo
  ERROR: Environment '/Users/brettmz/.virtualenvs/foo' does not contain an activate script.
  ```
  
  Sure enough - I believe it is looking for a script `activate` - but the script file now depends on the shell - `activate.sh` etc. 
  
  It would be good if this could work somehow - would it be reasonable to create / link a default `activate` script for this case?  Or should virtualenvwrapper be updated?
  
  </issue>
  <code>
  [start of src/virtualenv/activation/bash/__init__.py]
  1 from __future__ import absolute_import, unicode_literals
  2 
  3 from virtualenv.util.path import Path
  4 
  5 from ..via_template import ViaTemplateActivator
  6 
  7 
  8 class BashActivator(ViaTemplateActivator):
  9     @classmethod
  10     def supports(cls, interpreter):
  11         return interpreter.os != "nt"
  12 
  13     def templates(self):
  14         yield Path("activate.sh")
  15
  [end of src/virtualenv/activation/bash/__init__.py]
  [start of src/virtualenv/activation/via_template.py]
  1 from __future__ import absolute_import, unicode_literals
  2 
  3 import os
  4 import sys
  5 from abc import ABCMeta, abstractmethod
  6 
  7 import six
  8 
  9 from .activator import Activator
  10 
  11 if sys.version_info >= (3, 7):
  12     from importlib.resources import read_text
  13 else:
  14     from importlib_resources import read_text
  15 
  16 
  17 @six.add_metaclass(ABCMeta)
  18 class ViaTemplateActivator(Activator):
  19     @abstractmethod
  20     def templates(self):
  21         raise NotImplementedError
  22 
  23     def generate(self, creator):
  24         dest_folder = creator.bin_dir
  25         replacements = self.replacements(creator, dest_folder)
  26         self._generate(replacements, self.templates(), dest_folder, creator)
  27         if self.flag_prompt is not None:
  28             creator.pyenv_cfg["prompt"] = self.flag_prompt
  29 
  30     def replacements(self, creator, dest_folder):
  31         return {
  32             "__VIRTUAL_PROMPT__": "" if self.flag_prompt is None else self.flag_prompt,
  33             "__VIRTUAL_ENV__": six.ensure_text(str(creator.dest)),
  34             "__VIRTUAL_NAME__": creator.env_name,
  35             "__BIN_NAME__": six.ensure_text(str(creator.bin_dir.relative_to(creator.dest))),
  36             "__PATH_SEP__": six.ensure_text(os.pathsep),
  37         }
  38 
  39     def _generate(self, replacements, templates, to_folder, creator):
  40         for template in templates:
  41             text = self.instantiate_template(replacements, template, creator)
  42             (to_folder / template).write_text(text, encoding="utf-8")
  43 
  44     def instantiate_template(self, replacements, template, creator):
  45         # read text and do replacements
  46         text = read_text(self.__module__, str(template), encoding="utf-8", errors="strict")
  47         for key, value in replacements.items():
  48             value = self._repr_unicode(creator, value)
  49             text = text.replace(key, value)
  50         return text
  51 
  52     @staticmethod
  53     def _repr_unicode(creator, value):
  54         # by default we just let it be unicode
  55         return value
  56
  [end of src/virtualenv/activation/via_template.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/virtualenv/activation/bash/__init__.py b/src/virtualenv/activation/bash/__init__.py
  --- a/src/virtualenv/activation/bash/__init__.py
  +++ b/src/virtualenv/activation/bash/__init__.py
  @@ -12,3 +12,6 @@
   
       def templates(self):
           yield Path("activate.sh")
  +
  +    def as_name(self, template):
  +        return template.stem
  diff --git a/src/virtualenv/activation/via_template.py b/src/virtualenv/activation/via_template.py
  --- a/src/virtualenv/activation/via_template.py
  +++ b/src/virtualenv/activation/via_template.py
  @@ -39,7 +39,11 @@
       def _generate(self, replacements, templates, to_folder, creator):
           for template in templates:
               text = self.instantiate_template(replacements, template, creator)
  -            (to_folder / template).write_text(text, encoding="utf-8")
  +            dest = to_folder / self.as_name(template)
  +            dest.write_text(text, encoding="utf-8")
  +
  +    def as_name(self, template):
  +        return template.name
   
       def instantiate_template(self, replacements, template, creator):
           # read text and do replacements
  
verification_info: {"golden_diff": "diff --git a/src/virtualenv/activation/bash/__init__.py b/src/virtualenv/activation/bash/__init__.py\n--- a/src/virtualenv/activation/bash/__init__.py\n+++ b/src/virtualenv/activation/bash/__init__.py\n@@ -12,3 +12,6 @@\n \n     def templates(self):\n         yield Path(\"activate.sh\")\n+\n+    def as_name(self, template):\n+        return template.stem\ndiff --git a/src/virtualenv/activation/via_template.py b/src/virtualenv/activation/via_template.py\n--- a/src/virtualenv/activation/via_template.py\n+++ b/src/virtualenv/activation/via_template.py\n@@ -39,7 +39,11 @@\n     def _generate(self, replacements, templates, to_folder, creator):\n         for template in templates:\n             text = self.instantiate_template(replacements, template, creator)\n-            (to_folder / template).write_text(text, encoding=\"utf-8\")\n+            dest = to_folder / self.as_name(template)\n+            dest.write_text(text, encoding=\"utf-8\")\n+\n+    def as_name(self, template):\n+        return template.name\n \n     def instantiate_template(self, replacements, template, creator):\n         # read text and do replacements\n", "issue": "Integration with virtualenvwrapper\nCongratulations on the rewrite.\r\n\r\nI notice that `virtualenvwrapper` doesn't integrate with the new beta:\r\n\r\n```\r\n$ mkvirtualenv foo\r\nERROR: Environment '/Users/brettmz/.virtualenvs/foo' does not contain an activate script.\r\n```\r\n\r\nSure enough - I believe it is looking for a script `activate` - but the script file now depends on the shell - `activate.sh` etc. \r\n\r\nIt would be good if this could work somehow - would it be reasonable to create / link a default `activate` script for this case?  Or should virtualenvwrapper be updated?\n", "before_files": [{"content": "from __future__ import absolute_import, unicode_literals\n\nfrom virtualenv.util.path import Path\n\nfrom ..via_template import ViaTemplateActivator\n\n\nclass BashActivator(ViaTemplateActivator):\n    @classmethod\n    def supports(cls, interpreter):\n        return interpreter.os != \"nt\"\n\n    def templates(self):\n        yield Path(\"activate.sh\")\n", "path": "src/virtualenv/activation/bash/__init__.py"}, {"content": "from __future__ import absolute_import, unicode_literals\n\nimport os\nimport sys\nfrom abc import ABCMeta, abstractmethod\n\nimport six\n\nfrom .activator import Activator\n\nif sys.version_info >= (3, 7):\n    from importlib.resources import read_text\nelse:\n    from importlib_resources import read_text\n\n\n@six.add_metaclass(ABCMeta)\nclass ViaTemplateActivator(Activator):\n    @abstractmethod\n    def templates(self):\n        raise NotImplementedError\n\n    def generate(self, creator):\n        dest_folder = creator.bin_dir\n        replacements = self.replacements(creator, dest_folder)\n        self._generate(replacements, self.templates(), dest_folder, creator)\n        if self.flag_prompt is not None:\n            creator.pyenv_cfg[\"prompt\"] = self.flag_prompt\n\n    def replacements(self, creator, dest_folder):\n        return {\n            \"__VIRTUAL_PROMPT__\": \"\" if self.flag_prompt is None else self.flag_prompt,\n            \"__VIRTUAL_ENV__\": six.ensure_text(str(creator.dest)),\n            \"__VIRTUAL_NAME__\": creator.env_name,\n            \"__BIN_NAME__\": six.ensure_text(str(creator.bin_dir.relative_to(creator.dest))),\n            \"__PATH_SEP__\": six.ensure_text(os.pathsep),\n        }\n\n    def _generate(self, replacements, templates, to_folder, creator):\n        for template in templates:\n            text = self.instantiate_template(replacements, template, creator)\n            (to_folder / template).write_text(text, encoding=\"utf-8\")\n\n    def instantiate_template(self, replacements, template, creator):\n        # read text and do replacements\n        text = read_text(self.__module__, str(template), encoding=\"utf-8\", errors=\"strict\")\n        for key, value in replacements.items():\n            value = self._repr_unicode(creator, value)\n            text = text.replace(key, value)\n        return text\n\n    @staticmethod\n    def _repr_unicode(creator, value):\n        # by default we just let it be unicode\n        return value\n", "path": "src/virtualenv/activation/via_template.py"}]}