[SQL-CVS] SQLObject development repository branch master updated. 2.1.0-174-g82df1ca
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <no...@so...> - 2015-02-11 20:24:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SQLObject development repository". The branch, master has been updated via 82df1caa6d872e8df1ce5bf2965f174fe6714a4d (commit) via 29c489240f337bc3d55ee452f0cb21d97a86995f (commit) via 9564667f87c5fe86dd4f9a0bf1076687eae9cca2 (commit) via 5d40100f43be3926f47060501f7754a1670971f0 (commit) via ef1b9c65417683526cf6d6c38b23be0d83591079 (commit) via df9ec6c26dff78a00a13a27783a704368eb462bc (commit) via 6f725c371b29aee1e77437d6c8ffc0c3d804323f (commit) via abe460e629471cee275989de348878b69941753c (commit) via 4ad16e0759cb3c8cc46d6f749ee3b8e48cb6c122 (commit) via f06bfc89cd5bffca6bf8a5be4afbf3b1cb784d9e (commit) via f3e919b0ce7cbee1079b402a54b40110750a44c9 (commit) from e2045eab8a1620ea3896b46a0011f7a1b81a7d96 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://sourceforge.net/p/sqlobject/sqlobject/ci/82df1caa6d872e8df1ce5bf2965f174fe6714a4d commit 82df1caa6d872e8df1ce5bf2965f174fe6714a4d Author: Oleg Broytman <ph...@ph...> Date: Wed Feb 11 23:09:44 2015 +0300 Fix #42 flake8 E124 closing bracket does not match visual indentation diff --git a/setup.cfg b/setup.cfg index 8ccf93b..2c8a0d8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,7 +12,6 @@ exclude = .git,docs/europython/*.py,ez_setup.py ; Ignore: ; E123 closing bracket does not match indentation of opening bracket's line -; E124 closing bracket does not match visual indentation ; E226 missing whitespace around arithmetic operator ; E401 multiple imports on one line ; F403 'from module import *' used; unable to detect undefined names @@ -20,7 +19,7 @@ exclude = .git,docs/europython/*.py,ez_setup.py ; F822 undefined name in __all__ ; W391 blank line at end of file ; W603 '<>' is deprecated, use '!=' -ignore = E123,E124,E226,E401,F403,F812,F822,W391,W603 +ignore = E123,E226,E401,F403,F812,F822,W391,W603 [pudge] theme = pythonpaste.org diff --git a/setup.py b/setup.py index 9045300..a356eb5 100755 --- a/setup.py +++ b/setup.py @@ -107,7 +107,7 @@ and `GitHub <https://github.com/sqlobject>`_. "../docs/html/sqlobject/versioning/*.html", ], "sqlobject.maxdb": ["readme.txt"], - }, + }, **kw ) diff --git a/sqlobject/inheritance/__init__.py b/sqlobject/inheritance/__init__.py index 32b609e..80cf52f 100644 --- a/sqlobject/inheritance/__init__.py +++ b/sqlobject/inheritance/__init__.py @@ -503,7 +503,7 @@ class InheritableSQLObject(SQLObject): [(column.foreignName, name) for (name, column) in currentClass.sqlmeta.columns.items() if column.foreignKey - ])) + ])) currentClass = currentClass.sqlmeta.parentClass for name, value in kw.items(): if name in foreignColumns: diff --git a/sqlobject/main.py b/sqlobject/main.py index 4aa2f71..1100769 100644 --- a/sqlobject/main.py +++ b/sqlobject/main.py @@ -1849,7 +1849,7 @@ def getObject(obj, klass): else: return obj -__all__ = ['NoDefault', 'SQLObject', - 'SQLObjectIntegrityError', 'SQLObjectNotFound', - 'getID', 'getObject', 'sqlhub', 'sqlmeta', - ] +__all__ = [ + 'NoDefault', 'SQLObject', 'SQLObjectIntegrityError', 'SQLObjectNotFound', + 'getID', 'getObject', 'sqlhub', 'sqlmeta', +] diff --git a/sqlobject/tests/dbtest.py b/sqlobject/tests/dbtest.py index 1102c80..5edf3f8 100644 --- a/sqlobject/tests/dbtest.py +++ b/sqlobject/tests/dbtest.py @@ -322,4 +322,4 @@ def setupLogging(): __all__ = ['Dummy', 'deprecated_module', 'getConnection', 'getConnectionURI', 'inserts', 'raises', 'setupClass', 'setupLogging', 'setup_module', 'supports', 'teardown_module', - ] + ] diff --git a/sqlobject/tests/test_default_style.py b/sqlobject/tests/test_default_style.py index 41162cf..1ce0f85 100644 --- a/sqlobject/tests/test_default_style.py +++ b/sqlobject/tests/test_default_style.py @@ -8,19 +8,21 @@ from sqlobject.styles import Style, MixedCaseUnderscoreStyle, MixedCaseStyle # Hash of styles versus the database names resulting from 'columns' below. columns = ["ABCUpper", "abc_lower", "ABCamelCaseColumn"] -styles = {Style: columns, - MixedCaseUnderscoreStyle: ["abc_upper", "abc_lower", - "ab_camel_case_column"], - MixedCaseStyle: ["ABCUpper", "Abc_lower", "ABCamelCaseColumn"], - } +styles = { + Style: columns, + MixedCaseUnderscoreStyle: ["abc_upper", "abc_lower", + "ab_camel_case_column"], + MixedCaseStyle: ["ABCUpper", "Abc_lower", "ABCamelCaseColumn"], +} # Hash of styles versus the database names # resulting from a foreign key named 'FKey'. fkey = ForeignKey("DefaultStyleTest", name="FKey") -fkeys = {Style: "FKeyID", - MixedCaseUnderscoreStyle: "f_key_id", - MixedCaseStyle: "FKeyID", - } +fkeys = { + Style: "FKeyID", + MixedCaseUnderscoreStyle: "f_key_id", + MixedCaseStyle: "FKeyID", +} def make_columns(): diff --git a/sqlobject/tests/test_sqlobject_admin.py b/sqlobject/tests/test_sqlobject_admin.py index be22e13..7debce3 100644 --- a/sqlobject/tests/test_sqlobject_admin.py +++ b/sqlobject/tests/test_sqlobject_admin.py @@ -13,8 +13,7 @@ class Test1(SQLObject): class Test2(SQLObject): class sqlmeta: createSQL = ["CREATE SEQUENCE db_test2_seq;", - "ALTER TABLE test2 ADD CHECK(test2 != '');" - ] + "ALTER TABLE test2 ADD CHECK(test2 != '');"] test2 = StringCol() @@ -28,8 +27,7 @@ class Test3(SQLObject): class Test4(SQLObject): class sqlmeta: createSQL = {'postgres': ['CREATE SEQUENCE db_test4_seq;', - "ALTER TABLE test4 ADD CHECK(test4 != '');" - ], + "ALTER TABLE test4 ADD CHECK(test4 != '');"], 'mysql': 'CREATE SEQUENCE db_test4_seq;'} test4 = StringCol() http://sourceforge.net/p/sqlobject/sqlobject/ci/29c489240f337bc3d55ee452f0cb21d97a86995f commit 29c489240f337bc3d55ee452f0cb21d97a86995f Merge: 5d40100 9564667 Author: Oleg Broytman <ph...@ph...> Date: Tue Feb 10 20:22:31 2015 +0300 Merge pull request #76 from drnlm/fix_binary_call sqlite3.Binary expects a bytes object on py3 http://sourceforge.net/p/sqlobject/sqlobject/ci/9564667f87c5fe86dd4f9a0bf1076687eae9cca2 commit 9564667f87c5fe86dd4f9a0bf1076687eae9cca2 Author: Neil <drn...@gm...> Date: Tue Feb 10 12:00:15 2015 +0200 sqlite3.Binary expects to be called with a bytes object on python 3 diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py index df5a28e..6fb6586 100644 --- a/sqlobject/dbconnection.py +++ b/sqlobject/dbconnection.py @@ -339,7 +339,7 @@ class DBAPI(DBConnection): self._pool = [] self._poolLock = threading.Lock() DBConnection.__init__(self, **kw) - self._binaryType = type(self.module.Binary('')) + self._binaryType = type(self.module.Binary(b'')) def _runWithConnection(self, meth, *args): conn = self.getConnection() http://sourceforge.net/p/sqlobject/sqlobject/ci/5d40100f43be3926f47060501f7754a1670971f0 commit 5d40100f43be3926f47060501f7754a1670971f0 Merge: ef1b9c6 6f725c3 Author: Oleg Broytman <ph...@ph...> Date: Tue Feb 10 19:16:30 2015 +0300 Merge pull request #75 from drnlm/issue_45_E228 Fix #45 flake8 E228 missing whitespace around %-operator http://sourceforge.net/p/sqlobject/sqlobject/ci/ef1b9c65417683526cf6d6c38b23be0d83591079 commit ef1b9c65417683526cf6d6c38b23be0d83591079 Merge: df9ec6c 4ad16e0 Author: Oleg Broytman <ph...@ph...> Date: Tue Feb 10 19:15:05 2015 +0300 Merge pull request #74 from drnlm/further_import_fixes Issue 3: Further import fixes http://sourceforge.net/p/sqlobject/sqlobject/ci/df9ec6c26dff78a00a13a27783a704368eb462bc commit df9ec6c26dff78a00a13a27783a704368eb462bc Merge: e2045ea abe460e Author: Oleg Broytman <ph...@ph...> Date: Tue Feb 10 19:14:24 2015 +0300 Merge pull request #73 from drnlm/drop_new Drop module new http://sourceforge.net/p/sqlobject/sqlobject/ci/6f725c371b29aee1e77437d6c8ffc0c3d804323f commit 6f725c371b29aee1e77437d6c8ffc0c3d804323f Author: Neil <drn...@gm...> Date: Tue Feb 10 16:37:46 2015 +0200 Fix E228 missing whitespace around modulo operator diff --git a/sqlobject/views.py b/sqlobject/views.py index 6193b77..4331b75 100644 --- a/sqlobject/views.py +++ b/sqlobject/views.py @@ -97,7 +97,7 @@ class ViewSQLObject(SQLObject): last_id = "id" last = Alias(select, last_alias) columns = [ - ColumnAS(SQLConstant("%s.%s"%(last_alias, x.expr2)), + ColumnAS(SQLConstant("%s.%s" % (last_alias, x.expr2)), x.expr2) for x in columns] for i, agg in enumerate(aggregates): @@ -108,7 +108,7 @@ class ViewSQLObject(SQLObject): restriction = AND(clause, restriction) agg = agg[1:] agg_alias = "%s_%s" % (alias, i) - agg_id = '%s_id'%agg_alias + agg_id = '%s_id' % agg_alias if not last.q.alias.endswith('base'): last = None new_alias = Alias(Select( @@ -126,7 +126,7 @@ class ViewSQLObject(SQLObject): for col in agg: columns.append( ColumnAS(SQLConstant( - "%s.%s"%(agg_alias, col.expr2)), + "%s.%s" % (agg_alias, col.expr2)), col.expr2)) last = new_alias http://sourceforge.net/p/sqlobject/sqlobject/ci/abe460e629471cee275989de348878b69941753c commit abe460e629471cee275989de348878b69941753c Author: Neil <drn...@gm...> Date: Tue Feb 10 11:12:05 2015 +0200 Support python 3 MethodType signature diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py index 4189368..df5a28e 100644 --- a/sqlobject/dbconnection.py +++ b/sqlobject/dbconnection.py @@ -828,8 +828,11 @@ class Transaction(object): if not cls in self._deletedCache: self._deletedCache[cls] = [] self._deletedCache[cls].append(inst.id) - meth = types.MethodType(self._dbConnection._SO_delete.im_func, - self, self.__class__) + if sys.version_info[0] < 3: + meth = types.MethodType(self._dbConnection._SO_delete.im_func, + self, self.__class__) + else: + meth = types.MethodType(self._dbConnection._SO_delete.im_func) return meth(inst) def commit(self, close=False): @@ -882,7 +885,10 @@ class Transaction(object): else: return attr else: - meth = types.MethodType(func, self, self.__class__) + if sys.version_info[0] < 3: + meth = types.MethodType(func, self, self.__class__) + else: + meth = types.MethodType(func, self) return meth def _makeObsolete(self): http://sourceforge.net/p/sqlobject/sqlobject/ci/4ad16e0759cb3c8cc46d6f749ee3b8e48cb6c122 commit 4ad16e0759cb3c8cc46d6f749ee3b8e48cb6c122 Author: Neil <drn...@gm...> Date: Mon Feb 9 22:49:30 2015 +0200 Import StringIO from io in python 3 diff --git a/sqlobject/tests/test_csvexport.py b/sqlobject/tests/test_csvexport.py index d0f3392..bd56a14 100644 --- a/sqlobject/tests/test_csvexport.py +++ b/sqlobject/tests/test_csvexport.py @@ -2,7 +2,10 @@ from __future__ import print_function from sqlobject import * from .dbtest import * -from StringIO import StringIO +try: + from StringIO import StringIO +except ImportError: + from io import StringIO from sqlobject.util.csvexport import export_csv, export_csv_zip diff --git a/sqlobject/util/csvexport.py b/sqlobject/util/csvexport.py index 0bdbf92..58afbb9 100644 --- a/sqlobject/util/csvexport.py +++ b/sqlobject/util/csvexport.py @@ -6,7 +6,10 @@ import csv try: from cStringIO import StringIO except ImportError: - from StringIO import StringIO + try: + from StringIO import StringIO + except ImportError: + from io import StringIO import sqlobject __all__ = ['export_csv', 'export_csv_zip'] http://sourceforge.net/p/sqlobject/sqlobject/ci/f06bfc89cd5bffca6bf8a5be4afbf3b1cb784d9e commit f06bfc89cd5bffca6bf8a5be4afbf3b1cb784d9e Author: Neil <drn...@gm...> Date: Mon Feb 9 22:44:14 2015 +0200 Fix more import statements diff --git a/sqlobject/tests/test_delete.py b/sqlobject/tests/test_delete.py index 63e3d4b..37bd3fd 100644 --- a/sqlobject/tests/test_delete.py +++ b/sqlobject/tests/test_delete.py @@ -1,6 +1,6 @@ from sqlobject import * from sqlobject.tests.dbtest import * -from test_basic import TestSO1, setupGetters +from .test_basic import TestSO1, setupGetters ######################################## diff --git a/sqlobject/tests/test_sqlite.py b/sqlobject/tests/test_sqlite.py index 3a4166e..ea5c3f5 100644 --- a/sqlobject/tests/test_sqlite.py +++ b/sqlobject/tests/test_sqlite.py @@ -3,7 +3,7 @@ import py.test from sqlobject import * from sqlobject.tests.dbtest import * from sqlobject.tests.dbtest import setSQLiteConnectionFactory -from test_basic import TestSO1 +from .test_basic import TestSO1 class SQLiteFactoryTest(SQLObject): diff --git a/sqlobject/views.py b/sqlobject/views.py index 6193b77..0ede35a 100644 --- a/sqlobject/views.py +++ b/sqlobject/views.py @@ -1,5 +1,5 @@ -from sqlbuilder import * -from main import SQLObject +from .sqlbuilder import * +from .main import SQLObject class ViewSQLObjectField(SQLObjectField): http://sourceforge.net/p/sqlobject/sqlobject/ci/f3e919b0ce7cbee1079b402a54b40110750a44c9 commit f3e919b0ce7cbee1079b402a54b40110750a44c9 Author: Neil <drn...@gm...> Date: Mon Feb 9 21:08:03 2015 +0200 Replace new with types module diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py index c51e226..4189368 100644 --- a/sqlobject/dbconnection.py +++ b/sqlobject/dbconnection.py @@ -1,10 +1,6 @@ import atexit import inspect import sys -if sys.version_info[0] < 3: - # Temporary workaround - will need more attention to fix - # usage of new in the code - import new import os import threading import types @@ -832,8 +828,8 @@ class Transaction(object): if not cls in self._deletedCache: self._deletedCache[cls] = [] self._deletedCache[cls].append(inst.id) - meth = new.instancemethod(self._dbConnection._SO_delete.im_func, - self, self.__class__) + meth = types.MethodType(self._dbConnection._SO_delete.im_func, + self, self.__class__) return meth(inst) def commit(self, close=False): @@ -886,7 +882,7 @@ class Transaction(object): else: return attr else: - meth = new.instancemethod(func, self, self.__class__) + meth = types.MethodType(func, self, self.__class__) return meth def _makeObsolete(self): ----------------------------------------------------------------------- Summary of changes: setup.cfg | 3 +-- setup.py | 2 +- sqlobject/dbconnection.py | 18 ++++++++++-------- sqlobject/inheritance/__init__.py | 2 +- sqlobject/main.py | 8 ++++---- sqlobject/tests/dbtest.py | 2 +- sqlobject/tests/test_csvexport.py | 5 ++++- sqlobject/tests/test_default_style.py | 20 +++++++++++--------- sqlobject/tests/test_delete.py | 2 +- sqlobject/tests/test_sqlite.py | 2 +- sqlobject/tests/test_sqlobject_admin.py | 6 ++---- sqlobject/util/csvexport.py | 5 ++++- sqlobject/views.py | 10 +++++----- 13 files changed, 46 insertions(+), 39 deletions(-) hooks/post-receive -- SQLObject development repository |