]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- remove some old cruft
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 16 Feb 2008 06:07:28 +0000 (06:07 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 16 Feb 2008 06:07:28 +0000 (06:07 +0000)
- deprecate ancient engine_descriptors() method

lib/sqlalchemy/engine/__init__.py
lib/sqlalchemy/engine/url.py

index 443f74c2acc718493d9a2b1537ed4ba9c2c37bb6..03162bac2cbc192bdb9b14f1e8f30fdb867963f7 100644 (file)
@@ -71,23 +71,8 @@ __all__ = [
 
 def engine_descriptors():
     """Provide a listing of all the database implementations supported.
-
-    This data is provided as a list of dictionaries, where each
-    dictionary contains the following key/value pairs:
-
-    name
-      the name of the engine, suitable for use in the create_engine function
-
-    description
-      a plain description of the engine.
-
-    arguments
-      a dictionary describing the name and description of each
-      parameter used to connect to this engine's underlying DB-API.
-
-    This function is meant for usage in automated configuration tools
-    that wish to query the user for database and connection
-    information.
+    
+    deprecated - this method will be removed in 0.5.
     """
 
     result = []
@@ -96,6 +81,8 @@ def engine_descriptors():
             __import__('sqlalchemy.databases.%s' % module).databases, module)
         result.append(module.descriptor())
     return result
+engine_descriptors = util.deprecated(engine_descriptors)
+
 
 default_strategy = 'plain'
 def create_engine(*args, **kwargs):
index 663819f052e740110bb9a56e47cd6a23ae76f52c..7364f0227ca82f6dd739c273837803a539debc5b 100644 (file)
@@ -87,25 +87,17 @@ class URL(object):
             
     def get_dialect(self):
         """Return the SQLAlchemy database dialect class corresponding to this URL's driver name."""
-        dialect=None
-        if self.drivername == 'ansi':
-            import sqlalchemy.ansisql
-            return sqlalchemy.ansisql.dialect
-
+        
         try:
-            module=getattr(__import__('sqlalchemy.databases.%s' % self.drivername).databases, self.drivername)
-            dialect=module.dialect
+            module = getattr(__import__('sqlalchemy.databases.%s' % self.drivername).databases, self.drivername)
+            return module.dialect
         except ImportError:
             if sys.exc_info()[2].tb_next is None:
                 import pkg_resources
                 for res in pkg_resources.iter_entry_points('sqlalchemy.databases'):
-                    if res.name==self.drivername:
-                        dialect=res.load()
-            else:
-               raise
-        if dialect is not None:
-            return dialect
-        raise ImportError('unknown database %r' % self.drivername) 
+                    if res.name == self.drivername:
+                        return res.load()
+            raise
   
     def translate_connect_args(self, names=[], **kw):
         """Translate url attributes into a dictionary of connection arguments.