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 bebfdf9512ca6cdf94a3724dc2625a2288246945 (commit)
via be3983eb4e636b5857db17371a86e7826a72a7f7 (commit)
via 85bae29d1727980a682e9d59cd5254ded573add3 (commit)
via 4325abbc7b9362f9edbf23fa08cafcf208c06bf9 (commit)
from ed64be0ed032055b0a6613fe3051d83a74ded566 (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/bebfdf9512ca6cdf94a3724dc2625a2288246945
commit bebfdf9512ca6cdf94a3724dc2625a2288246945
Author: Oleg Broytman <ph...@ph...>
Date: Mon Apr 22 19:45:45 2019 +0300
Build(devscripts): Remove docs/_build/html on branch change
[skip ci]
diff --git a/devscripts/git-hooks/post-checkout b/devscripts/git-hooks/post-checkout
index 2bd5be0..40f7bd7 100755
--- a/devscripts/git-hooks/post-checkout
+++ b/devscripts/git-hooks/post-checkout
@@ -13,7 +13,7 @@ if [ "$new_branch" = 1 ]; then
for d in sqlobject/include/pydispatch sqlobject/include/tests; do
if [ "`echo $d/*`" = "$d/*" ]; then rm -rf $d; fi
done &&
- rm -rf docs/html
+ rm -rf docs/_build/html docs/html
fi &&
python -m compileall -q -x '\.tox/.+' . &&
http://sourceforge.net/p/sqlobject/sqlobject/ci/be3983eb4e636b5857db17371a86e7826a72a7f7
commit be3983eb4e636b5857db17371a86e7826a72a7f7
Merge: 85bae29 4325abb
Author: Oleg Broytman <ph...@ph...>
Date: Mon Apr 22 20:43:47 2019 +0300
Merge pull request #150 from elfring/use_augmented_assignments_2
Use augmented assignment statements.
Fix #148.
http://sourceforge.net/p/sqlobject/sqlobject/ci/85bae29d1727980a682e9d59cd5254ded573add3
commit 85bae29d1727980a682e9d59cd5254ded573add3
Author: Oleg Broytman <ph...@ph...>
Date: Mon Apr 22 19:35:38 2019 +0300
Fix(pgconnection): Adapt Postgres exception handling to `psycopg2` 2.8
In the recent `psycopg2` errors are in `psycopg2.errors` module.
diff --git a/docs/News.rst b/docs/News.rst
index 1b96883..dade2cb 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -5,8 +5,14 @@ News
.. contents:: Contents:
:backlinks: none
-SQLObject 3.8.0 (master)
-========================
+SQLObject (master)
+==================
+
+Minor features
+--------------
+
+* Adapt Postgres exception handling to ``psycopg2`` version ``2.8``:
+ in the recent ``psycopg2`` errors are in ``psycopg2.errors`` module.
SQLObject 3.7.1
===============
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 8dd1db5..afe8133 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -11,7 +11,7 @@ from sqlobject.dbconnection import DBAPI
class ErrorMessage(str):
def __new__(cls, e, append_msg=''):
obj = str.__new__(cls, e.args[0] + append_msg)
- if e.__module__ == 'psycopg2':
+ if hasattr(e, 'pgcode'): # psycopg2 or psycopg2.errors
obj.code = getattr(e, 'pgcode', None)
obj.error = getattr(e, 'pgerror', None)
else:
http://sourceforge.net/p/sqlobject/sqlobject/ci/4325abbc7b9362f9edbf23fa08cafcf208c06bf9
commit 4325abbc7b9362f9edbf23fa08cafcf208c06bf9
Author: Markus Elfring <el...@us...>
Date: Sun Apr 21 20:12:40 2019 +0200
Usage of augmented assignment statements
Source code like “var = var + …” was specified at some places so far.
Use augmented assignment statements instead because they are succinct
and can be more efficient.
https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements
Signed-off-by: Markus Elfring <el...@us...>
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 8119539..a22fb66 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -733,9 +733,9 @@ class SOIntCol(SOCol):
if self.length and self.length >= 1:
_ret = "%s(%d)" % (_ret, self.length)
if self.unsigned:
- _ret = _ret + " UNSIGNED"
+ _ret += " UNSIGNED"
if self.zerofill:
- _ret = _ret + " ZEROFILL"
+ _ret += " ZEROFILL"
return _ret
def _sqlType(self):
@@ -1092,9 +1092,8 @@ class SOForeignKey(SOKeyCol):
sql = ' '.join([fidName, self._maxdbType()])
tName = other.sqlmeta.table
idName = self.refColumn or other.sqlmeta.idName
- sql = sql + ',' + '\n'
- sql = sql + 'FOREIGN KEY (%s) REFERENCES %s(%s)' % (fidName, tName,
- idName)
+ sql += ',\nFOREIGN KEY (%s) REFERENCES %s(%s)' % (fidName, tName,
+ idName)
return sql
def maxdbCreateReferenceConstraint(self):
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index fbff457..8e09639 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -108,8 +108,8 @@ class DBConnection:
auth = getattr(self, 'user', '') or ''
if auth:
if self.password:
- auth = auth + ':' + self.password
- auth = auth + '@'
+ auth += ':' + self.password
+ auth += '@'
else:
assert not getattr(self, 'password', None), (
'URIs cannot express passwords without usernames')
@@ -129,8 +129,8 @@ class DBConnection:
if auth:
auth = quote(auth)
if self.password:
- auth = auth + ':' + quote(self.password)
- auth = auth + '@'
+ auth += ':' + quote(self.password)
+ auth += '@'
else:
assert not getattr(self, 'password', None), (
'URIs cannot express passwords without usernames')
diff --git a/sqlobject/joins.py b/sqlobject/joins.py
index afb0f88..e2c835a 100644
--- a/sqlobject/joins.py
+++ b/sqlobject/joins.py
@@ -170,9 +170,9 @@ class SOMultipleJoin(SOJoin):
if not self.joinMethodName:
name = self.otherClassName[0].lower() + self.otherClassName[1:]
if name.endswith('s'):
- name = name + "es"
+ name += "es"
else:
- name = name + "s"
+ name += "s"
self.joinMethodName = name
if addRemoveName:
self.addRemoveName = addRemoveName
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index 3a0055e..1267706 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -66,7 +66,7 @@ def test_04_indexed_ended_by_exception():
try:
while 1:
all[count]
- count = count + 1
+ count += 1
# Stop the test if it's gone on too long
if count > len(names):
break
-----------------------------------------------------------------------
Summary of changes:
devscripts/git-hooks/post-checkout | 2 +-
docs/News.rst | 10 ++++++++--
sqlobject/col.py | 9 ++++-----
sqlobject/dbconnection.py | 8 ++++----
sqlobject/joins.py | 4 ++--
sqlobject/postgres/pgconnection.py | 2 +-
sqlobject/tests/test_select.py | 2 +-
7 files changed, 21 insertions(+), 16 deletions(-)
hooks/post-receive
--
SQLObject development repository
|