prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Remove unnecessary warning when using `download`
  When running `retriever download` an unnecessary warning displays
  
  ```
  ethan@gandalf:~$ retriever download Clark2006
  Creating database Clark2006...
  Couldn't create database ('NoneType' object has no attribute 'execute').
  ...
  ```
  
  The command executes correctly, but this warning isn't really correct (there is no database to create since we're just downloading the raw data files) and could be distracting to users.
  
  
  </issue>
  <code>
  [start of engines/download_only.py]
  1 from __future__ import print_function
  2 from builtins import object
  3 import os
  4 import platform
  5 import shutil
  6 import inspect
  7 
  8 from retriever.lib.engine import filename_from_url
  9 from retriever.lib.models import Engine, no_cleanup
  10 from retriever import DATA_DIR, HOME_DIR
  11 
  12 
  13 class DummyConnection(object):
  14 
  15     def cursor(self):
  16         pass
  17 
  18     def commit(self):
  19         pass
  20 
  21     def rollback(self):
  22         pass
  23 
  24     def close(self):
  25         pass
  26 
  27 
  28 class DummyCursor(DummyConnection):
  29     pass
  30 
  31 
  32 class engine(Engine):
  33     """Engine instance for writing data to a CSV file."""
  34     name = "Download Only"
  35     abbreviation = "download"
  36     required_opts = [("path",
  37                       "File path to copy data files",
  38                       "./"),
  39                      ("subdir",
  40                       "Keep the subdirectories for archived files",
  41                       False)
  42                      ]
  43 
  44     def table_exists(self, dbname, tablename):
  45         """Checks if the file to be downloaded already exists"""
  46         try:
  47             tablename = self.table_name(name=tablename, dbname=dbname)
  48             return os.path.exists(tablename)
  49         except:
  50             return False
  51 
  52     def get_connection(self):
  53         """Gets the db connection."""
  54         self.get_input()
  55         return DummyConnection()
  56 
  57     def final_cleanup(self):
  58         """Copies downloaded files to desired directory
  59 
  60         Copies the downloaded files into the chosen directory unless files with the same
  61         name already exist in the directory.
  62 
  63         """
  64         if hasattr(self, "all_files"):
  65             for file_name in self.all_files:
  66                 file_path, file_name_nopath = os.path.split(file_name)
  67                 subdir = os.path.split(file_path)[1] if self.opts['subdir'] else ''
  68                 dest_path = os.path.join(self.opts['path'], subdir)
  69                 if os.path.isfile(os.path.join(dest_path, file_name_nopath)):
  70                     print ("File already exists at specified location")
  71                 elif os.path.abspath(file_path) == os.path.abspath(os.path.join(DATA_DIR, subdir)):
  72                     print ("%s is already in the working directory" %
  73                            file_name_nopath)
  74                     print("Keeping existing copy.")
  75                 else:
  76                     print("Copying %s from %s" % (file_name_nopath, file_path))
  77                     if os.path.isdir(dest_path):
  78                         try:
  79                             shutil.copy(file_name, dest_path)
  80                         except:
  81                             print("Couldn't copy file to %s" % dest_path)
  82                     else:
  83                         try:
  84                             print("Creating directory %s" % dest_path)
  85                             os.makedirs(dest_path)
  86                             shutil.copy(file_name, dest_path)
  87                         except:
  88                             print("Couldn't create directory %s" % dest_path)
  89         self.all_files = set()
  90 
  91     def auto_create_table(self, table, url=None, filename=None, pk=None):
  92         """Download the file if it doesn't exist"""
  93         if url and not filename:
  94             filename = filename_from_url(url)
  95 
  96         if url and not self.find_file(filename):
  97             # If the file doesn't exist, download it
  98             self.download_file(url, filename)
  99 
  100     def insert_data_from_url(self, url):
  101         """Insert data from a web resource"""
  102         filename = filename_from_url(url)
  103         find = self.find_file(filename)
  104         if not find:
  105             self.create_raw_data_dir()
  106             self.download_file(url, filename)
  107 
  108     def find_file(self, filename):
  109         """Checks for the given file and adds it to the list of all files"""
  110         result = Engine.find_file(self, filename)
  111         if not hasattr(self, "all_files"):
  112             self.all_files = set()
  113         if result:
  114             self.all_files.add(result)
  115         return result
  116 
  117     def register_files(self, filenames):
  118         """Identify a list of files to be moved by the download
  119 
  120         When downloading archives with multiple files the engine needs to be
  121         informed of all of the file names so that it can move them.
  122 
  123         """
  124         full_filenames = {self.find_file(filename) for filename in filenames
  125                           if self.find_file(filename)}
  126         self.all_files = self.all_files.union(full_filenames)
  127 
  128 
  129 # replace all other methods with a function that does nothing
  130 def dummy_method(self, *args, **kwargs):
  131     pass
  132 
  133 
  134 methods = inspect.getmembers(engine, predicate=inspect.ismethod)
  135 keep_methods = {'table_exists',
  136                 'get_connection',
  137                 'final_cleanup',
  138                 'auto_create_table',
  139                 'insert_data_from_url',
  140                 }
  141 remove_methods = ['insert_data_from_file']
  142 for name, method in methods:
  143     if (name not in keep_methods and
  144             'download' not in name and
  145             'file' not in name and
  146             'dir' not in name):
  147         setattr(engine, name, dummy_method)
  148 for name in remove_methods:
  149     setattr(engine, name, dummy_method)
  150
  [end of engines/download_only.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/engines/download_only.py b/engines/download_only.py
  --- a/engines/download_only.py
  +++ b/engines/download_only.py
  @@ -138,7 +138,7 @@
                   'auto_create_table',
                   'insert_data_from_url',
                   }
  -remove_methods = ['insert_data_from_file']
  +remove_methods = ['insert_data_from_file', 'create_db']
   for name, method in methods:
       if (name not in keep_methods and
               'download' not in name and
  
verification_info: {"golden_diff": "diff --git a/engines/download_only.py b/engines/download_only.py\n--- a/engines/download_only.py\n+++ b/engines/download_only.py\n@@ -138,7 +138,7 @@\n                 'auto_create_table',\n                 'insert_data_from_url',\n                 }\n-remove_methods = ['insert_data_from_file']\n+remove_methods = ['insert_data_from_file', 'create_db']\n for name, method in methods:\n     if (name not in keep_methods and\n             'download' not in name and\n", "issue": "Remove unnecessary warning when using `download`\nWhen running `retriever download` an unnecessary warning displays\n\n```\nethan@gandalf:~$ retriever download Clark2006\nCreating database Clark2006...\nCouldn't create database ('NoneType' object has no attribute 'execute').\n...\n```\n\nThe command executes correctly, but this warning isn't really correct (there is no database to create since we're just downloading the raw data files) and could be distracting to users.\n\n", "before_files": [{"content": "from __future__ import print_function\nfrom builtins import object\nimport os\nimport platform\nimport shutil\nimport inspect\n\nfrom retriever.lib.engine import filename_from_url\nfrom retriever.lib.models import Engine, no_cleanup\nfrom retriever import DATA_DIR, HOME_DIR\n\n\nclass DummyConnection(object):\n\n    def cursor(self):\n        pass\n\n    def commit(self):\n        pass\n\n    def rollback(self):\n        pass\n\n    def close(self):\n        pass\n\n\nclass DummyCursor(DummyConnection):\n    pass\n\n\nclass engine(Engine):\n    \"\"\"Engine instance for writing data to a CSV file.\"\"\"\n    name = \"Download Only\"\n    abbreviation = \"download\"\n    required_opts = [(\"path\",\n                      \"File path to copy data files\",\n                      \"./\"),\n                     (\"subdir\",\n                      \"Keep the subdirectories for archived files\",\n                      False)\n                     ]\n\n    def table_exists(self, dbname, tablename):\n        \"\"\"Checks if the file to be downloaded already exists\"\"\"\n        try:\n            tablename = self.table_name(name=tablename, dbname=dbname)\n            return os.path.exists(tablename)\n        except:\n            return False\n\n    def get_connection(self):\n        \"\"\"Gets the db connection.\"\"\"\n        self.get_input()\n        return DummyConnection()\n\n    def final_cleanup(self):\n        \"\"\"Copies downloaded files to desired directory\n\n        Copies the downloaded files into the chosen directory unless files with the same\n        name already exist in the directory.\n\n        \"\"\"\n        if hasattr(self, \"all_files\"):\n            for file_name in self.all_files:\n                file_path, file_name_nopath = os.path.split(file_name)\n                subdir = os.path.split(file_path)[1] if self.opts['subdir'] else ''\n                dest_path = os.path.join(self.opts['path'], subdir)\n                if os.path.isfile(os.path.join(dest_path, file_name_nopath)):\n                    print (\"File already exists at specified location\")\n                elif os.path.abspath(file_path) == os.path.abspath(os.path.join(DATA_DIR, subdir)):\n                    print (\"%s is already in the working directory\" %\n                           file_name_nopath)\n                    print(\"Keeping existing copy.\")\n                else:\n                    print(\"Copying %s from %s\" % (file_name_nopath, file_path))\n                    if os.path.isdir(dest_path):\n                        try:\n                            shutil.copy(file_name, dest_path)\n                        except:\n                            print(\"Couldn't copy file to %s\" % dest_path)\n                    else:\n                        try:\n                            print(\"Creating directory %s\" % dest_path)\n                            os.makedirs(dest_path)\n                            shutil.copy(file_name, dest_path)\n                        except:\n                            print(\"Couldn't create directory %s\" % dest_path)\n        self.all_files = set()\n\n    def auto_create_table(self, table, url=None, filename=None, pk=None):\n        \"\"\"Download the file if it doesn't exist\"\"\"\n        if url and not filename:\n            filename = filename_from_url(url)\n\n        if url and not self.find_file(filename):\n            # If the file doesn't exist, download it\n            self.download_file(url, filename)\n\n    def insert_data_from_url(self, url):\n        \"\"\"Insert data from a web resource\"\"\"\n        filename = filename_from_url(url)\n        find = self.find_file(filename)\n        if not find:\n            self.create_raw_data_dir()\n            self.download_file(url, filename)\n\n    def find_file(self, filename):\n        \"\"\"Checks for the given file and adds it to the list of all files\"\"\"\n        result = Engine.find_file(self, filename)\n        if not hasattr(self, \"all_files\"):\n            self.all_files = set()\n        if result:\n            self.all_files.add(result)\n        return result\n\n    def register_files(self, filenames):\n        \"\"\"Identify a list of files to be moved by the download\n\n        When downloading archives with multiple files the engine needs to be\n        informed of all of the file names so that it can move them.\n\n        \"\"\"\n        full_filenames = {self.find_file(filename) for filename in filenames\n                          if self.find_file(filename)}\n        self.all_files = self.all_files.union(full_filenames)\n\n\n# replace all other methods with a function that does nothing\ndef dummy_method(self, *args, **kwargs):\n    pass\n\n\nmethods = inspect.getmembers(engine, predicate=inspect.ismethod)\nkeep_methods = {'table_exists',\n                'get_connection',\n                'final_cleanup',\n                'auto_create_table',\n                'insert_data_from_url',\n                }\nremove_methods = ['insert_data_from_file']\nfor name, method in methods:\n    if (name not in keep_methods and\n            'download' not in name and\n            'file' not in name and\n            'dir' not in name):\n        setattr(engine, name, dummy_method)\nfor name in remove_methods:\n    setattr(engine, name, dummy_method)\n", "path": "engines/download_only.py"}]}