bump version

This commit is contained in:
INADA Naoki
2016-01-10 14:38:52 +09:00
parent 13fe3ff697
commit 302c679b4c
4 changed files with 19 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
''' """
PyMySQL: A pure-Python MySQL client library. PyMySQL: A pure-Python MySQL client library.
Copyright (c) 2010, 2013 PyMySQL contributors Copyright (c) 2010-2016 PyMySQL contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -20,12 +20,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
"""
import sys
''' from ._compat import PY2
VERSION = (0, 6, 7, None)
from ._compat import text_type, JYTHON, IRONPYTHON, PY2
from .constants import FIELD_TYPE from .constants import FIELD_TYPE
from .converters import escape_dict, escape_sequence, escape_string from .converters import escape_dict, escape_sequence, escape_string
from .err import Warning, Error, InterfaceError, DataError, \ from .err import Warning, Error, InterfaceError, DataError, \
@@ -34,16 +32,15 @@ from .err import Warning, Error, InterfaceError, DataError, \
from .times import Date, Time, Timestamp, \ from .times import Date, Time, Timestamp, \
DateFromTicks, TimeFromTicks, TimestampFromTicks DateFromTicks, TimeFromTicks, TimestampFromTicks
import sys
VERSION = (0, 7, 0, None)
threadsafety = 1 threadsafety = 1
apilevel = "2.0" apilevel = "2.0"
paramstyle = "format" paramstyle = "pyformat"
class DBAPISet(frozenset): class DBAPISet(frozenset):
def __ne__(self, other): def __ne__(self, other):
if isinstance(other, set): if isinstance(other, set):
return frozenset.__ne__(self, other) return frozenset.__ne__(self, other)
@@ -73,15 +70,15 @@ TIMESTAMP = DBAPISet([FIELD_TYPE.TIMESTAMP, FIELD_TYPE.DATETIME])
DATETIME = TIMESTAMP DATETIME = TIMESTAMP
ROWID = DBAPISet() ROWID = DBAPISet()
def Binary(x): def Binary(x):
"""Return x as a binary type.""" """Return x as a binary type."""
if isinstance(x, text_type) and not (JYTHON or IRONPYTHON):
x = x.encode()
if PY2: if PY2:
return bytearray(x) return bytearray(x)
else: else:
return bytes(x) return bytes(x)
def Connect(*args, **kwargs): def Connect(*args, **kwargs):
""" """
Connect to the database; see connections.Connection.__init__() for Connect to the database; see connections.Connection.__init__() for
@@ -92,11 +89,10 @@ def Connect(*args, **kwargs):
from pymysql import connections as _orig_conn from pymysql import connections as _orig_conn
if _orig_conn.Connection.__init__.__doc__ is not None: if _orig_conn.Connection.__init__.__doc__ is not None:
Connect.__doc__ = _orig_conn.Connection.__init__.__doc__ + (""" Connect.__doc__ = _orig_conn.Connection.__init__.__doc__
See connections.Connection.__init__() for information about defaults.
""")
del _orig_conn del _orig_conn
def get_client_info(): # for MySQLdb compatibility def get_client_info(): # for MySQLdb compatibility
return '.'.join(map(str, VERSION)) return '.'.join(map(str, VERSION))
@@ -110,7 +106,7 @@ NULL = "NULL"
__version__ = get_client_info() __version__ = get_client_info()
def thread_safe(): def thread_safe():
return True # match MySQLdb.thread_safe() return True # match MySQLdb.thread_safe()
def install_as_MySQLdb(): def install_as_MySQLdb():
""" """
@@ -119,6 +115,7 @@ def install_as_MySQLdb():
""" """
sys.modules["MySQLdb"] = sys.modules["_mysql"] = sys.modules["pymysql"] sys.modules["MySQLdb"] = sys.modules["_mysql"] = sys.modules["pymysql"]
__all__ = [ __all__ = [
'BINARY', 'Binary', 'Connect', 'Connection', 'DATE', 'Date', 'BINARY', 'Binary', 'Connect', 'Connection', 'DATE', 'Date',
'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks', 'TimestampFromTicks', 'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks', 'TimestampFromTicks',
@@ -131,6 +128,5 @@ __all__ = [
'paramstyle', 'threadsafety', 'version_info', 'paramstyle', 'threadsafety', 'version_info',
"install_as_MySQLdb", "install_as_MySQLdb",
"NULL", "__version__",
"NULL","__version__", ]
]

View File

@@ -521,7 +521,6 @@ class Connection(object):
The proper way to get an instance of this class is to call The proper way to get an instance of this class is to call
connect(). connect().
""" """
socket = None socket = None

View File

@@ -4,4 +4,4 @@ universal = 1
[flake8] [flake8]
ignore = E226,E301,E701 ignore = E226,E301,E701
exclude = tests,build exclude = tests,build
max-line-length = 99 max-line-length = 119

View File

@@ -16,12 +16,11 @@ setup(
author_email='yutaka.matsubara@gmail.com', author_email='yutaka.matsubara@gmail.com',
maintainer='INADA Naoki', maintainer='INADA Naoki',
maintainer_email='songofacandy@gmail.com', maintainer_email='songofacandy@gmail.com',
description='Pure-Python MySQL Driver', description='Pure Python MySQL Driver',
license="MIT", license="MIT",
packages=find_packages(), packages=find_packages(),
classifiers=[ classifiers=[
'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.3',
@@ -33,5 +32,5 @@ setup(
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License', 'License :: OSI Approved :: MIT License',
'Topic :: Database', 'Topic :: Database',
] ],
) )