diff options
author | Brian Jarrett <celttechie@gmail.com> | 2014-07-10 16:28:49 -0600 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-07-13 20:10:55 -0400 |
commit | 28dd15081db4b7e978fa7a187c3aef1c0e4ad4e3 (patch) | |
tree | af5aeebb0cece4afc8e12e3329d3f75715bf32a2 /lib/sqlalchemy/engine/url.py | |
parent | 0190ede10767ed455255067cac2d309f070cf70c (diff) | |
download | sqlalchemy-28dd15081db4b7e978fa7a187c3aef1c0e4ad4e3.tar.gz |
PEP8 style fixes
Diffstat (limited to 'lib/sqlalchemy/engine/url.py')
-rw-r--r-- | lib/sqlalchemy/engine/url.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py index 7d61968b9..e3629613f 100644 --- a/lib/sqlalchemy/engine/url.py +++ b/lib/sqlalchemy/engine/url.py @@ -25,8 +25,8 @@ class URL(object): Represent the components of a URL used to connect to a database. This object is suitable to be passed directly to a - :func:`~sqlalchemy.create_engine` call. The fields of the URL are parsed from a - string by the :func:`.make_url` function. the string + :func:`~sqlalchemy.create_engine` call. The fields of the URL are parsed + from a string by the :func:`.make_url` function. the string format of the URL is an RFC-1738-style string. All initialization parameters are available as public attributes. @@ -119,8 +119,8 @@ class URL(object): # would return a module with 'dialect' as the # actual class if hasattr(cls, 'dialect') and \ - isinstance(cls.dialect, type) and \ - issubclass(cls.dialect, Dialect): + isinstance(cls.dialect, type) and \ + issubclass(cls.dialect, Dialect): return cls.dialect else: return cls @@ -189,7 +189,8 @@ def _parse_rfc1738_args(name): if components['database'] is not None: tokens = components['database'].split('?', 2) components['database'] = tokens[0] - query = (len(tokens) > 1 and dict(util.parse_qsl(tokens[1]))) or None + query = ( + len(tokens) > 1 and dict(util.parse_qsl(tokens[1]))) or None if util.py2k and query is not None: query = dict((k.encode('ascii'), query[k]) for k in query) else: @@ -215,9 +216,11 @@ def _parse_rfc1738_args(name): def _rfc_1738_quote(text): return re.sub(r'[:@/]', lambda m: "%%%X" % ord(m.group(0)), text) + def _rfc_1738_unquote(text): return util.unquote(text) + def _parse_keyvalue_args(name): m = re.match(r'(\w+)://(.*)', name) if m is not None: |