prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  heroku ADAPTERS error
  I'm looking to use Heroku for deployment of my web2py project. However, when I add 
  `from gluon.contrib.heroku import get_db`
  `db = get_db(name=None, pool_size=myconf.get('db.pool_size'))`
  
  I get a ticket with the error:
  
  > File "/Users/huangyu/dev/web2py/gluon/contrib/heroku.py", line 10, in <module>
      from pydal.adapters import ADAPTERS, PostgreSQLAdapter
  ImportError: cannot import name ADAPTERS
  
  It looks like web2py has moved on from using ADAPTERS? Has that been replaced by 
  `@adapters.register_for('postgres')`
  
  But the heroku file has not been updated. 
  
  </issue>
  <code>
  [start of gluon/contrib/heroku.py]
  1 """
  2 Usage: in web2py models/db.py
  3 
  4 from gluon.contrib.heroku import get_db
  5 db = get_db()
  6 
  7 """
  8 import os
  9 from gluon import *
  10 from pydal.adapters import ADAPTERS, PostgreSQLAdapter
  11 from pydal.helpers.classes import UseDatabaseStoredFile
  12 
  13 class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):
  14     drivers = ('psycopg2',)
  15     uploads_in_blob = True
  16 
  17 ADAPTERS['postgres'] = HerokuPostgresAdapter
  18 
  19 def get_db(name = None, pool_size=10):
  20     if not name:
  21         names = [n for n in os.environ.keys()
  22                  if n[:18]+n[-4:]=='HEROKU_POSTGRESQL__URL']
  23         if names:
  24             name = names[0]
  25     if name:
  26         db = DAL(os.environ[name], pool_size=pool_size)
  27         current.session.connect(current.request, current.response, db=db)
  28     else:
  29         db = DAL('sqlite://heroku.test.sqlite')
  30     return db
  31
  [end of gluon/contrib/heroku.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/gluon/contrib/heroku.py b/gluon/contrib/heroku.py
  --- a/gluon/contrib/heroku.py
  +++ b/gluon/contrib/heroku.py
  @@ -7,15 +7,13 @@
   """
   import os
   from gluon import *
  -from pydal.adapters import ADAPTERS, PostgreSQLAdapter
  -from pydal.helpers.classes import UseDatabaseStoredFile
  +from pydal.adapters import adapters, PostgrePsyco
  +from pydal.helpers.classes import DatabaseStoredFile
   
  -class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):
  -    drivers = ('psycopg2',)
  +@adapters.register_for('postgres')
  +class HerokuPostgresAdapter(DatabaseStoredFile, PostgrePsyco):
       uploads_in_blob = True
   
  -ADAPTERS['postgres'] = HerokuPostgresAdapter
  -
   def get_db(name = None, pool_size=10):
       if not name:
           names = [n for n in os.environ.keys()
  
verification_info: {"golden_diff": "diff --git a/gluon/contrib/heroku.py b/gluon/contrib/heroku.py\n--- a/gluon/contrib/heroku.py\n+++ b/gluon/contrib/heroku.py\n@@ -7,15 +7,13 @@\n \"\"\"\n import os\n from gluon import *\n-from pydal.adapters import ADAPTERS, PostgreSQLAdapter\n-from pydal.helpers.classes import UseDatabaseStoredFile\n+from pydal.adapters import adapters, PostgrePsyco\n+from pydal.helpers.classes import DatabaseStoredFile\n \n-class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):\n-    drivers = ('psycopg2',)\n+@adapters.register_for('postgres')\n+class HerokuPostgresAdapter(DatabaseStoredFile, PostgrePsyco):\n     uploads_in_blob = True\n \n-ADAPTERS['postgres'] = HerokuPostgresAdapter\n-\n def get_db(name = None, pool_size=10):\n     if not name:\n         names = [n for n in os.environ.keys()\n", "issue": "heroku ADAPTERS error\nI'm looking to use Heroku for deployment of my web2py project. However, when I add \r\n`from gluon.contrib.heroku import get_db`\r\n`db = get_db(name=None, pool_size=myconf.get('db.pool_size'))`\r\n\r\nI get a ticket with the error:\r\n\r\n> File \"/Users/huangyu/dev/web2py/gluon/contrib/heroku.py\", line 10, in <module>\r\n    from pydal.adapters import ADAPTERS, PostgreSQLAdapter\r\nImportError: cannot import name ADAPTERS\r\n\r\nIt looks like web2py has moved on from using ADAPTERS? Has that been replaced by \r\n`@adapters.register_for('postgres')`\r\n\r\nBut the heroku file has not been updated. \n", "before_files": [{"content": "\"\"\"\nUsage: in web2py models/db.py\n\nfrom gluon.contrib.heroku import get_db\ndb = get_db()\n\n\"\"\"\nimport os\nfrom gluon import *\nfrom pydal.adapters import ADAPTERS, PostgreSQLAdapter\nfrom pydal.helpers.classes import UseDatabaseStoredFile\n\nclass HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):\n    drivers = ('psycopg2',)\n    uploads_in_blob = True\n\nADAPTERS['postgres'] = HerokuPostgresAdapter\n\ndef get_db(name = None, pool_size=10):\n    if not name:\n        names = [n for n in os.environ.keys()\n                 if n[:18]+n[-4:]=='HEROKU_POSTGRESQL__URL']\n        if names:\n            name = names[0]\n    if name:\n        db = DAL(os.environ[name], pool_size=pool_size)\n        current.session.connect(current.request, current.response, db=db)\n    else:\n        db = DAL('sqlite://heroku.test.sqlite')\n    return db\n", "path": "gluon/contrib/heroku.py"}]}