- converted logger.warn() to warnings.warn()

- implemented #302
This commit is contained in:
Mike Bayer
2007-04-21 22:54:35 +00:00
parent 6296e343ea
commit 60571ea137
2 changed files with 11 additions and 4 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sys, StringIO, string, re
import sys, StringIO, string, re, warnings
from sqlalchemy import util, sql, engine, schema, ansisql, exceptions, logging
from sqlalchemy.engine import default, base
@@ -391,7 +391,7 @@ class OracleDialect(ansisql.ANSIDialect):
fks[cons_name] = fk
if remote_table is None:
# ticket 363
self.logger.warn("Got 'None' querying 'table_name' from all_cons_columns%(dblink)s - does the user have proper rights to the table?" % {'dblink':dblink})
warnings.warn("Got 'None' querying 'table_name' from all_cons_columns%(dblink)s - does the user have proper rights to the table?" % {'dblink':dblink})
continue
refspec = ".".join([remote_table, remote_column])
schema.Table(remote_table, table.metadata, autoload=True, autoload_with=connection, owner=remote_owner)
+9 -2
View File
@@ -10,8 +10,8 @@ import sys, StringIO, string, types, re
from sqlalchemy import sql, engine, schema, ansisql, exceptions, pool, PassiveDefault
import sqlalchemy.engine.default as default
import sqlalchemy.types as sqltypes
import datetime,time, warnings
import sqlalchemy.util as util
import datetime,time
class SLNumeric(sqltypes.Numeric):
@@ -143,12 +143,19 @@ class SQLiteExecutionContext(default.DefaultExecutionContext):
super(SQLiteExecutionContext, self).post_exec()
class SQLiteDialect(ansisql.ANSIDialect):
def __init__(self, **kwargs):
ansisql.ANSIDialect.__init__(self, default_paramstyle='qmark', **kwargs)
def vers(num):
return tuple([int(x) for x in num.split('.')])
self.supports_cast = (self.dbapi is None or vers(self.dbapi.sqlite_version) >= vers("3.2.3"))
if self.dbapi is not None:
sqlite_ver = self.dbapi.version_info
if sqlite_ver < (2,2) and sqlite_ver != (2,1,'3'):
warnings.warn(RuntimeWarning("The installed version of pysqlite2 is out-dated, and will cause errors in some cases. Version 2.1.3 or greater is recommended."))
if vers(self.dbapi.sqlite_version) < vers("3.3.13"):
warnings.warn(RuntimeWarning("The installed version of sqlite is out-dated, and will cause errors in some cases. Version 3.3.13 or greater is recommended."))
def dbapi(cls):
try:
from pysqlite2 import dbapi2 as sqlite