diff options
Diffstat (limited to 'lib')
28 files changed, 97 insertions, 108 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/__init__.py b/lib/sqlalchemy/dialects/mysql/__init__.py index b55a84a1b..d0e4160e4 100644 --- a/lib/sqlalchemy/dialects/mysql/__init__.py +++ b/lib/sqlalchemy/dialects/mysql/__init__.py @@ -4,14 +4,14 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -from sqlalchemy.dialects.mysql import base, mysqldb, oursql, \ +from . import base, mysqldb, oursql, \ pyodbc, zxjdbc, mysqlconnector, pymysql,\ gaerdbms # default dialect base.dialect = mysqldb.dialect -from sqlalchemy.dialects.mysql.base import \ +from .base import \ BIGINT, BINARY, BIT, BLOB, BOOLEAN, CHAR, DATE, DATETIME, \ DECIMAL, DOUBLE, ENUM, DECIMAL,\ FLOAT, INTEGER, INTEGER, LONGBLOB, LONGTEXT, MEDIUMBLOB, \ diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index ff1cf625c..d8bef2d4b 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -281,24 +281,25 @@ http://dev.mysql.com/doc/refman/5.0/en/create-table.html """ -import datetime, inspect, re, sys - -from sqlalchemy import schema as sa_schema -from sqlalchemy import exc, log, sql, util -from sqlalchemy.sql import operators as sql_operators -from sqlalchemy.sql import functions as sql_functions -from sqlalchemy.sql import compiler +import datetime +import inspect +import re +import sys + +from ... import schema as sa_schema +from ... import exc, log, sql, util +from ...sql import compiler from array import array as _array -from sqlalchemy.engine import reflection -from sqlalchemy.engine import base as engine_base, default -from sqlalchemy import types as sqltypes -from sqlalchemy.util import topological -from sqlalchemy.types import DATE, DATETIME, BOOLEAN, TIME, \ +from ...engine import reflection +from ...engine import default +from ... import types as sqltypes +from ...util import topological +from ...types import DATE, DATETIME, BOOLEAN, TIME, \ BLOB, BINARY, VARBINARY RESERVED_WORDS = set( - ['accessible', 'add', 'all', 'alter', 'analyze','and', 'as', 'asc', + ['accessible', 'add', 'all', 'alter', 'analyze', 'and', 'as', 'asc', 'asensitive', 'before', 'between', 'bigint', 'binary', 'blob', 'both', 'by', 'call', 'cascade', 'case', 'change', 'char', 'character', 'check', 'collate', 'column', 'condition', 'constraint', 'continue', 'convert', diff --git a/lib/sqlalchemy/dialects/mysql/gaerdbms.py b/lib/sqlalchemy/dialects/mysql/gaerdbms.py index 0fe5d635a..a56d4b791 100644 --- a/lib/sqlalchemy/dialects/mysql/gaerdbms.py +++ b/lib/sqlalchemy/dialects/mysql/gaerdbms.py @@ -32,8 +32,8 @@ default. """ -from sqlalchemy.dialects.mysql.mysqldb import MySQLDialect_mysqldb -from sqlalchemy.pool import NullPool +from .mysqldb import MySQLDialect_mysqldb +from ...pool import NullPool import re @@ -50,7 +50,7 @@ class MySQLDialect_gaerdbms(MySQLDialect_mysqldb): return NullPool def create_connect_args(self, url): - return [[],{'database':url.database}] + return [[], {'database': url.database}] def _extract_error_code(self, exception): match = re.compile(r"^(\d+):").match(str(exception)) diff --git a/lib/sqlalchemy/dialects/mysql/mysqlconnector.py b/lib/sqlalchemy/dialects/mysql/mysqlconnector.py index be99367be..9aa4b3922 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqlconnector.py +++ b/lib/sqlalchemy/dialects/mysql/mysqlconnector.py @@ -19,16 +19,11 @@ Connect string format:: """ -import re - -from sqlalchemy.dialects.mysql.base import (MySQLDialect, +from .base import (MySQLDialect, MySQLExecutionContext, MySQLCompiler, MySQLIdentifierPreparer, BIT) -from sqlalchemy.engine import base as engine_base, default -from sqlalchemy.sql import operators as sql_operators -from sqlalchemy import exc, log, schema, sql, types as sqltypes, util -from sqlalchemy import processors +from ... import util class MySQLExecutionContext_mysqlconnector(MySQLExecutionContext): diff --git a/lib/sqlalchemy/dialects/mysql/mysqldb.py b/lib/sqlalchemy/dialects/mysql/mysqldb.py index 240f30251..21b87a018 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqldb.py +++ b/lib/sqlalchemy/dialects/mysql/mysqldb.py @@ -54,9 +54,9 @@ It is strongly advised to use the latest version of MySQL-Python. """ -from sqlalchemy.dialects.mysql.base import (MySQLDialect, MySQLExecutionContext, +from .base import (MySQLDialect, MySQLExecutionContext, MySQLCompiler, MySQLIdentifierPreparer) -from sqlalchemy.connectors.mysqldb import ( +from ...connectors.mysqldb import ( MySQLDBExecutionContext, MySQLDBCompiler, MySQLDBIdentifierPreparer, diff --git a/lib/sqlalchemy/dialects/mysql/oursql.py b/lib/sqlalchemy/dialects/mysql/oursql.py index 8f7bebe9c..7a51c9e4e 100644 --- a/lib/sqlalchemy/dialects/mysql/oursql.py +++ b/lib/sqlalchemy/dialects/mysql/oursql.py @@ -40,12 +40,8 @@ defaults to, there is a separate parameter:: import re -from sqlalchemy.dialects.mysql.base import (BIT, MySQLDialect, MySQLExecutionContext, - MySQLCompiler, MySQLIdentifierPreparer) -from sqlalchemy.engine import base as engine_base, default -from sqlalchemy.sql import operators as sql_operators -from sqlalchemy import exc, log, schema, sql, types as sqltypes, util -from sqlalchemy import processors +from .base import (BIT, MySQLDialect, MySQLExecutionContext) +from ... import types as sqltypes, util diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py index 8387dfecb..71548880c 100644 --- a/lib/sqlalchemy/dialects/mysql/pymysql.py +++ b/lib/sqlalchemy/dialects/mysql/pymysql.py @@ -26,7 +26,7 @@ the pymysql driver as well. """ -from sqlalchemy.dialects.mysql.mysqldb import MySQLDialect_mysqldb +from .mysqldb import MySQLDialect_mysqldb class MySQLDialect_pymysql(MySQLDialect_mysqldb): driver = 'pymysql' diff --git a/lib/sqlalchemy/dialects/mysql/pyodbc.py b/lib/sqlalchemy/dialects/mysql/pyodbc.py index 6271286f9..03906f8c9 100644 --- a/lib/sqlalchemy/dialects/mysql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mysql/pyodbc.py @@ -27,10 +27,9 @@ of OurSQL, MySQLdb, or MySQL-connector/Python. """ -from sqlalchemy.dialects.mysql.base import MySQLDialect, MySQLExecutionContext -from sqlalchemy.connectors.pyodbc import PyODBCConnector -from sqlalchemy.engine import base as engine_base -from sqlalchemy import util +from .base import MySQLDialect, MySQLExecutionContext +from ...connectors.pyodbc import PyODBCConnector +from ... import util import re class MySQLExecutionContext_pyodbc(MySQLExecutionContext): diff --git a/lib/sqlalchemy/dialects/mysql/zxjdbc.py b/lib/sqlalchemy/dialects/mysql/zxjdbc.py index 816e10bae..d25444cd0 100644 --- a/lib/sqlalchemy/dialects/mysql/zxjdbc.py +++ b/lib/sqlalchemy/dialects/mysql/zxjdbc.py @@ -31,9 +31,9 @@ overriden via a ``create_engine`` URL parameter. """ import re -from sqlalchemy import types as sqltypes, util -from sqlalchemy.connectors.zxJDBC import ZxJDBCConnector -from sqlalchemy.dialects.mysql.base import BIT, MySQLDialect, MySQLExecutionContext +from ... import types as sqltypes, util +from ...connectors.zxJDBC import ZxJDBCConnector +from .base import BIT, MySQLDialect, MySQLExecutionContext class _ZxJDBCBit(BIT): def result_processor(self, dialect, coltype): diff --git a/lib/sqlalchemy/dialects/postgresql/__init__.py b/lib/sqlalchemy/dialects/postgresql/__init__.py index 339634020..f36d71b2b 100644 --- a/lib/sqlalchemy/dialects/postgresql/__init__.py +++ b/lib/sqlalchemy/dialects/postgresql/__init__.py @@ -4,11 +4,11 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -from sqlalchemy.dialects.postgresql import base, psycopg2, pg8000, pypostgresql, zxjdbc +from . import base, psycopg2, pg8000, pypostgresql, zxjdbc base.dialect = psycopg2.dialect -from sqlalchemy.dialects.postgresql.base import \ +from .base import \ INTEGER, BIGINT, SMALLINT, VARCHAR, CHAR, TEXT, NUMERIC, FLOAT, REAL, INET, \ CIDR, UUID, BIT, MACADDR, DOUBLE_PRECISION, TIMESTAMP, TIME,\ DATE, BYTEA, BOOLEAN, INTERVAL, ARRAY, ENUM, dialect diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index c13e0e1b3..d779935ce 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -190,10 +190,10 @@ version of PostgreSQL. import re -from sqlalchemy import sql, schema, exc, util -from sqlalchemy.engine import default, reflection -from sqlalchemy.sql import compiler, expression, util as sql_util -from sqlalchemy import types as sqltypes +from ... import sql, schema, exc, util +from ...engine import default, reflection +from ...sql import compiler, expression, util as sql_util +from ... import types as sqltypes try: from uuid import UUID as _python_UUID diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index 9a65bf08f..cd9048613 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -27,11 +27,11 @@ Passing data from/to the Interval type is not supported as of yet. """ -from sqlalchemy import util, exc -from sqlalchemy.util.compat import decimal -from sqlalchemy import processors -from sqlalchemy import types as sqltypes -from sqlalchemy.dialects.postgresql.base import PGDialect, \ +from ... import util, exc +from ...util.compat import decimal +from ... import processors +from ... import types as sqltypes +from .base import PGDialect, \ PGCompiler, PGIdentifierPreparer, PGExecutionContext,\ _DECIMAL_TYPES, _FLOAT_TYPES, _INT_TYPES diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 8976ca990..491bd5c60 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -144,13 +144,13 @@ The psycopg2 dialect will log Postgresql NOTICE messages via the import re import logging -from sqlalchemy import util, exc -from sqlalchemy.util.compat import decimal -from sqlalchemy import processors -from sqlalchemy.engine import base -from sqlalchemy.sql import expression -from sqlalchemy import types as sqltypes -from sqlalchemy.dialects.postgresql.base import PGDialect, PGCompiler, \ +from ... import util, exc +from ...util.compat import decimal +from ... import processors +from ...engine import base +from ...sql import expression +from ... import types as sqltypes +from .base import PGDialect, PGCompiler, \ PGIdentifierPreparer, PGExecutionContext, \ ENUM, ARRAY, _DECIMAL_TYPES, _FLOAT_TYPES,\ _INT_TYPES diff --git a/lib/sqlalchemy/dialects/postgresql/pypostgresql.py b/lib/sqlalchemy/dialects/postgresql/pypostgresql.py index 14ede40a5..a1ba9a3bd 100644 --- a/lib/sqlalchemy/dialects/postgresql/pypostgresql.py +++ b/lib/sqlalchemy/dialects/postgresql/pypostgresql.py @@ -13,10 +13,10 @@ URLs are of the form ``postgresql+pypostgresql://user:password@host:port/dbname[ """ -from sqlalchemy import util -from sqlalchemy import types as sqltypes -from sqlalchemy.dialects.postgresql.base import PGDialect, PGExecutionContext -from sqlalchemy import processors +from ... import util +from ... import types as sqltypes +from .base import PGDialect, PGExecutionContext +from ... import processors class PGNumeric(sqltypes.Numeric): def bind_processor(self, dialect): diff --git a/lib/sqlalchemy/dialects/postgresql/zxjdbc.py b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py index 17969954a..8382da831 100644 --- a/lib/sqlalchemy/dialects/postgresql/zxjdbc.py +++ b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py @@ -12,8 +12,8 @@ JDBC Driver The official Postgresql JDBC driver is at http://jdbc.postgresql.org/. """ -from sqlalchemy.connectors.zxJDBC import ZxJDBCConnector -from sqlalchemy.dialects.postgresql.base import PGDialect, PGExecutionContext +from ...connectors.zxJDBC import ZxJDBCConnector +from .base import PGDialect, PGExecutionContext class PGExecutionContext_zxjdbc(PGExecutionContext): diff --git a/lib/sqlalchemy/engine/__init__.py b/lib/sqlalchemy/engine/__init__.py index 500dd0dba..038e37ad9 100644 --- a/lib/sqlalchemy/engine/__init__.py +++ b/lib/sqlalchemy/engine/__init__.py @@ -53,7 +53,7 @@ url.py # not sure what this was used for #import sqlalchemy.databases -from sqlalchemy.engine.base import ( +from .base import ( BufferedColumnResultProxy, BufferedColumnRow, BufferedRowResultProxy, @@ -71,8 +71,8 @@ from sqlalchemy.engine.base import ( TwoPhaseTransaction, TypeCompiler ) -from sqlalchemy.engine import strategies -from sqlalchemy import util +from . import strategies +from .. import util __all__ = ( diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index d0c4ae348..e39420771 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -14,18 +14,18 @@ and result contexts. __all__ = [ 'BufferedColumnResultProxy', 'BufferedColumnRow', - 'BufferedRowResultProxy','Compiled', 'Connectable', 'Connection', - 'Dialect', 'Engine','ExecutionContext', 'NestedTransaction', - 'ResultProxy', 'RootTransaction','RowProxy', 'SchemaIterator', + 'BufferedRowResultProxy', 'Compiled', 'Connectable', 'Connection', + 'Dialect', 'Engine', 'ExecutionContext', 'NestedTransaction', + 'ResultProxy', 'RootTransaction', 'RowProxy', 'StringIO', 'Transaction', 'TwoPhaseTransaction', 'connection_memoize'] -import inspect, StringIO, sys, operator +import StringIO +import sys from itertools import izip, chain -from sqlalchemy import exc, schema, util, types, log, interfaces, \ +from .. import exc, schema, util, types, log, interfaces, \ event, events -from sqlalchemy.sql import expression, util as sql_util -from sqlalchemy import processors +from ..sql import expression, util as sql_util import collections class Dialect(object): diff --git a/lib/sqlalchemy/engine/ddl.py b/lib/sqlalchemy/engine/ddl.py index c3b32505e..f95e549b0 100644 --- a/lib/sqlalchemy/engine/ddl.py +++ b/lib/sqlalchemy/engine/ddl.py @@ -6,8 +6,8 @@ """Routines to handle CREATE/DROP workflow.""" -from sqlalchemy import engine, schema -from sqlalchemy.sql import util as sql_util +from .. import schema +from ..sql import util as sql_util class DDLBase(schema.SchemaVisitor): diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 38856b49e..bdba7caed 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -12,10 +12,11 @@ as the base class for their own corresponding classes. """ -import re, random -from sqlalchemy.engine import base, reflection -from sqlalchemy.sql import compiler, expression -from sqlalchemy import exc, types as sqltypes, util, pool, processors +import re +import random +from . import base, reflection +from ..sql import compiler, expression +from .. import exc, types as sqltypes, util, pool, processors import codecs import weakref diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index e1d702146..f991a4acd 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -24,15 +24,14 @@ methods such as get_table_names, get_columns, etc. 'name' attribute.. """ -import sqlalchemy -from sqlalchemy import exc, sql -from sqlalchemy import schema as sa_schema -from sqlalchemy import util -from sqlalchemy.types import TypeEngine -from sqlalchemy.util import deprecated -from sqlalchemy.util import topological -from sqlalchemy import inspection -from sqlalchemy.engine.base import Connectable +from .. import exc, sql +from .. import schema as sa_schema +from .. import util +from ..types import TypeEngine +from ..util import deprecated +from ..util import topological +from .. import inspection +from .base import Connectable @util.decorator def cache(fn, self, con, *args, **kw): diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py index 5bbdb9d65..c1c02bb29 100644 --- a/lib/sqlalchemy/engine/url.py +++ b/lib/sqlalchemy/engine/url.py @@ -12,9 +12,10 @@ with a string argument; alternatively, the URL is a public-facing construct whic be used directly and is also accepted directly by ``create_engine()``. """ -import re, urllib -from sqlalchemy import exc, util -from sqlalchemy.engine import base +import re +import urllib +from .. import exc, util +from . import base class URL(object): diff --git a/lib/sqlalchemy/util/__init__.py b/lib/sqlalchemy/util/__init__.py index 65a06c28d..b6e188583 100644 --- a/lib/sqlalchemy/util/__init__.py +++ b/lib/sqlalchemy/util/__init__.py @@ -4,12 +4,12 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -from compat import callable, cmp, reduce, defaultdict, py25_dict, \ +from .compat import callable, cmp, reduce, defaultdict, py25_dict, \ threading, py3k_warning, jython, pypy, win32, set_types, buffer, pickle, \ update_wrapper, partial, md5_hex, decode_slice, dottedgetter,\ parse_qsl, any, contextmanager, namedtuple, next, WeakSet -from _collections import KeyedTuple, ImmutableContainer, immutabledict, \ +from ._collections import KeyedTuple, ImmutableContainer, immutabledict, \ Properties, OrderedProperties, ImmutableProperties, OrderedDict, \ OrderedSet, IdentitySet, OrderedIdentitySet, column_set, \ column_dict, ordered_column_set, populate_column_dict, unique_list, \ @@ -17,7 +17,7 @@ from _collections import KeyedTuple, ImmutableContainer, immutabledict, \ to_column_set, update_copy, flatten_iterator, \ LRUCache, ScopedRegistry, ThreadLocalRegistry, WeakSequence -from langhelpers import iterate_attributes, class_hierarchy, \ +from .langhelpers import iterate_attributes, class_hierarchy, \ portable_instancemethod, unbound_method_to_callable, \ getargspec_init, format_argspec_init, format_argspec_plus, \ get_func_kwargs, get_cls_kwargs, decorator, as_interface, \ @@ -29,6 +29,6 @@ from langhelpers import iterate_attributes, class_hierarchy, \ constructor_copy, methods_equivalent, chop_traceback, asint,\ generic_repr, counter, PluginLoader, hybridmethod -from deprecations import warn_deprecated, warn_pending_deprecation, \ +from .deprecations import warn_deprecated, warn_pending_deprecation, \ deprecated, pending_deprecation diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index af3be8ec3..38d62fa4f 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -10,8 +10,7 @@ import sys import itertools import weakref import operator -from langhelpers import symbol -from compat import time_func, threading +from .compat import threading EMPTY_SET = frozenset() diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index 9f8a3069d..f66024d0b 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -8,7 +8,6 @@ import sys - try: import threading except ImportError: diff --git a/lib/sqlalchemy/util/deprecations.py b/lib/sqlalchemy/util/deprecations.py index fc156f393..f1ff9a075 100644 --- a/lib/sqlalchemy/util/deprecations.py +++ b/lib/sqlalchemy/util/deprecations.py @@ -7,7 +7,7 @@ """Helpers related to deprecation of functions, methods, classes, other functionality.""" -from sqlalchemy import exc +from .. import exc import warnings import re from langhelpers import decorator diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index e9e8e35c2..83d851f65 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -15,9 +15,9 @@ import re import sys import types import warnings -from compat import update_wrapper, set_types, threading, \ - callable, inspect_getfullargspec, py3k_warning -from sqlalchemy import exc +from .compat import update_wrapper, set_types, threading, \ + callable, inspect_getfullargspec +from .. import exc def _unique_symbols(used, *bases): used = set(used) diff --git a/lib/sqlalchemy/util/queue.py b/lib/sqlalchemy/util/queue.py index 650733288..f7b35924c 100644 --- a/lib/sqlalchemy/util/queue.py +++ b/lib/sqlalchemy/util/queue.py @@ -24,7 +24,7 @@ within QueuePool. from collections import deque from time import time as _time -from sqlalchemy.util import threading +from .compat import threading import sys if sys.version_info < (2, 6): diff --git a/lib/sqlalchemy/util/topological.py b/lib/sqlalchemy/util/topological.py index 58227af20..4baedecb2 100644 --- a/lib/sqlalchemy/util/topological.py +++ b/lib/sqlalchemy/util/topological.py @@ -6,9 +6,8 @@ """Topological sorting algorithms.""" -from sqlalchemy.exc import CircularDependencyError -from sqlalchemy import util - +from ..exc import CircularDependencyError +from .. import util __all__ = ['sort', 'sort_as_subsets', 'find_cycles'] |