Django

Code

Changeset 5983

Show
Ignore:
Timestamp:
08/19/07 22:32:06 (1 year ago)
Author:
adrian
Message:

Made various negligible formatting cleanups to the database backends

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/backends/ado_mssql/base.py

    r5982 r5983  
    1010except ImportError, e: 
    1111    from django.core.exceptions import ImproperlyConfigured 
    12     raise ImproperlyConfigured, "Error loading adodbapi module: %s" % e 
     12    raise ImproperlyConfigured("Error loading adodbapi module: %s" % e) 
    1313import datetime 
    1414try: 
  • django/trunk/django/db/backends/dummy/base.py

    r5982 r5983  
    3838 
    3939    def close(self): 
    40         pass # close() 
     40        pass 
  • django/trunk/django/db/backends/mysql/base.py

    r5982 r5983  
    1010except ImportError, e: 
    1111    from django.core.exceptions import ImproperlyConfigured 
    12     raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e 
     12    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) 
    1313 
    1414# We want version (1, 2, 1, 'final', 2) or later. We can't just use 
     
    1818if (version < (1,2,1) or (version[:3] == (1, 2, 1) and 
    1919        (len(version) < 5 or version[3] != 'final' or version[4] < 2))): 
    20     raise ImportError, "MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__ 
     20    raise ImportError("MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__) 
    2121 
    2222from MySQLdb.converters import conversions 
  • django/trunk/django/db/backends/mysql_old/base.py

    r5982 r5983  
    1111except ImportError, e: 
    1212    from django.core.exceptions import ImproperlyConfigured 
    13     raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e 
     13    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) 
    1414from MySQLdb.converters import conversions 
    1515from MySQLdb.constants import FIELD_TYPE 
     
    4949        except Database.Warning, w: 
    5050            self.cursor.execute("SHOW WARNINGS") 
    51             raise Database.Warning, "%s: %s" % (w, self.cursor.fetchall()) 
     51            raise Database.Warning("%s: %s" % (w, self.cursor.fetchall())) 
    5252 
    5353    def executemany(self, sql, param_list): 
     
    5656        except Database.Warning, w: 
    5757            self.cursor.execute("SHOW WARNINGS") 
    58             raise Database.Warning, "%s: %s" % (w, self.cursor.fetchall()) 
     58            raise Database.Warning("%s: %s" % (w, self.cursor.fetchall())) 
    5959 
    6060    def __getattr__(self, attr): 
  • django/trunk/django/db/backends/oracle/base.py

    r5982 r5983  
    1717except ImportError, e: 
    1818    from django.core.exceptions import ImproperlyConfigured 
    19     raise ImproperlyConfigured, "Error loading cx_Oracle module: %s" % e 
     19    raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e) 
    2020 
    2121DatabaseError = Database.Error 
     
    114114                    raise StopIteration 
    115115                if not full_query: 
    116                     full_query = "SELECT %s%s\n%s" % \ 
    117                                  ((self._distinct and "DISTINCT " or ""), 
    118                                   ', '.join(select), sql) 
     116                    full_query = "SELECT %s%s\n%s" % ((self._distinct and "DISTINCT " or ""), ', '.join(select), sql) 
    119117 
    120118                cursor = connection.cursor() 
  • django/trunk/django/db/backends/postgresql/base.py

    r5982 r5983  
    1212except ImportError, e: 
    1313    from django.core.exceptions import ImproperlyConfigured 
    14     raise ImproperlyConfigured, "Error loading psycopg module: %s" % e 
     14    raise ImproperlyConfigured("Error loading psycopg module: %s" % e) 
    1515 
    1616DatabaseError = Database.DatabaseError 
     
    8686            if settings.DATABASE_NAME == '': 
    8787                from django.core.exceptions import ImproperlyConfigured 
    88                 raise ImproperlyConfigured, "You need to specify DATABASE_NAME in your Django settings file." 
     88                raise ImproperlyConfigured("You need to specify DATABASE_NAME in your Django settings file.") 
    8989            conn_string = "dbname=%s" % settings.DATABASE_NAME 
    9090            if settings.DATABASE_USER: 
     
    122122    Database.register_type(Database.new_type((1082,), "DATE", util.typecast_date)) 
    123123except AttributeError: 
    124     raise Exception, "You appear to be using psycopg version 2. Set your DATABASE_ENGINE to 'postgresql_psycopg2' instead of 'postgresql'." 
     124    raise Exception("You appear to be using psycopg version 2. Set your DATABASE_ENGINE to 'postgresql_psycopg2' instead of 'postgresql'.") 
    125125Database.register_type(Database.new_type((1083,1266), "TIME", util.typecast_time)) 
    126126Database.register_type(Database.new_type((1114,1184), "TIMESTAMP", util.typecast_timestamp)) 
  • django/trunk/django/db/backends/postgresql_psycopg2/base.py

    r5982 r5983  
    1212except ImportError, e: 
    1313    from django.core.exceptions import ImproperlyConfigured 
    14     raise ImproperlyConfigured, "Error loading psycopg2 module: %s" % e 
     14    raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) 
    1515 
    1616DatabaseError = Database.DatabaseError 
     
    4848            if settings.DATABASE_NAME == '': 
    4949                from django.core.exceptions import ImproperlyConfigured 
    50                 raise ImproperlyConfigured, "You need to specify DATABASE_NAME in your Django settings file." 
     50                raise ImproperlyConfigured("You need to specify DATABASE_NAME in your Django settings file.") 
    5151            conn_string = "dbname=%s" % settings.DATABASE_NAME 
    5252            if settings.DATABASE_USER: