sqlobject-cvs Mailing List for SQLObject (Page 16)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Oleg B. <no...@so...> - 2015-02-06 17:05:23
|
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 bb333927311676fc023ec54938be81a2ee7e0d03 (commit)
via dbbdc86fb22854682d8e1a94ae0154e558903028 (commit)
via 753903081500d91fe246e0286089758ef3de0c31 (commit)
via 49b63d9d3ad7cb82d7b31e86257e2af49dbce240 (commit)
from 0b9ad6e9a3927353359f32ab50181217a2f0a4d8 (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/bb333927311676fc023ec54938be81a2ee7e0d03
commit bb333927311676fc023ec54938be81a2ee7e0d03
Merge: 7539030 dbbdc86
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 20:03:54 2015 +0300
Merge pull request #65 from drnlm/issue_47_flak8_E211
Issue 47: Fix E211 - whitespace before (
http://sourceforge.net/p/sqlobject/sqlobject/ci/dbbdc86fb22854682d8e1a94ae0154e558903028
commit dbbdc86fb22854682d8e1a94ae0154e558903028
Author: Neil <ne...@di...>
Date: Fri Feb 6 18:59:34 2015 +0200
Fix E211 - whitespace before (
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index b8961f9..74ca35a 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -330,8 +330,8 @@ class FirebirdConnection(DBAPI):
# can look like: "DEFAULT 0", "DEFAULT 'default text'", None
if defaultSource:
defaultSource = defaultSource.split(' ')[1]
- if defaultSource.startswith ("'") and \
- defaultSource.endswith ("'"):
+ if defaultSource.startswith("'") and \
+ defaultSource.endswith("'"):
defaultSource = str(defaultSource[1:-1])
elif fieldType in ("integer", "smallint", "bigint"):
defaultSource = int(defaultSource)
diff --git a/sqlobject/maxdb/maxdbconnection.py b/sqlobject/maxdb/maxdbconnection.py
index 16aa43a..4ebe143 100644
--- a/sqlobject/maxdb/maxdbconnection.py
+++ b/sqlobject/maxdb/maxdbconnection.py
@@ -66,7 +66,7 @@ class MaxdbConnection(DBAPI):
dbName = 'maxdb'
schemes = [dbName]
- def __init__ (self, host='', port=None, user=None, password=None,
+ def __init__(self, host='', port=None, user=None, password=None,
database=None, autoCommit=1, sqlmode='internal',
isolation=None, timeout=None, **kw):
from sapdb import dbapi
diff --git a/sqlobject/versioning/__init__.py b/sqlobject/versioning/__init__.py
index 2e937d3..512aa8c 100644
--- a/sqlobject/versioning/__init__.py
+++ b/sqlobject/versioning/__init__.py
@@ -80,7 +80,7 @@ class Versioning(object):
'extraCols': self.extraCols
}
- getColumns (attrs, self.soClass)
+ getColumns(attrs, self.soClass)
attrs.update(self.extraCols)
http://sourceforge.net/p/sqlobject/sqlobject/ci/753903081500d91fe246e0286089758ef3de0c31
commit 753903081500d91fe246e0286089758ef3de0c31
Merge: 0b9ad6e 49b63d9
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 18:03:17 2015 +0300
Merge pull request #64 from drnlm/issue_51_flake8_E222
Issue #51: Fix flake8 E222 - multiple spaces after operator
http://sourceforge.net/p/sqlobject/sqlobject/ci/49b63d9d3ad7cb82d7b31e86257e2af49dbce240
commit 49b63d9d3ad7cb82d7b31e86257e2af49dbce240
Author: Neil <ne...@di...>
Date: Fri Feb 6 12:13:49 2015 +0200
Fix flake8 E222 - multiple spaces after operator
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index ecf0c54..b8961f9 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -123,7 +123,7 @@ class FirebirdConnection(DBAPI):
"""Firebird slaps the limit and offset (actually 'first' and
'skip', respectively) statement right after the select."""
if not start:
- limit_str = "SELECT FIRST %i" % end
+ limit_str = "SELECT FIRST %i" % end
if not end:
limit_str = "SELECT SKIP %i" % start
else:
@@ -182,7 +182,7 @@ class FirebirdConnection(DBAPI):
def readDefaultEncodingFromDB(self):
# Get out if encoding is known allready (can by None as well).
if self.defaultDbEncoding == "":
- self.defaultDbEncoding = str(self.queryOne(
+ self.defaultDbEncoding = str(self.queryOne(
"SELECT rdb$character_set_name FROM rdb$database")[0].\
strip().lower()) # encoding defined during db creation
if self.defaultDbEncoding == "none":
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 7e3b1b8..d59e41f 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -529,7 +529,7 @@ class SQLObjectTableWithJoins(SQLObjectTable):
return SQLObjectTable.__getattr__(self, attr)
def _getattrFromForeignKey(self, column, attr):
- ret = getattr(self, column.name) == \
+ ret = getattr(self, column.name) == \
getattr(self.soClass, '_SO_class_'+column.foreignKey).q.id
return ret
-----------------------------------------------------------------------
Summary of changes:
sqlobject/firebird/firebirdconnection.py | 8 ++++----
sqlobject/maxdb/maxdbconnection.py | 2 +-
sqlobject/sqlbuilder.py | 2 +-
sqlobject/versioning/__init__.py | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-02-06 14:28:18
|
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 0b9ad6e9a3927353359f32ab50181217a2f0a4d8 (commit)
via da0798a2199fd08871788a1e594ceaf2c1a6a7da (commit)
via 1f3a349f3dfe8bdd17ae230d613c44cff71e5bed (commit)
via 08fbca575502ceb57833abba595c160acaa86802 (commit)
via f4f7d7906ceb86950b39369a14da04f62c9cb95c (commit)
via dccae4721f2e5897d6f0ca822e6177f66d2e7884 (commit)
from b5a0d7d34e83c613984c7aff39c12ffbaeba2e70 (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/0b9ad6e9a3927353359f32ab50181217a2f0a4d8
commit 0b9ad6e9a3927353359f32ab50181217a2f0a4d8
Merge: da0798a 1f3a349
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 17:26:31 2015 +0300
Merge pull request #63 from drnlm/issue_3_Operator_syntax_fixes
Issue 3 operator syntax fixes
http://sourceforge.net/p/sqlobject/sqlobject/ci/da0798a2199fd08871788a1e594ceaf2c1a6a7da
commit da0798a2199fd08871788a1e594ceaf2c1a6a7da
Merge: b5a0d7d dccae47
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 17:25:42 2015 +0300
Merge pull request #62 from drnlm/issue_46_flake8_E271
Fix flake8 E271 - multiple spaces after keyword
http://sourceforge.net/p/sqlobject/sqlobject/ci/1f3a349f3dfe8bdd17ae230d613c44cff71e5bed
commit 1f3a349f3dfe8bdd17ae230d613c44cff71e5bed
Author: Neil <ne...@di...>
Date: Fri Feb 6 11:34:47 2015 +0200
No reason to suppress W603 anymore
diff --git a/setup.cfg b/setup.cfg
index 863e0a5..ec4b034 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -23,8 +23,7 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; W291 trailing whitespace
; W293 blank line contains whitespace
; W391 blank line at end of file
-; W603 '<>' is deprecated, use '!='
-ignore = E123,E124,E226,E401,E502,F402,F403,F812,F822,W291,W293,W391,W603
+ignore = E123,E124,E226,E401,E502,F402,F403,F812,F822,W291,W293,W391
[pudge]
theme = pythonpaste.org
http://sourceforge.net/p/sqlobject/sqlobject/ci/08fbca575502ceb57833abba595c160acaa86802
commit 08fbca575502ceb57833abba595c160acaa86802
Author: Neil <ne...@di...>
Date: Fri Feb 6 11:34:10 2015 +0200
Update docs to use '!=' instead of '<>'
diff --git a/docs/SQLBuilder.txt b/docs/SQLBuilder.txt
index 4aaf45b..d3e7c83 100644
--- a/docs/SQLBuilder.txt
+++ b/docs/SQLBuilder.txt
@@ -34,7 +34,7 @@ field. All of this is probably easier to grasp in an example::
person.first_name = 'John'
>>> name = 'John'
>>> person.first_name != name
- person.first_name <> 'John'
+ person.first_name != 'John'
>>> AND(person.first_name == 'John', person.last_name == 'Doe')
(person.first_name = 'John' AND person.last_name = 'Doe')
diff --git a/docs/SQLObject.txt b/docs/SQLObject.txt
index 92f78b9..42663e9 100644
--- a/docs/SQLObject.txt
+++ b/docs/SQLObject.txt
@@ -1219,13 +1219,13 @@ different types of columns, when SQLObject creates your tables.
limitations on using UnicodeCol in queries:
- only simple q-magic fields are supported; no expressions;
- - only == and <> operators are supported;
+ - only == and != operators are supported;
The following code works::
MyTable.select(u'value' == MyTable.q.name)
- MyTable.select(MyTable.q.name <> u'value')
- MyTable.select(OR(MyTable.q.col1 == u'value1', MyTable.q.col2 <> u'value2'))
+ MyTable.select(MyTable.q.name != u'value')
+ MyTable.select(OR(MyTable.q.col1 == u'value1', MyTable.q.col2 != u'value2'))
MyTable.selectBy(name = u'value')
MyTable.selectBy(col1=u'value1', col2=u'value2')
MyTable.byCol1(u'value1') # if col1 is an alternateID
http://sourceforge.net/p/sqlobject/sqlobject/ci/f4f7d7906ceb86950b39369a14da04f62c9cb95c
commit f4f7d7906ceb86950b39369a14da04f62c9cb95c
Author: Neil <ne...@di...>
Date: Fri Feb 6 11:32:48 2015 +0200
Avoid '<>' in tests, due to python3 syntax changes
diff --git a/sqlobject/inheritance/tests/test_foreignKey.py b/sqlobject/inheritance/tests/test_foreignKey.py
index ce71846..49f19cd 100644
--- a/sqlobject/inheritance/tests/test_foreignKey.py
+++ b/sqlobject/inheritance/tests/test_foreignKey.py
@@ -45,13 +45,13 @@ def test_foreignKey():
assert employee.note.text == "employee"
save_employee = employee
- persons = PersonWithNotes.select(PersonWithNotes.q.noteID <> None)
+ persons = PersonWithNotes.select(PersonWithNotes.q.noteID != None)
assert persons.count() == 2
persons = PersonWithNotes.selectBy(noteID=person.note.id)
assert persons.count() == 1
- employee = EmployeeWithNotes.select(PersonWithNotes.q.noteID <> None)
+ employee = EmployeeWithNotes.select(PersonWithNotes.q.noteID != None)
assert employee.count() == 1
persons = PersonWithNotes.selectBy(noteID=person.note.id)
diff --git a/sqlobject/inheritance/tests/test_inheritance.py b/sqlobject/inheritance/tests/test_inheritance.py
index 83ec676..a504d9f 100644
--- a/sqlobject/inheritance/tests/test_inheritance.py
+++ b/sqlobject/inheritance/tests/test_inheritance.py
@@ -50,19 +50,19 @@ def test_inheritance():
def test_inheritance_select():
setup()
- persons = InheritablePerson.select(InheritablePerson.q.firstName <> None)
+ persons = InheritablePerson.select(InheritablePerson.q.firstName != None)
assert persons.count() == 2
persons = InheritablePerson.select(InheritablePerson.q.firstName == "phd")
assert persons.count() == 0
- employees = Employee.select(Employee.q.firstName <> None)
+ employees = Employee.select(Employee.q.firstName != None)
assert employees.count() == 1
employees = Employee.select(Employee.q.firstName == "phd")
assert employees.count() == 0
- employees = Employee.select(Employee.q.position <> None)
+ employees = Employee.select(Employee.q.position != None)
assert employees.count() == 1
persons = InheritablePerson.selectBy(firstName="Project")
diff --git a/sqlobject/tests/test_comparison.py b/sqlobject/tests/test_comparison.py
index 2da35fe..ba0693e 100644
--- a/sqlobject/tests/test_comparison.py
+++ b/sqlobject/tests/test_comparison.py
@@ -21,4 +21,4 @@ def test_eq():
assert t2 is not t4
assert t1 == t3
assert t2 == t4
- assert t1 <> t2
+ assert t1 != t2
http://sourceforge.net/p/sqlobject/sqlobject/ci/dccae4721f2e5897d6f0ca822e6177f66d2e7884
commit dccae4721f2e5897d6f0ca822e6177f66d2e7884
Author: Neil <ne...@di...>
Date: Fri Feb 6 12:10:03 2015 +0200
Fix flake8 E271 - multiple spaces after keyword
diff --git a/sqlobject/col.py b/sqlobject/col.py
index fee0b14..cc8558c 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1388,7 +1388,7 @@ class SODateCol(SOCol):
return 'DATE'
def _maxdbType(self):
- return 'DATE'
+ return 'DATE'
def _sqliteType(self):
return 'DATE'
diff --git a/sqlobject/main.py b/sqlobject/main.py
index 20e1585..6dbde14 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -341,7 +341,7 @@ class sqlmeta(object):
if hasattr(base, "sqlmeta"):
parent_columns.extend(base.sqlmeta.columns.keys())
if hasattr(soClass, name):
- assert (name in parent_columns) or (name == "childName"), (
+ assert (name in parent_columns) or (name == "childName"), (
"The class %s.%s already has a variable or method %r, "
"you cannot add the column %r" % (
soClass.__module__, soClass.__name__, name, name))
diff --git a/sqlobject/versioning/__init__.py b/sqlobject/versioning/__init__.py
index 61cffb1..2e937d3 100644
--- a/sqlobject/versioning/__init__.py
+++ b/sqlobject/versioning/__init__.py
@@ -88,7 +88,7 @@ class Versioning(object):
(Version,),
attrs)
- if '_connection' in self.soClass.__dict__:
+ if '_connection' in self.soClass.__dict__:
self.versionClass._connection = \
self.soClass.__dict__['_connection']
-----------------------------------------------------------------------
Summary of changes:
docs/SQLBuilder.txt | 2 +-
docs/SQLObject.txt | 6 +++---
setup.cfg | 3 +--
sqlobject/col.py | 2 +-
sqlobject/inheritance/tests/test_foreignKey.py | 4 ++--
sqlobject/inheritance/tests/test_inheritance.py | 6 +++---
sqlobject/main.py | 2 +-
sqlobject/tests/test_comparison.py | 2 +-
sqlobject/versioning/__init__.py | 2 +-
9 files changed, 14 insertions(+), 15 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-02-06 13:54:23
|
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 b5a0d7d34e83c613984c7aff39c12ffbaeba2e70 (commit)
via bf4bd6bad47bc62f8abb45856a03187a224ec913 (commit)
via d5e5bc6cf42462a6d0469fcf20a63067c2096fe9 (commit)
via afd323dea72da5fe27aa993c05e5d5c99d6d7e12 (commit)
via bd355a7de722929044caad5a2a537825abe5c543 (commit)
via 124690114b0444be16ee015e9433306b2d82ac39 (commit)
via fe1c76c1e867f969d79f22ba3e54c0e46afb19fb (commit)
from 0a64735fbb27adf82156346674f3143db9fd4c0c (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/b5a0d7d34e83c613984c7aff39c12ffbaeba2e70
commit b5a0d7d34e83c613984c7aff39c12ffbaeba2e70
Merge: bf4bd6b bd355a7
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 16:52:24 2015 +0300
Merge pull request #61 from drnlm/issue_3_fix_long
Issue 3 fix long syntax
http://sourceforge.net/p/sqlobject/sqlobject/ci/bf4bd6bad47bc62f8abb45856a03187a224ec913
commit bf4bd6bad47bc62f8abb45856a03187a224ec913
Merge: d5e5bc6 afd323d
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 16:51:09 2015 +0300
Merge pull request #60 from drnlm/issue_35_flake8_E203
Fix #35 flake8 E203 whitespace before ':'
http://sourceforge.net/p/sqlobject/sqlobject/ci/d5e5bc6cf42462a6d0469fcf20a63067c2096fe9
commit d5e5bc6cf42462a6d0469fcf20a63067c2096fe9
Merge: 0a64735 fe1c76c
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 16:49:46 2015 +0300
Merge branch 'flake8-fixes'
http://sourceforge.net/p/sqlobject/sqlobject/ci/afd323dea72da5fe27aa993c05e5d5c99d6d7e12
commit afd323dea72da5fe27aa993c05e5d5c99d6d7e12
Author: Neil <ne...@di...>
Date: Fri Feb 6 12:24:20 2015 +0200
Fix flake8 E203 - whitespace before ':'
diff --git a/sqlobject/inheritance/__init__.py b/sqlobject/inheritance/__init__.py
index db71622..b570310 100644
--- a/sqlobject/inheritance/__init__.py
+++ b/sqlobject/inheritance/__init__.py
@@ -121,7 +121,7 @@ class InheritableSQLMeta(sqlmeta):
not getattr(self.sqlmeta,
"row_update_sig_suppress", False):
self.sqlmeta.send(events.RowUpdateSignal, self,
- {cname : val})
+ {cname: val})
setattr(self._parent, cname, val)
return setfunc
diff --git a/sqlobject/maxdb/maxdbconnection.py b/sqlobject/maxdb/maxdbconnection.py
index 01ce60b..55bce1e 100644
--- a/sqlobject/maxdb/maxdbconnection.py
+++ b/sqlobject/maxdb/maxdbconnection.py
@@ -31,7 +31,7 @@ class LowerBoundOfSliceIsNotSupported(maxdbException):
maxdbException.__init__(self, '')
-class IncorrectIDStyleError(maxdbException) :
+class IncorrectIDStyleError(maxdbException):
def __init__(self, value):
maxdbException.__init__(
self,
@@ -96,7 +96,7 @@ class MaxdbConnection(DBAPI):
opt["sqlmode"] = sqlmode
if self.isolation:
opt["isolation"] = self.isolation
- if self.timeout :
+ if self.timeout:
opt["timeout"] = self.timeout
return opt
@@ -274,7 +274,7 @@ class MaxdbConnection(DBAPI):
kw['name'] = field_name
kw['dbName'] = field
- if nullAllowed == 'Y' :
+ if nullAllowed == 'Y':
nullAllowed = False
else:
nullAllowed = True
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index 8608f04..a09f658 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -264,9 +264,9 @@ class MSSQLConnection(DBAPI):
if defaultText[0] == "'":
defaultText = defaultText[1:-1]
else:
- if t == "int" :
+ if t == "int":
defaultText = int(defaultText)
- if t == "float" :
+ if t == "float":
defaultText = float(defaultText)
if t == "numeric":
defaultText = float(defaultText)
diff --git a/sqlobject/tests/dbtest.py b/sqlobject/tests/dbtest.py
index 14b2fea..5522a36 100644
--- a/sqlobject/tests/dbtest.py
+++ b/sqlobject/tests/dbtest.py
@@ -39,8 +39,8 @@ supportsMatrix = {
'-blobData': 'mssql rdbhost',
'-decimalColumn': 'mssql',
'-emptyTable': 'mssql',
- '-limitSelect' : 'mssql',
- '+schema' : 'postgres',
+ '-limitSelect': 'mssql',
+ '+schema': 'postgres',
'+memorydb': 'sqlite',
}
diff --git a/sqlobject/versioning/__init__.py b/sqlobject/versioning/__init__.py
index 80a3ab6..61cffb1 100644
--- a/sqlobject/versioning/__init__.py
+++ b/sqlobject/versioning/__init__.py
@@ -76,8 +76,8 @@ class Versioning(object):
attrs = {'dateArchived': DateTimeCol(default=datetime.now),
'master': ForeignKey(self.soClass.__name__),
- 'masterClass' : self.soClass,
- 'extraCols' : self.extraCols
+ 'masterClass': self.soClass,
+ 'extraCols': self.extraCols
}
getColumns (attrs, self.soClass)
diff --git a/sqlobject/versioning/test/test_version.py b/sqlobject/versioning/test/test_version.py
index 56f8766..c8a7d60 100644
--- a/sqlobject/versioning/test/test_version.py
+++ b/sqlobject/versioning/test/test_version.py
@@ -45,7 +45,7 @@ def _set_extra():
class Extra(SQLObject):
name = StringCol()
versions = Versioning(
- extraCols={'extra' : StringCol(default=_set_extra())})
+ extraCols={'extra': StringCol(default=_set_extra())})
class HasAltId(SQLObject):
http://sourceforge.net/p/sqlobject/sqlobject/ci/bd355a7de722929044caad5a2a537825abe5c543
commit bd355a7de722929044caad5a2a537825abe5c543
Author: Neil <ne...@di...>
Date: Fri Feb 6 11:21:08 2015 +0200
Change long specification syntax in tests to avoid python 3 syntax errors
diff --git a/sqlobject/tests/test_constraints.py b/sqlobject/tests/test_constraints.py
index 5bce16d..89a03fc 100644
--- a/sqlobject/tests/test_constraints.py
+++ b/sqlobject/tests/test_constraints.py
@@ -1,6 +1,11 @@
from sqlobject.constraints import *
from sqlobject.tests.dbtest import *
+import sys
+if sys.version_info[0] > 2:
+ # alias for python 3 compatability
+ long = int
+
def test_constraints():
obj = 'Test object'
@@ -14,9 +19,9 @@ def test_constraints():
raises(BadValue, notNull, obj, col, None)
raises(BadValue, isInt, obj, col, 1.1)
isInt(obj, col, 1)
- isInt(obj, col, 1L)
+ isInt(obj, col, long(1))
isFloat(obj, col, 1)
- isFloat(obj, col, 1L)
+ isFloat(obj, col, long(1))
isFloat(obj, col, 1.2)
raises(BadValue, isFloat, obj, col, '1.0')
diff --git a/sqlobject/tests/test_validation.py b/sqlobject/tests/test_validation.py
index ccec89b..2618fdb 100644
--- a/sqlobject/tests/test_validation.py
+++ b/sqlobject/tests/test_validation.py
@@ -2,6 +2,10 @@ from sqlobject import *
from sqlobject.col import validators
from sqlobject.tests.dbtest import *
+import sys
+if sys.version_info[0] > 2:
+ # alias for python 3 compatability
+ long = int
########################################
# Validation/conversion
@@ -96,7 +100,7 @@ class TestValidation:
def test_wrapType(self):
t = SOValidation(name3=1)
raises(validators.Invalid, setattr, t, 'name3', 'x')
- t.name3 = 1L
+ t.name3 = long(1)
assert t.name3 == 1
t.name3 = 0
assert t.name3 == 0
http://sourceforge.net/p/sqlobject/sqlobject/ci/124690114b0444be16ee015e9433306b2d82ac39
commit 124690114b0444be16ee015e9433306b2d82ac39
Author: Neil <ne...@di...>
Date: Fri Feb 6 11:20:39 2015 +0200
Add long alias for python
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 690f273..ff943b8 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -72,6 +72,11 @@ __all__ = ["datetime_available", "mxdatetime_available",
if mxdatetime_available:
__all__.append("MXDATETIME_IMPLEMENTATION")
+import sys
+if sys.version_info[0] > 2:
+ # alias for python 3 compatability
+ long = int
+
creationOrder = count()
diff --git a/sqlobject/constraints.py b/sqlobject/constraints.py
index 440ae53..9a77983 100644
--- a/sqlobject/constraints.py
+++ b/sqlobject/constraints.py
@@ -2,6 +2,11 @@
Constraints
"""
+import sys
+if sys.version_info[0] > 2:
+ # alias for python 3 compatability
+ long = int
+
class BadValue(ValueError):
diff --git a/sqlobject/main.py b/sqlobject/main.py
index e1ff1fa..20e1585 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -47,6 +47,10 @@ if ((sys.version_info[0] == 2) and (sys.version_info[:3] < (2, 6, 0))) \
or ((sys.version_info[0] == 3) and (sys.version_info[:3] < (3, 4, 0))):
raise ImportError("SQLObject requires Python 2.6, 2.7 or 3.4+")
+if sys.version_info[0] > 2:
+ # alias for python 3 compatability
+ long = int
+
"""
This thread-local storage is needed for RowCreatedSignals. It gathers
code-blocks to execute _after_ the whole hierachy of inherited SQLObjects
http://sourceforge.net/p/sqlobject/sqlobject/ci/fe1c76c1e867f969d79f22ba3e54c0e46afb19fb
commit fe1c76c1e867f969d79f22ba3e54c0e46afb19fb
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 6 00:17:23 2015 +0300
Fix #27 flake8 F821 undefined name
Some of these warning are real bugs.
diff --git a/setup.cfg b/setup.cfg
index 069a010..863e0a5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -19,13 +19,12 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; F402 import 'name' shadowed by loop variable
; F403 'from module import *' used; unable to detect undefined names
; F812 list comprehension redefines 'name' from line 1402
-; F821 undefined name
; F822 undefined name in __all__
; W291 trailing whitespace
; W293 blank line contains whitespace
; W391 blank line at end of file
; W603 '<>' is deprecated, use '!='
-ignore = E123,E124,E226,E401,E502,F402,F403,F812,F821,F822,W291,W293,W391,W603
+ignore = E123,E124,E226,E401,E502,F402,F403,F812,F822,W291,W293,W391,W603
[pudge]
theme = pythonpaste.org
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 690f273..682680a 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -375,7 +375,7 @@ class SOCol(object):
if columns is None:
obj.sqlmeta.loadValues()
try:
- return columns[name]
+ return columns[name] # noqa
except KeyError:
return obj.sqlmeta.loadColumn(self)
else:
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index d13db60..1295691 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -1040,12 +1040,13 @@ class ConnectionURIOpener(object):
def registerConnectionInstance(self, inst):
if inst.name:
- assert not inst.name in self.instanceNames \
- or self.instanceNames[inst.name] is cls, \
- "A instance has already been registered " \
- "with the name %s" % inst.name
+ assert (not inst.name in self.instanceNames
+ or self.instanceNames[inst.name] is cls # noqa
+ ), ("A instance has already been registered "
+ "with the name %s" % inst.name)
assert inst.name.find(':') == -1, \
- "You cannot include ':' in your class names (%r)" % cls.name
+ "You cannot include ':' " \
+ "in your class names (%r)" % cls.name # noqa
self.instanceNames[inst.name] = inst
def connectionForURI(self, uri, oldUri=False, **args):
diff --git a/sqlobject/events.py b/sqlobject/events.py
index cb4b971..1b2b5f5 100644
--- a/sqlobject/events.py
+++ b/sqlobject/events.py
@@ -272,8 +272,8 @@ def sort_name(value):
_real_dispatcher_send = dispatcher.send
_real_dispatcher_sendExact = dispatcher.sendExact
-_real_dispatcher_disconnect = dispatcher.disconnect
_real_dispatcher_connect = dispatcher.connect
+_real_dispatcher_disconnect = dispatcher.disconnect
_debug_enabled = False
@@ -314,7 +314,7 @@ def _debug_disconnect(receiver, signal=dispatcher.Any, sender=dispatcher.Any,
weak=True):
print("disconnecting %s from %s signal %s" % (
nice_repr(receiver), nice_repr(signal), nice_repr(sender)))
- return disconnect(receiver, signal, sender, weak)
+ return _real_dispatcher_disconnect(receiver, signal, sender, weak)
def fmt_args(*arguments, **name):
diff --git a/sqlobject/manager/command.py b/sqlobject/manager/command.py
index e94f189..c310af7 100755
--- a/sqlobject/manager/command.py
+++ b/sqlobject/manager/command.py
@@ -293,7 +293,7 @@ class Command(object):
os.path.basename(self.invoked_as),
self.command_name)
if self.description:
- self.parser.description = description
+ self.parser.description = self.description
self.options, self.args = self.parser.parse_args(self.raw_args)
if (getattr(self.options, 'simulate', False)
and not self.options.verbose):
@@ -1102,7 +1102,7 @@ class CommandRecord(Command):
def base_dir(self):
base = self.options.output_dir
if base is None:
- base = CONFIG.get('sqlobject_history_dir', '.')
+ base = CONFIG.get('sqlobject_history_dir', '.') # noqa
if not os.path.exists(base):
print('Creating history directory %s' %
self.shorten_filename(base))
diff --git a/sqlobject/maxdb/maxdbconnection.py b/sqlobject/maxdb/maxdbconnection.py
index 01ce60b..226fe2e 100644
--- a/sqlobject/maxdb/maxdbconnection.py
+++ b/sqlobject/maxdb/maxdbconnection.py
@@ -13,6 +13,8 @@ connection creation sample::
host=hostname, database=dbname,
user=user_name, password=user_password, autoCommit=1, debug=1)
"""
+
+import os
from sqlobject.dbconnection import DBAPI
from sqlobject import col
@@ -311,7 +313,7 @@ class MaxdbConnection(DBAPI):
elif t in self._dateTypes:
return col.DateTimeCol, {}
elif t == 'FIXED':
- return CurrencyCol, {'size': flength,
- 'precision': fscale}
+ return col.CurrencyCol, {'size': flength,
+ 'precision': fscale}
else:
return col.Col, {}
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index 8608f04..2531dd0 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -216,7 +216,7 @@ class MSSQLConnection(DBAPI):
column.mssqlCreateSQL(self)))
def delColumn(self, sqlmeta, column):
- self.query('ALTER TABLE %s DROP COLUMN %s' % (tableName.table,
+ self.query('ALTER TABLE %s DROP COLUMN %s' % (sqlmeta.table,
column.dbName))
# precision and scale is gotten from column table so that we can create
@@ -288,7 +288,9 @@ class MSSQLConnection(DBAPI):
option = "OFF"
c = conn.cursor()
c.execute("SET AUTOCOMMIT " + option)
- conn.setconnectoption(SQL.AUTOCOMMIT, option)
+ # from mx.ODBC.Windows import SQL
+ # connection.setconnectoption(
+ # SQL.AUTOCOMMIT, SQL.AUTOCOMMIT_ON if auto else SQL.AUTOCOMMIT_OFF)
# precision and scale is needed for decimal columns
def guessClass(self, t, size, precision, scale):
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 60472a3..7e3b1b8 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -360,6 +360,7 @@ class SQLPrefix(SQLExpression):
return [self.expr]
def execute(self, executor):
+ prefix = self.prefix
expr = execute(self.expr, executor)
if prefix == "+":
return expr
diff --git a/sqlobject/util/csvimport.py b/sqlobject/util/csvimport.py
index efce367..fe7b2cb 100644
--- a/sqlobject/util/csvimport.py
+++ b/sqlobject/util/csvimport.py
@@ -55,9 +55,10 @@ whatever default the class wants. ``[null]`` will use NULL.
Lines that begin with ``[comment]`` are ignored.
"""
+import csv
from datetime import datetime, date, timedelta
import os
-import csv
+import time
import types
__all__ = ['load_csv_from_directory',
@@ -199,7 +200,8 @@ def load_csv(csvreader, allow_python=True, default_type=DEFAULT_TYPE,
"for this file (line: %r)" % row)
if current_headers is None:
- current_headers = _parse_headers(row, default_type)
+ current_headers = _parse_headers(row, default_type,
+ allow_python=allow_python)
continue
if row[0] == '[comment]':
@@ -225,7 +227,7 @@ def load_csv(csvreader, allow_python=True, default_type=DEFAULT_TYPE,
return results
-def _parse_headers(header_row, default_type):
+def _parse_headers(header_row, default_type, allow_python=True):
headers = []
for name in header_row:
original_name = name
@@ -359,7 +361,7 @@ def parse_bool(v):
elif v in ('n', 'no', 'f', 'false', 'off', '0'):
return False
raise ValueError(
- "Value is not boolean-like: %r" % value)
+ "Value is not boolean-like: %r" % v)
register_coercer('bool', parse_bool)
register_coercer('boolean', parse_bool)
diff --git a/sqlobject/util/moduleloader.py b/sqlobject/util/moduleloader.py
index 5de7c19..bbb8d0c 100644
--- a/sqlobject/util/moduleloader.py
+++ b/sqlobject/util/moduleloader.py
@@ -1,5 +1,6 @@
-import sys
import imp
+import os
+import sys
... 25 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-02-05 18:40:23
|
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 0a64735fbb27adf82156346674f3143db9fd4c0c (commit)
via 8e2b506965a7c3794eccf079217f936442c04a5a (commit)
via 80aa5d16805e0145daf9f41449abe35ea87a4069 (commit)
via e50bdd0d0ad4cb65c39424aca62c666926b7d3ac (commit)
via 96d3aba0e0ad0606a17b74f231ccc851e8e225a0 (commit)
via d6e5e0c1a628fa6c66b60f477539a8ff3646d7c6 (commit)
via 706c7207981ae97b673588602db3817a3095bc03 (commit)
via 5aee23fd9ad431d490f246e1ff801a08b401182b (commit)
via ccb2c23e4fc9f316d923377fd2b0c7d7fbc683a5 (commit)
via d2a7d7f46de9e7f42ff86a2063aea8bae30ce8e7 (commit)
via 667de45be78e3691c3157c05248a62fea6459fce (commit)
via 30e79370b363a83e24c19b520110cdcf8f6b1bbb (commit)
via 33020a8beafd64eb666e479897f9bab8606a463e (commit)
via fd6e67c14a79a18f8e2a817789b686715cafbf85 (commit)
from 6eabc0948f86083039f55c752a28022d7584f3f0 (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/0a64735fbb27adf82156346674f3143db9fd4c0c
commit 0a64735fbb27adf82156346674f3143db9fd4c0c
Merge: 6eabc09 8e2b506
Author: Oleg Broytman <ph...@ph...>
Date: Thu Feb 5 21:38:52 2015 +0300
Merge branch 'flake8-fixes'
http://sourceforge.net/p/sqlobject/sqlobject/ci/8e2b506965a7c3794eccf079217f936442c04a5a
commit 8e2b506965a7c3794eccf079217f936442c04a5a
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:32:01 2015 +0200
Don't import new on python 3
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 5891342..d13db60 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -1,7 +1,11 @@
import atexit
from cgi import parse_qsl
import inspect
-import new
+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
http://sourceforge.net/p/sqlobject/sqlobject/ci/80aa5d16805e0145daf9f41449abe35ea87a4069
commit 80aa5d16805e0145daf9f41449abe35ea87a4069
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:29:11 2015 +0200
Avoid dictionary changed crashes on import
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 5c7aada..690f273 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1779,7 +1779,8 @@ def pushKey(kw, name, value):
kw[name] = value
all = []
-for key, value in globals().items():
+# Use copy() to avoid 'dictionary changed' issues on python 3
+for key, value in globals().copy().items():
if isinstance(value, type) and (issubclass(value, (Col, SOCol))):
all.append(key)
__all__.extend(all)
diff --git a/sqlobject/events.py b/sqlobject/events.py
index aadf5bb..cb4b971 100644
--- a/sqlobject/events.py
+++ b/sqlobject/events.py
@@ -345,6 +345,7 @@ def nice_repr(v):
__all__ = ['listen', 'send']
-for name, value in globals().items():
+# Use copy() to avoid 'dictionary changed' issues on python 3
+for name, value in globals().copy().items():
if isinstance(value, type) and issubclass(value, Signal):
__all__.append(name)
http://sourceforge.net/p/sqlobject/sqlobject/ci/e50bdd0d0ad4cb65c39424aca62c666926b7d3ac
commit e50bdd0d0ad4cb65c39424aca62c666926b7d3ac
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:28:40 2015 +0200
Add operator.div alias for python 3
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index d76e928..60472a3 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -66,6 +66,7 @@ import re
import threading
import types
import weakref
+import sys
from . import classregistry
from .converters import registerConverter, sqlrepr, quote_str, unquote_str
@@ -262,9 +263,15 @@ def tablesUsedSet(obj, db):
return {}
+if sys.version_info[0] < 3:
+ div = operator.div
+else:
+ div = operator.truediv
+
+
operatorMap = {
"+": operator.add,
- "/": operator.div,
+ "/": div,
"-": operator.sub,
"*": operator.mul,
"<": operator.lt,
http://sourceforge.net/p/sqlobject/sqlobject/ci/96d3aba0e0ad0606a17b74f231ccc851e8e225a0
commit 96d3aba0e0ad0606a17b74f231ccc851e8e225a0
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:27:14 2015 +0200
Add python3 alias
diff --git a/sqlobject/dberrors.py b/sqlobject/dberrors.py
index c14a86b..986c80d 100644
--- a/sqlobject/dberrors.py
+++ b/sqlobject/dberrors.py
@@ -5,6 +5,9 @@
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
+import sys
+if sys.version_info[0] >= 3:
+ StandardError = Exception
class Error(StandardError):
pass
http://sourceforge.net/p/sqlobject/sqlobject/ci/d6e5e0c1a628fa6c66b60f477539a8ff3646d7c6
commit d6e5e0c1a628fa6c66b60f477539a8ff3646d7c6
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:26:55 2015 +0200
Alias types and add some python 3 protections
diff --git a/sqlobject/converters.py b/sqlobject/converters.py
index b4c3862..efae0c5 100644
--- a/sqlobject/converters.py
+++ b/sqlobject/converters.py
@@ -2,7 +2,15 @@ from array import array
import datetime
from decimal import Decimal
import time
-from types import ClassType, InstanceType, NoneType
+import sys
+if sys.version_info[0] < 3:
+ from types import ClassType, InstanceType, NoneType
+else:
+ # Use suitable aliases for now
+ ClassType = type
+ NoneType = type(None)
+ # This is may not be what we want in all cases, but will do for now
+ InstanceType = object
try:
@@ -80,9 +88,13 @@ def StringLikeConverter(value, db):
return "'%s'" % value
registerConverter(str, StringLikeConverter)
-registerConverter(unicode, StringLikeConverter)
+if sys.version_info[0] < 3:
+ registerConverter(unicode, StringLikeConverter)
registerConverter(array, StringLikeConverter)
-registerConverter(buffer, StringLikeConverter)
+if sys.version_info[0] < 3:
+ registerConverter(buffer, StringLikeConverter)
+else:
+ registerConverter(memoryview, StringLikeConverter)
def IntConverter(value, db):
@@ -94,7 +106,8 @@ registerConverter(int, IntConverter)
def LongConverter(value, db):
return str(value)
-registerConverter(long, LongConverter)
+if sys.version_info[0] < 3:
+ registerConverter(long, LongConverter)
if NumericType:
registerConverter(NumericType, IntConverter)
http://sourceforge.net/p/sqlobject/sqlobject/ci/706c7207981ae97b673588602db3817a3095bc03
commit 706c7207981ae97b673588602db3817a3095bc03
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:33:34 2015 +0200
Avoid circular import issues in main.py
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index c5f121b..5891342 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -13,7 +13,6 @@ from .cache import CacheSet
from . import classregistry
from . import col
from .converters import sqlrepr
-import main
from . import sqlbuilder
from .util.threadinglocal import local as threading_local
@@ -667,6 +666,7 @@ class DBAPI(DBConnection):
self.sqlrepr(secondValue)))
def _SO_columnClause(self, soClass, kw):
+ from . import main
ops = {None: "IS"}
data = []
if 'id' in kw:
diff --git a/sqlobject/sresults.py b/sqlobject/sresults.py
index bbad18a..b740996 100644
--- a/sqlobject/sresults.py
+++ b/sqlobject/sresults.py
@@ -1,5 +1,4 @@
from . import dbconnection
-import main
from . import sqlbuilder
@@ -285,6 +284,7 @@ class SelectResults(object):
If more than one result is returned,
``SQLObjectIntegrityError`` will be raised.
"""
+ from . import main
results = list(self)
if not results:
if default is sqlbuilder.NoDefault:
http://sourceforge.net/p/sqlobject/sqlobject/ci/5aee23fd9ad431d490f246e1ff801a08b401182b
commit 5aee23fd9ad431d490f246e1ff801a08b401182b
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:32:37 2015 +0200
Change to relative imports
diff --git a/sqlobject/sresults.py b/sqlobject/sresults.py
index 71f880d..bbad18a 100644
--- a/sqlobject/sresults.py
+++ b/sqlobject/sresults.py
@@ -1,6 +1,6 @@
-import dbconnection
+from . import dbconnection
import main
-import sqlbuilder
+from . import sqlbuilder
__all__ = ['SelectResults']
http://sourceforge.net/p/sqlobject/sqlobject/ci/ccb2c23e4fc9f316d923377fd2b0c7d7fbc683a5
commit ccb2c23e4fc9f316d923377fd2b0c7d7fbc683a5
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:30:56 2015 +0200
Change to relative imports
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 225cbb2..c5f121b 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -3,20 +3,19 @@ from cgi import parse_qsl
import inspect
import new
import os
-import sys
import threading
import types
import urllib
import warnings
import weakref
-from cache import CacheSet
-import classregistry
-import col
-from converters import sqlrepr
+from .cache import CacheSet
+from . import classregistry
+from . import col
+from .converters import sqlrepr
import main
-import sqlbuilder
-from util.threadinglocal import local as threading_local
+from . import sqlbuilder
+from .util.threadinglocal import local as threading_local
warnings.filterwarnings("ignore", "DB-API extension cursor.lastrowid used")
@@ -335,7 +334,6 @@ class DBAPI(DBConnection):
``queryInsertID`` must also be defined.
"""
-
dbName = None
def __init__(self, **kw):
@@ -1086,11 +1084,11 @@ dbConnectionForScheme = TheURIOpener.dbConnectionForScheme
# Register DB URI schemas -- do import for side effects
# noqa is a directive for flake8 to ignore seemingly unused imports
-import firebird # noqa
-import maxdb # noqa
-import mssql # noqa
-import mysql # noqa
-import postgres # noqa
-import rdbhost # noqa
-import sqlite # noqa
-import sybase # noqa
+from . import firebird # noqa
+from . import maxdb # noqa
+from . import mssql # noqa
+from . import mysql # noqa
+from . import postgres # noqa
+from . import rdbhost # noqa
+from . import sqlite # noqa
+from . import sybase # noqa
http://sourceforge.net/p/sqlobject/sqlobject/ci/d2a7d7f46de9e7f42ff86a2063aea8bae30ce8e7
commit d2a7d7f46de9e7f42ff86a2063aea8bae30ce8e7
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:28:12 2015 +0200
Change to relative imports
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 583e821..d76e928 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -67,8 +67,8 @@ import threading
import types
import weakref
-import classregistry
-from converters import registerConverter, sqlrepr, quote_str, unquote_str
+from . import classregistry
+from .converters import registerConverter, sqlrepr, quote_str, unquote_str
class VersionError(Exception):
http://sourceforge.net/p/sqlobject/sqlobject/ci/667de45be78e3691c3157c05248a62fea6459fce
commit 667de45be78e3691c3157c05248a62fea6459fce
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:26:12 2015 +0200
Change to relative imports
diff --git a/sqlobject/col.py b/sqlobject/col.py
index daa970c..5c7aada 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -27,12 +27,12 @@ except ImportError:
import pickle
import weakref
from formencode import compound, validators
-from classregistry import findClass
+from .classregistry import findClass
# Sadly the name "constraints" conflicts with many of the function
# arguments in this module, so we rename it:
-import constraints as constrs
-import sqlbuilder
-from styles import capword
+from . import constraints as constrs
+from . import sqlbuilder
+from .styles import capword
NoDefault = sqlbuilder.NoDefault
http://sourceforge.net/p/sqlobject/sqlobject/ci/30e79370b363a83e24c19b520110cdcf8f6b1bbb
commit 30e79370b363a83e24c19b520110cdcf8f6b1bbb
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:25:21 2015 +0200
Change to relative imports
diff --git a/sqlobject/boundattributes.py b/sqlobject/boundattributes.py
index 72d1c5d..9b04b2e 100644
--- a/sqlobject/boundattributes.py
+++ b/sqlobject/boundattributes.py
@@ -26,8 +26,8 @@ attributes.
__all__ = ['BoundAttribute', 'BoundFactory', 'bind_attributes',
'bind_attributes_local']
-import declarative
-import events
+from . import declarative
+from . import events
class BoundAttribute(declarative.Declarative):
diff --git a/sqlobject/declarative.py b/sqlobject/declarative.py
index 04fbe5c..e825cfa 100644
--- a/sqlobject/declarative.py
+++ b/sqlobject/declarative.py
@@ -33,7 +33,7 @@ or an instance method depending on where it is called.
"""
import copy
-import events
+from . import events
import itertools
counter = itertools.count()
diff --git a/sqlobject/joins.py b/sqlobject/joins.py
index 4da0b97..02280a0 100644
--- a/sqlobject/joins.py
+++ b/sqlobject/joins.py
@@ -1,9 +1,9 @@
from itertools import count
-import classregistry
-import events
-import styles
-import sqlbuilder
-from styles import capword
+from . import classregistry
+from . import events
+from . import styles
+from . import sqlbuilder
+from .styles import capword
__all__ = ['MultipleJoin', 'SQLMultipleJoin', 'RelatedJoin', 'SQLRelatedJoin',
'SingleJoin', 'ManyToMany', 'OneToMany']
@@ -373,7 +373,7 @@ class SingleJoin(Join):
-import boundattributes
+from . import boundattributes
class SOManyToMany(object):
diff --git a/sqlobject/main.py b/sqlobject/main.py
index 7ad2267..e1ff1fa 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -28,19 +28,19 @@ USA.
import threading
import weakref
-import sqlbuilder
-import dbconnection
-import col
-import styles
import types
import warnings
-import joins
-import index
-import classregistry
-import declarative
-import events
-from sresults import SelectResults
-from util.threadinglocal import local
+from . import sqlbuilder
+from . import dbconnection
+from . import col
+from . import styles
+from . import joins
+from . import index
+from . import classregistry
+from . import declarative
+from . import events
+from .sresults import SelectResults
+from .util.threadinglocal import local
import sys
if ((sys.version_info[0] == 2) and (sys.version_info[:3] < (2, 6, 0))) \
... 61 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-02-05 18:37:15
|
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 6eabc0948f86083039f55c752a28022d7584f3f0 (commit)
via c8000d445dd39042d27acf250cad9259d7cce69a (commit)
via 7c664fbf69a1e19a2ae24e11f2ef8585df75b036 (commit)
via 6486cbea628913e0a3cef1f3f0f13ba156aeecfd (commit)
via a697f0f43f159d55ee365f55d1fc2087adec2e95 (commit)
from 4b8d897dbcacfa0b12378f18bfff7f1569a9acce (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/6eabc0948f86083039f55c752a28022d7584f3f0
commit 6eabc0948f86083039f55c752a28022d7584f3f0
Merge: 4b8d897 c8000d4
Author: Oleg Broytman <ph...@ph...>
Date: Thu Feb 5 21:29:09 2015 +0300
Merge pull request #59 from drnlm/more_import_fixes
Issue #3: More import fixes
http://sourceforge.net/p/sqlobject/sqlobject/ci/c8000d445dd39042d27acf250cad9259d7cce69a
commit c8000d445dd39042d27acf250cad9259d7cce69a
Author: Neil <ne...@di...>
Date: Thu Feb 5 11:07:40 2015 +0200
Handle renamed thread module in python 3
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 2f398c1..a62a9d8 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -1,6 +1,9 @@
import base64
import os
-import thread
+try:
+ from _thread import get_ident
+except ImportError:
+ from thread import get_ident
import urllib
from sqlobject.dbconnection import DBAPI, Boolean
from sqlobject import col
@@ -139,7 +142,7 @@ class SQLiteConnection(DBAPI):
self._connectionNumbers[id(conn)] = self._connectionCount
self._connectionCount += 1
return conn
- threadid = thread.get_ident()
+ threadid = get_ident()
if (self._pool is not None
and threadid in self._threadPool):
conn = self._threadPool[threadid]
http://sourceforge.net/p/sqlobject/sqlobject/ci/7c664fbf69a1e19a2ae24e11f2ef8585df75b036
commit 7c664fbf69a1e19a2ae24e11f2ef8585df75b036
Author: Neil <ne...@di...>
Date: Tue Feb 3 16:39:50 2015 +0200
Use relative imports in database connectors
diff --git a/sqlobject/firebird/__init__.py b/sqlobject/firebird/__init__.py
index b28e220..04201b4 100644
--- a/sqlobject/firebird/__init__.py
+++ b/sqlobject/firebird/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import firebirdconnection
+ from . import firebirdconnection
return firebirdconnection.FirebirdConnection
registerConnection(['firebird', 'interbase'], builder)
diff --git a/sqlobject/maxdb/__init__.py b/sqlobject/maxdb/__init__.py
index ec66af8..9f21914 100644
--- a/sqlobject/maxdb/__init__.py
+++ b/sqlobject/maxdb/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import maxdbconnection
+ from . import maxdbconnection
return maxdbconnection.MaxdbConnection
registerConnection(['maxdb', 'sapdb'], builder)
diff --git a/sqlobject/mssql/__init__.py b/sqlobject/mssql/__init__.py
index f266ffe..ca4c6f4 100644
--- a/sqlobject/mssql/__init__.py
+++ b/sqlobject/mssql/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import mssqlconnection
+ from . import mssqlconnection
return mssqlconnection.MSSQLConnection
registerConnection(['mssql'], builder)
diff --git a/sqlobject/mysql/__init__.py b/sqlobject/mysql/__init__.py
index 60215f5..19c68ff 100644
--- a/sqlobject/mysql/__init__.py
+++ b/sqlobject/mysql/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import mysqlconnection
+ from . import mysqlconnection
return mysqlconnection.MySQLConnection
registerConnection(['mysql'], builder)
diff --git a/sqlobject/postgres/__init__.py b/sqlobject/postgres/__init__.py
index d3d90a1..2b05378 100644
--- a/sqlobject/postgres/__init__.py
+++ b/sqlobject/postgres/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import pgconnection
+ from . import pgconnection
return pgconnection.PostgresConnection
registerConnection(['postgres', 'postgresql', 'psycopg'], builder)
diff --git a/sqlobject/rdbhost/__init__.py b/sqlobject/rdbhost/__init__.py
index ce86e9f..588c6a8 100644
--- a/sqlobject/rdbhost/__init__.py
+++ b/sqlobject/rdbhost/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import rdbhostconnection
+ from . import rdbhostconnection
return rdbhostconnection.RdbhostConnection
registerConnection(['rdbhost'], builder)
diff --git a/sqlobject/sqlite/__init__.py b/sqlobject/sqlite/__init__.py
index 7aa679e..54ed963 100644
--- a/sqlobject/sqlite/__init__.py
+++ b/sqlobject/sqlite/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import sqliteconnection
+ from . import sqliteconnection
return sqliteconnection.SQLiteConnection
registerConnection(['sqlite'], builder)
diff --git a/sqlobject/sybase/__init__.py b/sqlobject/sybase/__init__.py
index 8d2c27e..750cadc 100644
--- a/sqlobject/sybase/__init__.py
+++ b/sqlobject/sybase/__init__.py
@@ -2,7 +2,7 @@ from sqlobject.dbconnection import registerConnection
def builder():
- import sybaseconnection
+ from . import sybaseconnection
return sybaseconnection.SybaseConnection
registerConnection(['sybase'], builder)
http://sourceforge.net/p/sqlobject/sqlobject/ci/6486cbea628913e0a3cef1f3f0f13ba156aeecfd
commit 6486cbea628913e0a3cef1f3f0f13ba156aeecfd
Author: Neil <ne...@di...>
Date: Tue Feb 3 16:37:46 2015 +0200
Use relative import in inheritance
diff --git a/sqlobject/inheritance/__init__.py b/sqlobject/inheritance/__init__.py
index 271fab8..db71622 100644
--- a/sqlobject/inheritance/__init__.py
+++ b/sqlobject/inheritance/__init__.py
@@ -5,7 +5,7 @@ from sqlobject import sqlbuilder
from sqlobject.col import StringCol, ForeignKey
from sqlobject.main import sqlmeta, SQLObject, SelectResults, \
makeProperties, unmakeProperties, getterName, setterName
-import iteration
+from . import iteration
def tablesUsedSet(obj, db):
http://sourceforge.net/p/sqlobject/sqlobject/ci/a697f0f43f159d55ee365f55d1fc2087adec2e95
commit a697f0f43f159d55ee365f55d1fc2087adec2e95
Author: Neil <ne...@di...>
Date: Tue Feb 3 16:37:26 2015 +0200
Use relative import for dbtest imports
diff --git a/sqlobject/tests/test_cache.py b/sqlobject/tests/test_cache.py
index 931ab73..c256da3 100644
--- a/sqlobject/tests/test_cache.py
+++ b/sqlobject/tests/test_cache.py
@@ -1,5 +1,5 @@
from sqlobject import *
-from dbtest import *
+from .dbtest import *
from sqlobject.cache import CacheSet
diff --git a/sqlobject/tests/test_combining_joins.py b/sqlobject/tests/test_combining_joins.py
index 3423ec2..b92c45e 100644
--- a/sqlobject/tests/test_combining_joins.py
+++ b/sqlobject/tests/test_combining_joins.py
@@ -1,5 +1,5 @@
from sqlobject import *
-from dbtest import *
+from .dbtest import *
class ComplexGroup(SQLObject):
diff --git a/sqlobject/tests/test_csvexport.py b/sqlobject/tests/test_csvexport.py
index d491aff..d0f3392 100644
--- a/sqlobject/tests/test_csvexport.py
+++ b/sqlobject/tests/test_csvexport.py
@@ -1,7 +1,7 @@
from __future__ import print_function
from sqlobject import *
-from dbtest import *
+from .dbtest import *
from StringIO import StringIO
from sqlobject.util.csvexport import export_csv, export_csv_zip
diff --git a/sqlobject/tests/test_paste.py b/sqlobject/tests/test_paste.py
index 8c52dee..140e13e 100644
--- a/sqlobject/tests/test_paste.py
+++ b/sqlobject/tests/test_paste.py
@@ -1,6 +1,6 @@
from __future__ import print_function
-from dbtest import *
+from .dbtest import *
from sqlobject import sqlhub, SQLObject, StringCol
import py.test
try:
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index bc920bb..f47d9fe 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -2,8 +2,8 @@ import py.test
from sqlobject import *
from sqlobject.sqlbuilder import func
from sqlobject.main import SQLObjectIntegrityError
-from dbtest import *
-from dbtest import setSQLiteConnectionFactory
+from .dbtest import *
+from .dbtest import setSQLiteConnectionFactory
class IterTest(SQLObject):
-----------------------------------------------------------------------
Summary of changes:
sqlobject/firebird/__init__.py | 2 +-
sqlobject/inheritance/__init__.py | 2 +-
sqlobject/maxdb/__init__.py | 2 +-
sqlobject/mssql/__init__.py | 2 +-
sqlobject/mysql/__init__.py | 2 +-
sqlobject/postgres/__init__.py | 2 +-
sqlobject/rdbhost/__init__.py | 2 +-
sqlobject/sqlite/__init__.py | 2 +-
sqlobject/sqlite/sqliteconnection.py | 7 +++++--
sqlobject/sybase/__init__.py | 2 +-
sqlobject/tests/test_cache.py | 2 +-
sqlobject/tests/test_combining_joins.py | 2 +-
sqlobject/tests/test_csvexport.py | 2 +-
sqlobject/tests/test_paste.py | 2 +-
sqlobject/tests/test_select.py | 4 ++--
15 files changed, 20 insertions(+), 17 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-02-03 20:23:27
|
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 4b8d897dbcacfa0b12378f18bfff7f1569a9acce (commit)
via 1eacaf64c580bee845df7b7830aead387724b7cc (commit)
via 544408ccf13ee0ad8998db9d77f23a8b8b2aa859 (commit)
via 6ecb84f302397040b0c12e312355d15fb9a243c2 (commit)
via a2fe39fda757bbf703c6ac708ccf71281a413dd1 (commit)
via dd97f6ac5cfac402ebcbb1285daa2d888721142a (commit)
via 8895903ae1fedf23cae8e4b284f316003929e2ae (commit)
via ad708364ff9bdfd8a7156e02e6bc8ad48289e6a7 (commit)
via 8fc60f476480c7653477829b3ff535f3272ec278 (commit)
via eb239c22801f75e2cee2a138d2ffe36ea8d76b34 (commit)
via a680c0e4bd9bb26677db7e89ede3b31366215b1c (commit)
via 1f1cf53284781ef654021d7423ec54220fa2e48c (commit)
via 0d2d604bd250982aaffa5e1df845876252af2d53 (commit)
via bcd9a5e7e30ed1815061f029c5ab62fefed9d99b (commit)
via d821c5d70aaf309b73d6e5de0dc4701c4785e5c0 (commit)
via 917e212d8fe249bb55e324625ca0e9cef22cbeae (commit)
via 8811758b7b731b39bc63d0dada3aacece36dd392 (commit)
via 87937d000351cfd3addb0ac7f1a19de46a35bed5 (commit)
via c6c225a54d90533cf2a41f34e6f43a77198e9afd (commit)
from 4c186a80866582e7bf035cc55e28a5c2fd71b81d (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/4b8d897dbcacfa0b12378f18bfff7f1569a9acce
commit 4b8d897dbcacfa0b12378f18bfff7f1569a9acce
Merge: 1eacaf6 544408c
Author: Oleg Broytman <ph...@ph...>
Date: Tue Feb 3 23:21:59 2015 +0300
Merge branch 'flake8-fixes'
http://sourceforge.net/p/sqlobject/sqlobject/ci/1eacaf64c580bee845df7b7830aead387724b7cc
commit 1eacaf64c580bee845df7b7830aead387724b7cc
Merge: 4c186a8 6ecb84f
Author: Oleg Broytman <ph...@ph...>
Date: Tue Feb 3 23:14:26 2015 +0300
Merge pull request #58 from drnlm/Fix_relative_imports
Issue #3: Use relative imports
http://sourceforge.net/p/sqlobject/sqlobject/ci/544408ccf13ee0ad8998db9d77f23a8b8b2aa859
commit 544408ccf13ee0ad8998db9d77f23a8b8b2aa859
Merge: 87937d0 8811758
Author: Oleg Broytman <ph...@ph...>
Date: Tue Feb 3 23:10:40 2015 +0300
Merge pull request #57 from drnlm/issue_38_E251
Fix #38 - flake8 E251 unexpected spaces
flake8 E251: unexpected spaces around keyword / parameter equals
http://sourceforge.net/p/sqlobject/sqlobject/ci/6ecb84f302397040b0c12e312355d15fb9a243c2
commit 6ecb84f302397040b0c12e312355d15fb9a243c2
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:32:01 2015 +0200
Don't import new on python 3
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 5891342..d13db60 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -1,7 +1,11 @@
import atexit
from cgi import parse_qsl
import inspect
-import new
+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
http://sourceforge.net/p/sqlobject/sqlobject/ci/a2fe39fda757bbf703c6ac708ccf71281a413dd1
commit a2fe39fda757bbf703c6ac708ccf71281a413dd1
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:29:11 2015 +0200
Avoid dictionary changed crashes on import
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 136b680..68b4643 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1779,7 +1779,8 @@ def pushKey(kw, name, value):
kw[name] = value
all = []
-for key, value in globals().items():
+# Use copy() to avoid 'dictionary changed' issues on python 3
+for key, value in globals().copy().items():
if isinstance(value, type) and (issubclass(value, (Col, SOCol))):
all.append(key)
__all__.extend(all)
diff --git a/sqlobject/events.py b/sqlobject/events.py
index aadf5bb..cb4b971 100644
--- a/sqlobject/events.py
+++ b/sqlobject/events.py
@@ -345,6 +345,7 @@ def nice_repr(v):
__all__ = ['listen', 'send']
-for name, value in globals().items():
+# Use copy() to avoid 'dictionary changed' issues on python 3
+for name, value in globals().copy().items():
if isinstance(value, type) and issubclass(value, Signal):
__all__.append(name)
http://sourceforge.net/p/sqlobject/sqlobject/ci/dd97f6ac5cfac402ebcbb1285daa2d888721142a
commit dd97f6ac5cfac402ebcbb1285daa2d888721142a
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:28:40 2015 +0200
Add operator.div alias for python 3
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index d76e928..60472a3 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -66,6 +66,7 @@ import re
import threading
import types
import weakref
+import sys
from . import classregistry
from .converters import registerConverter, sqlrepr, quote_str, unquote_str
@@ -262,9 +263,15 @@ def tablesUsedSet(obj, db):
return {}
+if sys.version_info[0] < 3:
+ div = operator.div
+else:
+ div = operator.truediv
+
+
operatorMap = {
"+": operator.add,
- "/": operator.div,
+ "/": div,
"-": operator.sub,
"*": operator.mul,
"<": operator.lt,
http://sourceforge.net/p/sqlobject/sqlobject/ci/8895903ae1fedf23cae8e4b284f316003929e2ae
commit 8895903ae1fedf23cae8e4b284f316003929e2ae
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:27:14 2015 +0200
Add python3 alias
diff --git a/sqlobject/dberrors.py b/sqlobject/dberrors.py
index c14a86b..986c80d 100644
--- a/sqlobject/dberrors.py
+++ b/sqlobject/dberrors.py
@@ -5,6 +5,9 @@
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
+import sys
+if sys.version_info[0] >= 3:
+ StandardError = Exception
class Error(StandardError):
pass
http://sourceforge.net/p/sqlobject/sqlobject/ci/ad708364ff9bdfd8a7156e02e6bc8ad48289e6a7
commit ad708364ff9bdfd8a7156e02e6bc8ad48289e6a7
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:26:55 2015 +0200
Alias types and add some python 3 protections
diff --git a/sqlobject/converters.py b/sqlobject/converters.py
index b4c3862..efae0c5 100644
--- a/sqlobject/converters.py
+++ b/sqlobject/converters.py
@@ -2,7 +2,15 @@ from array import array
import datetime
from decimal import Decimal
import time
-from types import ClassType, InstanceType, NoneType
+import sys
+if sys.version_info[0] < 3:
+ from types import ClassType, InstanceType, NoneType
+else:
+ # Use suitable aliases for now
+ ClassType = type
+ NoneType = type(None)
+ # This is may not be what we want in all cases, but will do for now
+ InstanceType = object
try:
@@ -80,9 +88,13 @@ def StringLikeConverter(value, db):
return "'%s'" % value
registerConverter(str, StringLikeConverter)
-registerConverter(unicode, StringLikeConverter)
+if sys.version_info[0] < 3:
+ registerConverter(unicode, StringLikeConverter)
registerConverter(array, StringLikeConverter)
-registerConverter(buffer, StringLikeConverter)
+if sys.version_info[0] < 3:
+ registerConverter(buffer, StringLikeConverter)
+else:
+ registerConverter(memoryview, StringLikeConverter)
def IntConverter(value, db):
@@ -94,7 +106,8 @@ registerConverter(int, IntConverter)
def LongConverter(value, db):
return str(value)
-registerConverter(long, LongConverter)
+if sys.version_info[0] < 3:
+ registerConverter(long, LongConverter)
if NumericType:
registerConverter(NumericType, IntConverter)
http://sourceforge.net/p/sqlobject/sqlobject/ci/8fc60f476480c7653477829b3ff535f3272ec278
commit 8fc60f476480c7653477829b3ff535f3272ec278
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:33:34 2015 +0200
Avoid circular import issues in main.py
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index c5f121b..5891342 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -13,7 +13,6 @@ from .cache import CacheSet
from . import classregistry
from . import col
from .converters import sqlrepr
-import main
from . import sqlbuilder
from .util.threadinglocal import local as threading_local
@@ -667,6 +666,7 @@ class DBAPI(DBConnection):
self.sqlrepr(secondValue)))
def _SO_columnClause(self, soClass, kw):
+ from . import main
ops = {None: "IS"}
data = []
if 'id' in kw:
diff --git a/sqlobject/sresults.py b/sqlobject/sresults.py
index bbad18a..b740996 100644
--- a/sqlobject/sresults.py
+++ b/sqlobject/sresults.py
@@ -1,5 +1,4 @@
from . import dbconnection
-import main
from . import sqlbuilder
@@ -285,6 +284,7 @@ class SelectResults(object):
If more than one result is returned,
``SQLObjectIntegrityError`` will be raised.
"""
+ from . import main
results = list(self)
if not results:
if default is sqlbuilder.NoDefault:
http://sourceforge.net/p/sqlobject/sqlobject/ci/eb239c22801f75e2cee2a138d2ffe36ea8d76b34
commit eb239c22801f75e2cee2a138d2ffe36ea8d76b34
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:32:37 2015 +0200
Change to relative imports
diff --git a/sqlobject/sresults.py b/sqlobject/sresults.py
index 71f880d..bbad18a 100644
--- a/sqlobject/sresults.py
+++ b/sqlobject/sresults.py
@@ -1,6 +1,6 @@
-import dbconnection
+from . import dbconnection
import main
-import sqlbuilder
+from . import sqlbuilder
__all__ = ['SelectResults']
http://sourceforge.net/p/sqlobject/sqlobject/ci/a680c0e4bd9bb26677db7e89ede3b31366215b1c
commit a680c0e4bd9bb26677db7e89ede3b31366215b1c
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:30:56 2015 +0200
Change to relative imports
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 225cbb2..c5f121b 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -3,20 +3,19 @@ from cgi import parse_qsl
import inspect
import new
import os
-import sys
import threading
import types
import urllib
import warnings
import weakref
-from cache import CacheSet
-import classregistry
-import col
-from converters import sqlrepr
+from .cache import CacheSet
+from . import classregistry
+from . import col
+from .converters import sqlrepr
import main
-import sqlbuilder
-from util.threadinglocal import local as threading_local
+from . import sqlbuilder
+from .util.threadinglocal import local as threading_local
warnings.filterwarnings("ignore", "DB-API extension cursor.lastrowid used")
@@ -335,7 +334,6 @@ class DBAPI(DBConnection):
``queryInsertID`` must also be defined.
"""
-
dbName = None
def __init__(self, **kw):
@@ -1086,11 +1084,11 @@ dbConnectionForScheme = TheURIOpener.dbConnectionForScheme
# Register DB URI schemas -- do import for side effects
# noqa is a directive for flake8 to ignore seemingly unused imports
-import firebird # noqa
-import maxdb # noqa
-import mssql # noqa
-import mysql # noqa
-import postgres # noqa
-import rdbhost # noqa
-import sqlite # noqa
-import sybase # noqa
+from . import firebird # noqa
+from . import maxdb # noqa
+from . import mssql # noqa
+from . import mysql # noqa
+from . import postgres # noqa
+from . import rdbhost # noqa
+from . import sqlite # noqa
+from . import sybase # noqa
http://sourceforge.net/p/sqlobject/sqlobject/ci/1f1cf53284781ef654021d7423ec54220fa2e48c
commit 1f1cf53284781ef654021d7423ec54220fa2e48c
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:28:12 2015 +0200
Change to relative imports
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 583e821..d76e928 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -67,8 +67,8 @@ import threading
import types
import weakref
-import classregistry
-from converters import registerConverter, sqlrepr, quote_str, unquote_str
+from . import classregistry
+from .converters import registerConverter, sqlrepr, quote_str, unquote_str
class VersionError(Exception):
http://sourceforge.net/p/sqlobject/sqlobject/ci/0d2d604bd250982aaffa5e1df845876252af2d53
commit 0d2d604bd250982aaffa5e1df845876252af2d53
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:26:12 2015 +0200
Change to relative imports
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 5128eeb..136b680 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -27,12 +27,12 @@ except ImportError:
import pickle
import weakref
from formencode import compound, validators
-from classregistry import findClass
+from .classregistry import findClass
# Sadly the name "constraints" conflicts with many of the function
# arguments in this module, so we rename it:
-import constraints as constrs
-import sqlbuilder
-from styles import capword
+from . import constraints as constrs
+from . import sqlbuilder
+from .styles import capword
NoDefault = sqlbuilder.NoDefault
http://sourceforge.net/p/sqlobject/sqlobject/ci/bcd9a5e7e30ed1815061f029c5ab62fefed9d99b
commit bcd9a5e7e30ed1815061f029c5ab62fefed9d99b
Author: Neil <ne...@di...>
Date: Tue Feb 3 14:25:21 2015 +0200
Change to relative imports
diff --git a/sqlobject/boundattributes.py b/sqlobject/boundattributes.py
index 72d1c5d..9b04b2e 100644
--- a/sqlobject/boundattributes.py
+++ b/sqlobject/boundattributes.py
@@ -26,8 +26,8 @@ attributes.
__all__ = ['BoundAttribute', 'BoundFactory', 'bind_attributes',
'bind_attributes_local']
-import declarative
-import events
+from . import declarative
+from . import events
class BoundAttribute(declarative.Declarative):
diff --git a/sqlobject/declarative.py b/sqlobject/declarative.py
index 04fbe5c..e825cfa 100644
--- a/sqlobject/declarative.py
+++ b/sqlobject/declarative.py
@@ -33,7 +33,7 @@ or an instance method depending on where it is called.
"""
import copy
-import events
+from . import events
import itertools
counter = itertools.count()
diff --git a/sqlobject/joins.py b/sqlobject/joins.py
index 4da0b97..02280a0 100644
--- a/sqlobject/joins.py
+++ b/sqlobject/joins.py
@@ -1,9 +1,9 @@
from itertools import count
-import classregistry
-import events
-import styles
-import sqlbuilder
-from styles import capword
+from . import classregistry
+from . import events
+from . import styles
+from . import sqlbuilder
+from .styles import capword
__all__ = ['MultipleJoin', 'SQLMultipleJoin', 'RelatedJoin', 'SQLRelatedJoin',
'SingleJoin', 'ManyToMany', 'OneToMany']
@@ -373,7 +373,7 @@ class SingleJoin(Join):
-import boundattributes
+from . import boundattributes
class SOManyToMany(object):
diff --git a/sqlobject/main.py b/sqlobject/main.py
index 7ad2267..e1ff1fa 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
... 285 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-02-01 13:48:17
|
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 4c186a80866582e7bf035cc55e28a5c2fd71b81d (commit)
via 70294b7c584a3500bf6c8d63b234b4249a8f69e1 (commit)
via 0d2f3d1b14aeb087aceb72dc4b208fcbd210c772 (commit)
via dc59b33729e3a81e35d342b73ae70ede8448c376 (commit)
via d7ce0b146564a7292114bfdeb93c2c306076fe3b (commit)
from d4d62c29687742c98ea32116f28beb19bd485be6 (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/4c186a80866582e7bf035cc55e28a5c2fd71b81d
commit 4c186a80866582e7bf035cc55e28a5c2fd71b81d
Merge: d4d62c2 70294b7
Author: Oleg Broytman <ph...@ph...>
Date: Sun Feb 1 16:47:29 2015 +0300
Merge branch 'flake8-fixes'
http://sourceforge.net/p/sqlobject/sqlobject/ci/70294b7c584a3500bf6c8d63b234b4249a8f69e1
commit 70294b7c584a3500bf6c8d63b234b4249a8f69e1
Author: Oleg Broytman <ph...@ph...>
Date: Sun Feb 1 16:46:16 2015 +0300
Fix #28 flake8 E202 whitespace before ')'
diff --git a/sqlobject/include/hashcol.py b/sqlobject/include/hashcol.py
index f4a2aa2..8043aa7 100644
--- a/sqlobject/include/hashcol.py
+++ b/sqlobject/include/hashcol.py
@@ -8,60 +8,60 @@ class DbHash:
""" Presents a comparison object for hashes, allowing plain text to be
automagically compared with the base content. """
- def __init__(self, hash, hashMethod ):
+ def __init__(self, hash, hashMethod):
self.hash = hash
self.hashMethod = hashMethod
- def __cmp__(self, other ):
+ def __cmp__(self, other):
if other is None:
if self.hash is None:
return 0
return True
- if not isinstance(other, basestring ):
+ if not isinstance(other, basestring):
raise TypeError(
"A hash may only be compared with a string, or None.")
- return cmp(self.hashMethod(other ), self.hash )
+ return cmp(self.hashMethod(other), self.hash)
- def __repr__(self ):
+ def __repr__(self):
return "<DbHash>"
-class HashValidator(sqlobject.col.StringValidator ):
+class HashValidator(sqlobject.col.StringValidator):
""" Provides formal SQLObject validation services for the HashCol. """
- def to_python(self, value, state ):
+ def to_python(self, value, state):
""" Passes out a hash object. """
if value is None:
return None
- return DbHash(hash = value, hashMethod = self.hashMethod )
+ return DbHash(hash = value, hashMethod = self.hashMethod)
- def from_python(self, value, state ):
+ def from_python(self, value, state):
""" Store the given value as a MD5 hash, or None if specified. """
if value is None:
return None
- return self.hashMethod(value )
+ return self.hashMethod(value)
-class SOHashCol(sqlobject.col.SOStringCol ):
+class SOHashCol(sqlobject.col.SOStringCol):
""" The internal HashCol definition. By default, enforces a md5 digest. """
- def __init__(self, **kw ):
+ def __init__(self, **kw):
if 'hashMethod' not in kw:
from hashlib import md5
- self.hashMethod = lambda v: md5(v ).hexdigest()
+ self.hashMethod = lambda v: md5(v).hexdigest()
if 'length' not in kw:
kw['length'] = 32
else:
self.hashMethod = kw['hashMethod']
del kw['hashMethod']
- super(sqlobject.col.SOStringCol, self ).__init__(**kw )
+ super(sqlobject.col.SOStringCol, self).__init__(**kw)
- def createValidators(self ):
- return [HashValidator(name=self.name, hashMethod=self.hashMethod )] + \
- super(SOHashCol, self ).createValidators()
+ def createValidators(self):
+ return [HashValidator(name=self.name, hashMethod=self.hashMethod)] + \
+ super(SOHashCol, self).createValidators()
-class HashCol(sqlobject.col.StringCol ):
+class HashCol(sqlobject.col.StringCol):
""" End-user HashCol class. May be instantiated with 'hashMethod', a function
which returns the string hash of any other string (i.e. basestring). """
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index 76d7b76..8608f04 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -149,7 +149,7 @@ class MSSQLConnection(DBAPI):
values = [id] + values
elif has_identity and idName in names:
try:
- i = names.index(idName )
+ i = names.index(idName)
if i:
del names[i]
del values[i]
http://sourceforge.net/p/sqlobject/sqlobject/ci/0d2f3d1b14aeb087aceb72dc4b208fcbd210c772
commit 0d2f3d1b14aeb087aceb72dc4b208fcbd210c772
Author: Oleg Broytman <ph...@ph...>
Date: Sun Feb 1 16:43:59 2015 +0300
Fix #29 flake8 E201 whitespace after '('
diff --git a/sqlobject/include/hashcol.py b/sqlobject/include/hashcol.py
index 6a80374..f4a2aa2 100644
--- a/sqlobject/include/hashcol.py
+++ b/sqlobject/include/hashcol.py
@@ -8,60 +8,60 @@ class DbHash:
""" Presents a comparison object for hashes, allowing plain text to be
automagically compared with the base content. """
- def __init__( self, hash, hashMethod ):
+ def __init__(self, hash, hashMethod ):
self.hash = hash
self.hashMethod = hashMethod
- def __cmp__( self, other ):
+ def __cmp__(self, other ):
if other is None:
if self.hash is None:
return 0
return True
- if not isinstance( other, basestring ):
+ if not isinstance(other, basestring ):
raise TypeError(
"A hash may only be compared with a string, or None.")
- return cmp( self.hashMethod( other ), self.hash )
+ return cmp(self.hashMethod(other ), self.hash )
- def __repr__( self ):
+ def __repr__(self ):
return "<DbHash>"
-class HashValidator( sqlobject.col.StringValidator ):
+class HashValidator(sqlobject.col.StringValidator ):
""" Provides formal SQLObject validation services for the HashCol. """
- def to_python( self, value, state ):
+ def to_python(self, value, state ):
""" Passes out a hash object. """
if value is None:
return None
- return DbHash( hash = value, hashMethod = self.hashMethod )
+ return DbHash(hash = value, hashMethod = self.hashMethod )
- def from_python( self, value, state ):
+ def from_python(self, value, state ):
""" Store the given value as a MD5 hash, or None if specified. """
if value is None:
return None
- return self.hashMethod( value )
+ return self.hashMethod(value )
-class SOHashCol( sqlobject.col.SOStringCol ):
+class SOHashCol(sqlobject.col.SOStringCol ):
""" The internal HashCol definition. By default, enforces a md5 digest. """
- def __init__( self, **kw ):
+ def __init__(self, **kw ):
if 'hashMethod' not in kw:
from hashlib import md5
- self.hashMethod = lambda v: md5( v ).hexdigest()
+ self.hashMethod = lambda v: md5(v ).hexdigest()
if 'length' not in kw:
kw['length'] = 32
else:
self.hashMethod = kw['hashMethod']
del kw['hashMethod']
- super( sqlobject.col.SOStringCol, self ).__init__( **kw )
+ super(sqlobject.col.SOStringCol, self ).__init__(**kw )
- def createValidators( self ):
- return [HashValidator( name=self.name, hashMethod=self.hashMethod )] + \
- super( SOHashCol, self ).createValidators()
+ def createValidators(self ):
+ return [HashValidator(name=self.name, hashMethod=self.hashMethod )] + \
+ super(SOHashCol, self ).createValidators()
-class HashCol( sqlobject.col.StringCol ):
+class HashCol(sqlobject.col.StringCol ):
""" End-user HashCol class. May be instantiated with 'hashMethod', a function
which returns the string hash of any other string (i.e. basestring). """
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index cfbdec3..76d7b76 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -149,7 +149,7 @@ class MSSQLConnection(DBAPI):
values = [id] + values
elif has_identity and idName in names:
try:
- i = names.index( idName )
+ i = names.index(idName )
if i:
del names[i]
del values[i]
http://sourceforge.net/p/sqlobject/sqlobject/ci/dc59b33729e3a81e35d342b73ae70ede8448c376
commit dc59b33729e3a81e35d342b73ae70ede8448c376
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 31 20:05:29 2015 +0300
Fix #24 flake8 E221 multiple spaces before operator
diff --git a/setup.cfg b/setup.cfg
index c957a12..069a010 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -13,7 +13,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
-; E221 multiple spaces before operator
; E226 missing whitespace around arithmetic operator
; E401 multiple imports on one line
; E502 the backslash is redundant between brackets
@@ -26,7 +25,7 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; W293 blank line contains whitespace
; W391 blank line at end of file
; W603 '<>' is deprecated, use '!='
-ignore = E123,E124,E221,E226,E401,E502,F402,F403,F812,F821,F822,W291,W293,W391,W603
+ignore = E123,E124,E226,E401,E502,F402,F403,F812,F821,F822,W291,W293,W391,W603
[pudge]
theme = pythonpaste.org
diff --git a/sqlobject/__version__.py b/sqlobject/__version__.py
index a388dcf..d992f6c 100644
--- a/sqlobject/__version__.py
+++ b/sqlobject/__version__.py
@@ -1,8 +1,8 @@
version = '3.0'
-major = 3
-minor = 0
-micro = 0
+major = 3
+minor = 0
+micro = 0
release_level = 'trunk'
-serial = 0
+serial = 0
version_info = (major, minor, micro, release_level, serial)
diff --git a/sqlobject/col.py b/sqlobject/col.py
index cd262a9..5128eeb 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -999,7 +999,7 @@ class SOForeignKey(SOKeyCol):
# to the id of the reference table
sql = ' '.join([fidName, self._maxdbType()])
tName = other.sqlmeta.table
- idName = self.refColumn or other.sqlmeta.idName
+ idName = self.refColumn or other.sqlmeta.idName
sql = sql + ',' + '\n'
sql = sql + 'FOREIGN KEY (%s) REFERENCES %s(%s)' % (fidName, tName,
idName)
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index 56a23a4..ecf0c54 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -185,7 +185,7 @@ class FirebirdConnection(DBAPI):
self.defaultDbEncoding = str(self.queryOne(
"SELECT rdb$character_set_name FROM rdb$database")[0].\
strip().lower()) # encoding defined during db creation
- if self.defaultDbEncoding == "none":
+ if self.defaultDbEncoding == "none":
self.defaultDbEncoding = None
if self.dbEncoding != self.defaultDbEncoding:
warningText = """\n
diff --git a/sqlobject/inheritance/__init__.py b/sqlobject/inheritance/__init__.py
index 5bc9cae..a586ded 100644
--- a/sqlobject/inheritance/__init__.py
+++ b/sqlobject/inheritance/__init__.py
@@ -183,7 +183,7 @@ class InheritableSQLMeta(sqlmeta):
if sqlmeta.parentClass:
for join in sqlmeta.parentClass.sqlmeta.joins:
jname = join.joinMethodName
- jarn = join.addRemoveName
+ jarn = join.addRemoveName
setattr(
soClass, getterName(jname),
eval('lambda self: self._parent.%s' % jname))
diff --git a/sqlobject/inheritance/tests/test_indexes.py b/sqlobject/inheritance/tests/test_indexes.py
index 687d1f8..f2b393b 100644
--- a/sqlobject/inheritance/tests/test_indexes.py
+++ b/sqlobject/inheritance/tests/test_indexes.py
@@ -4,21 +4,21 @@ from sqlobject.inheritance import InheritableSQLObject
class InheritedPersonIndexGet(InheritableSQLObject):
- first_name = StringCol(notNone=True, length=100)
- last_name = StringCol(notNone=True, length=100)
- age = IntCol()
- pk = DatabaseIndex(first_name, last_name, unique=True)
+ first_name = StringCol(notNone=True, length=100)
+ last_name = StringCol(notNone=True, length=100)
+ age = IntCol()
+ pk = DatabaseIndex(first_name, last_name, unique=True)
class InheritedEmployeeIndexGet(InheritedPersonIndexGet):
security_number = IntCol()
- experience = IntCol()
- sec_index = DatabaseIndex(security_number, unique=True)
+ experience = IntCol()
+ sec_index = DatabaseIndex(security_number, unique=True)
class InheritedSalesManIndexGet(InheritedEmployeeIndexGet):
_inheritable = False
- skill = IntCol()
+ skill = IntCol()
def test_index_get_1():
diff --git a/sqlobject/maxdb/maxdbconnection.py b/sqlobject/maxdb/maxdbconnection.py
index 4e70e75..01ce60b 100644
--- a/sqlobject/maxdb/maxdbconnection.py
+++ b/sqlobject/maxdb/maxdbconnection.py
@@ -69,15 +69,15 @@ class MaxdbConnection(DBAPI):
isolation=None, timeout=None, **kw):
from sapdb import dbapi
self.module = dbapi
- self.host = host
- self.port = port
- self.user = user
- self.password = password
- self.db = database
+ self.host = host
+ self.port = port
+ self.user = user
+ self.password = password
+ self.db = database
self.autoCommit = autoCommit
- self.sqlmode = sqlmode
+ self.sqlmode = sqlmode
self.isolation = isolation
- self.timeout = timeout
+ self.timeout = timeout
DBAPI.__init__(self, **kw)
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 4b59bc8..583e821 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -669,7 +669,7 @@ class Select(SQLExpression):
self.ops['having'] = having
self.ops['orderBy'] = orderBy
self.ops['limit'] = limit
- self.ops['join'] = join
+ self.ops['join'] = join
self.ops['lazyColumns'] = lazyColumns
self.ops['distinct'] = distinct
self.ops['distinctOn'] = distinctOn
diff --git a/sqlobject/tests/test_indexes.py b/sqlobject/tests/test_indexes.py
index fbf4717..5b2277e 100644
--- a/sqlobject/tests/test_indexes.py
+++ b/sqlobject/tests/test_indexes.py
@@ -75,16 +75,16 @@ def test_index_get_1():
class PersonIndexGet2(SQLObject):
- name = StringCol(alternateID=True, length=100)
- age = IntCol()
- addresses = MultipleJoin('AddressIndexGet2')
+ name = StringCol(alternateID=True, length=100)
+ age = IntCol()
+ addresses = MultipleJoin('AddressIndexGet2')
class AddressIndexGet2(SQLObject):
- person = ForeignKey('PersonIndexGet2', notNone=True)
- type = StringCol(notNone=True, length=100)
- street = StringCol(notNone=True)
- pk = DatabaseIndex(person, type, unique=True)
+ person = ForeignKey('PersonIndexGet2', notNone=True)
+ type = StringCol(notNone=True, length=100)
+ street = StringCol(notNone=True)
+ pk = DatabaseIndex(person, type, unique=True)
def test_index_get_2():
diff --git a/sqlobject/tests/test_select_through.py b/sqlobject/tests/test_select_through.py
index 4a91627..f70a5b1 100644
--- a/sqlobject/tests/test_select_through.py
+++ b/sqlobject/tests/test_select_through.py
@@ -9,7 +9,7 @@ import py
class SRThrough1(SQLObject):
three = ForeignKey('SRThrough3')
- twos = SQLMultipleJoin('SRThrough2', joinColumn='oneID')
+ twos = SQLMultipleJoin('SRThrough2', joinColumn='oneID')
class SRThrough2(SQLObject):
@@ -37,8 +37,8 @@ def setup_module(mod):
twos[0].addThree(threes[0])
twos[0].addThree(threes[1])
mod.threes = threes
- mod.twos = twos
- mod.ones = ones
+ mod.twos = twos
+ mod.ones = ones
def testBadRef():
diff --git a/sqlobject/views.py b/sqlobject/views.py
index b203e0b..862b8dd 100644
--- a/sqlobject/views.py
+++ b/sqlobject/views.py
@@ -78,7 +78,7 @@ class ViewSQLObject(SQLObject):
else:
columns.append(ascol)
- metajoin = getattr(cls.sqlmeta, 'join', NoDefault)
+ metajoin = getattr(cls.sqlmeta, 'join', NoDefault)
clause = getattr(cls.sqlmeta, 'clause', NoDefault)
select = Select(columns,
distinct=True,
http://sourceforge.net/p/sqlobject/sqlobject/ci/d7ce0b146564a7292114bfdeb93c2c306076fe3b
commit d7ce0b146564a7292114bfdeb93c2c306076fe3b
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 31 02:31:30 2015 +0300
Fix #26 flake8 E126 continuation line over-indented
diff --git a/setup.cfg b/setup.cfg
index 82f72a1..c957a12 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -13,7 +13,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
-; E126 continuation line over-indented for hanging indent
; E221 multiple spaces before operator
; E226 missing whitespace around arithmetic operator
; E401 multiple imports on one line
@@ -27,7 +26,7 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; W293 blank line contains whitespace
; W391 blank line at end of file
; W603 '<>' is deprecated, use '!='
-ignore = E123,E124,E126,E221,E226,E401,E502,F402,F403,F812,F821,F822,W291,W293,W391,W603
+ignore = E123,E124,E221,E226,E401,E502,F402,F403,F812,F821,F822,W291,W293,W391,W603
[pudge]
theme = pythonpaste.org
diff --git a/setup.py b/setup.py
index bcb4e8f..86dfe5a 100755
--- a/setup.py
+++ b/setup.py
@@ -62,19 +62,19 @@ and `GitHub <https://github.com/sqlobject>`_.
:target: https://travis-ci.org/sqlobject/sqlobject
""",
classifiers=[
- "Development Status :: 2 - Pre-Alpha",
- "Intended Audience :: Developers",
- "License :: OSI Approved :: "
- "GNU Library or Lesser General Public License (LGPL)",
- "Programming Language :: Python",
- "Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.6",
... 387 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-26 18:41:31
|
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 d4d62c29687742c98ea32116f28beb19bd485be6 (commit)
via 47ab39269bc982300f002d4edaa2395838125375 (commit)
via bdd9c455145c675517dfd1023766c57baf81248d (commit)
via 86bbf2cc2f501dddad230797f70e02e78fb3c193 (commit)
via 258f0fb3c9240247be9d73df1710441aca0fa05f (commit)
from 1711dd6a30542d836254f8045f2ffdff61b44947 (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/d4d62c29687742c98ea32116f28beb19bd485be6
commit d4d62c29687742c98ea32116f28beb19bd485be6
Merge: 1711dd6 47ab392
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 26 21:41:00 2015 +0300
Merge branch 'flake8-fixes'
http://sourceforge.net/p/sqlobject/sqlobject/ci/47ab39269bc982300f002d4edaa2395838125375
commit 47ab39269bc982300f002d4edaa2395838125375
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 26 21:39:48 2015 +0300
Explicitly list all F* and W* warnings to ignore
diff --git a/setup.cfg b/setup.cfg
index ef3f0d2..82f72a1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,7 +18,16 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; E226 missing whitespace around arithmetic operator
; E401 multiple imports on one line
; E502 the backslash is redundant between brackets
-ignore = E123,E124,E126,E221,E226,E401,E502,F
+; F402 import 'name' shadowed by loop variable
+; F403 'from module import *' used; unable to detect undefined names
+; F812 list comprehension redefines 'name' from line 1402
+; F821 undefined name
+; F822 undefined name in __all__
+; W291 trailing whitespace
+; W293 blank line contains whitespace
+; W391 blank line at end of file
+; W603 '<>' is deprecated, use '!='
+ignore = E123,E124,E126,E221,E226,E401,E502,F402,F403,F812,F821,F822,W291,W293,W391,W603
[pudge]
theme = pythonpaste.org
http://sourceforge.net/p/sqlobject/sqlobject/ci/bdd9c455145c675517dfd1023766c57baf81248d
commit bdd9c455145c675517dfd1023766c57baf81248d
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 26 21:30:39 2015 +0300
Fix #23 flake8 E701 multiple statements on one line
diff --git a/setup.cfg b/setup.cfg
index 85d1659..ef3f0d2 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,8 +18,7 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; E226 missing whitespace around arithmetic operator
; E401 multiple imports on one line
; E502 the backslash is redundant between brackets
-; E701 multiple statements on one line (colon)
-ignore = E123,E124,E126,E221,E226,E401,E502,E701,F
+ignore = E123,E124,E126,E221,E226,E401,E502,F
[pudge]
theme = pythonpaste.org
diff --git a/sqlobject/col.py b/sqlobject/col.py
index c9378c9..a087c8f 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -206,8 +206,10 @@ class SOCol(object):
self.alternateMethodName = alternateMethodName
_validators = self.createValidators()
- if validator: _validators.append(validator)
- if validator2: _validators.insert(0, validator2)
+ if validator:
+ _validators.append(validator)
+ if validator2:
+ _validators.insert(0, validator2)
_vlen = len(_validators)
if _vlen:
for _validator in _validators:
@@ -1342,7 +1344,8 @@ class SODateCol(SOCol):
def __init__(self, **kw):
dateFormat = kw.pop('dateFormat', None)
- if dateFormat: self.dateFormat = dateFormat
+ if dateFormat:
+ self.dateFormat = dateFormat
super(SODateCol, self).__init__(**kw)
def createValidators(self):
@@ -1685,7 +1688,8 @@ class SOBLOBCol(SOStringCol):
def __init__(self, **kw):
# Change the default from 'auto' to False -
# this is a (mostly) binary column
- if 'varchar' not in kw: kw['varchar'] = False
+ if 'varchar' not in kw:
+ kw['varchar'] = False
super(SOBLOBCol, self).__init__(**kw)
def createValidators(self):
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index a2a9885..9d0aa81 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -220,7 +220,8 @@ class DBConnection:
user, password = [x and urllib.unquote(x) or None
for x in urllib.splitpasswd(user)]
host, port = urllib.splitport(host)
- if port: port = int(port)
+ if port:
+ port = int(port)
elif host == '':
host = None
diff --git a/sqlobject/dberrors.py b/sqlobject/dberrors.py
index 1e18a42..c14a86b 100644
--- a/sqlobject/dberrors.py
+++ b/sqlobject/dberrors.py
@@ -6,34 +6,45 @@
"""
-class Error(StandardError): pass
+class Error(StandardError):
+ pass
-class Warning(StandardError): pass
+class Warning(StandardError):
+ pass
-class InterfaceError(Error): pass
+class InterfaceError(Error):
+ pass
-class DatabaseError(Error): pass
+class DatabaseError(Error):
+ pass
-class InternalError(DatabaseError): pass
+class InternalError(DatabaseError):
+ pass
-class OperationalError(DatabaseError): pass
+class OperationalError(DatabaseError):
+ pass
-class ProgrammingError(DatabaseError): pass
+class ProgrammingError(DatabaseError):
+ pass
-class IntegrityError(DatabaseError): pass
+class IntegrityError(DatabaseError):
+ pass
-class DataError(DatabaseError): pass
+class DataError(DatabaseError):
+ pass
-class NotSupportedError(DatabaseError): pass
+class NotSupportedError(DatabaseError):
+ pass
-class DuplicateEntryError(IntegrityError): pass
+class DuplicateEntryError(IntegrityError):
+ pass
diff --git a/sqlobject/inheritance/__init__.py b/sqlobject/inheritance/__init__.py
index 9e0aa1a..5bc9cae 100644
--- a/sqlobject/inheritance/__init__.py
+++ b/sqlobject/inheritance/__init__.py
@@ -108,8 +108,10 @@ class InheritableSQLMeta(sqlmeta):
if sqlmeta.parentClass:
for col in sqlmeta.parentClass.sqlmeta.columnList:
cname = col.name
- if cname == 'childName': continue
- if cname.endswith("ID"): cname = cname[:-2]
+ if cname == 'childName':
+ continue
+ if cname.endswith("ID"):
+ cname = cname[:-2]
setattr(soClass, getterName(cname), eval(
'lambda self: self._parent.%s' % cname))
if not col.immutable:
@@ -144,7 +146,8 @@ class InheritableSQLMeta(sqlmeta):
for c in sqlmeta.childClasses.values():
c.sqlmeta.addColumn(columnDef, connection=connection,
childUpdate=True)
- if q: setattr(c.q, columnDef.name, q)
+ if q:
+ setattr(c.q, columnDef.name, q)
@classmethod
def delColumn(sqlmeta, column, changeSchema=False, connection=None,
@@ -305,7 +308,8 @@ class InheritableSQLObject(SQLObject):
selectResults)
# DSM: If we are updating a child, we should never return a child...
- if childUpdate: return val
+ if childUpdate:
+ return val
# DSM: If this class has a child, return the child
if 'childName' in cls.sqlmeta.columns:
childName = val.childName
diff --git a/sqlobject/inheritance/iteration.py b/sqlobject/inheritance/iteration.py
index 9f4e5c0..25f97a9 100644
--- a/sqlobject/inheritance/iteration.py
+++ b/sqlobject/inheritance/iteration.py
@@ -25,7 +25,8 @@ class InheritableIteration(Iteration):
def next(self):
if not self._results:
self._results = list(self.cursor.fetchmany())
- if not self.lazyColumns: self.fetchChildren()
+ if not self.lazyColumns:
+ self.fetchChildren()
if not self._results:
self._cleanup()
raise StopIteration
diff --git a/sqlobject/main.py b/sqlobject/main.py
index dc0fd7d..7ad2267 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -56,10 +56,12 @@ is created. See SQLObject._create
NoDefault = sqlbuilder.NoDefault
-class SQLObjectNotFound(LookupError): pass
+class SQLObjectNotFound(LookupError):
+ pass
-class SQLObjectIntegrityError(Exception): pass
+class SQLObjectIntegrityError(Exception):
+ pass
def makeProperties(obj):
diff --git a/sqlobject/manager/command.py b/sqlobject/manager/command.py
index f1645fc..099958a 100755
--- a/sqlobject/manager/command.py
+++ b/sqlobject/manager/command.py
@@ -206,7 +206,8 @@ class Command(object):
# contamination.
# yemartin - 2006-08-08
- class SQLObjectCircularReferenceError(Exception): pass
+ class SQLObjectCircularReferenceError(Exception):
+ pass
def findReverseDependencies(cls):
"""
diff --git a/sqlobject/mssql/mssqlconnection.py b/sqlobject/mssql/mssqlconnection.py
index ac94a0d..cfbdec3 100644
--- a/sqlobject/mssql/mssqlconnection.py
+++ b/sqlobject/mssql/mssqlconnection.py
@@ -78,7 +78,8 @@ class MSSQLConnection(DBAPI):
('port', keys.port),
('database', keys.db),
):
- if value: keys_dict[attr] = value
+ if value:
+ keys_dict[attr] = value
return keys_dict
self.make_conn_str = _make_conn_str
@@ -263,9 +264,12 @@ class MSSQLConnection(DBAPI):
if defaultText[0] == "'":
defaultText = defaultText[1:-1]
else:
- if t == "int" : defaultText = int(defaultText)
- if t == "float" : defaultText = float(defaultText)
- if t == "numeric": defaultText = float(defaultText)
+ if t == "int" :
+ defaultText = int(defaultText)
+ if t == "float" :
+ defaultText = float(defaultText)
+ if t == "numeric":
+ defaultText = float(defaultText)
# TODO need to access the "column" to_python method here --
# but the object doesn't exists yet.
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index ad54e03..512e36e 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -230,7 +230,8 @@ class MySQLConnection(DBAPI):
colClass, kw = self.guessClass(t)
if self.kw.get('use_unicode') and colClass is col.StringCol:
colClass = col.UnicodeCol
- if self.dbEncoding: kw['dbEncoding'] = self.dbEncoding
+ if self.dbEncoding:
+ kw['dbEncoding'] = self.dbEncoding
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['dbName'] = field
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 4ed83a5..d7fe8cb 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -155,7 +155,8 @@ class PostgresConnection(DBAPI):
# For printDebug in _executeRetry
self._connectionNumbers[id(conn)] = self._connectionCount
- if self.autoCommit: self._setAutoCommit(conn, 1)
+ if self.autoCommit:
+ self._setAutoCommit(conn, 1)
c = conn.cursor()
if self.schema:
self._executeRetry(conn, c, "SET search_path TO " + self.schema)
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 24eb9f3..0377520 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -754,9 +754,11 @@ class Select(SQLExpression):
tables.update(tablesUsedSet(thing, db))
for j in join:
t1 = _str_or_sqlrepr(j.table1, db)
- if t1 in tables: tables.remove(t1)
+ if t1 in tables:
+ tables.remove(t1)
t2 = _str_or_sqlrepr(j.table2, db)
- if t2 in tables: tables.remove(t2)
+ if t2 in tables:
+ tables.remove(t2)
if tables:
select += " FROM %s" % ", ".join(sorted(tables))
elif join:
@@ -1563,6 +1565,7 @@ if __name__ == "__main__":
>>> Replace(table.address, [("BOB", "3049 N. 18th St."), ("TIM", "409 S. 10th St.")], template=('name', 'address'))
""" # noqa: allow long (> 79) lines
for expr in tests.split('\n'):
- if not expr.strip(): continue
+ if not expr.strip():
+ continue
if expr.startswith('>>> '):
expr = expr[4:]
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 89400b0..2f398c1 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -360,9 +360,11 @@ class SQLiteConnection(DBAPI):
colData = colData[0].split('(', 1)[1].strip()[:-2]
while True:
start = colData.find('(')
- if start == -1: break
+ if start == -1:
+ break
end = colData.find(')', start)
- if end == -1: break
+ if end == -1:
+ break
colData = colData[:start] + colData[end+1:]
results = []
for colDesc in colData.split(','):
diff --git a/sqlobject/versioning/__init__.py b/sqlobject/versioning/__init__.py
index 7c08ebb..a6a4141 100644
--- a/sqlobject/versioning/__init__.py
+++ b/sqlobject/versioning/__init__.py
@@ -53,7 +53,8 @@ def getColumns(columns, cls):
# remove incompatible constraints
kwds = dict(defi._kw)
for kw in ["alternateID", "unique"]:
- if kw in kwds: del kwds[kw]
+ if kw in kwds:
+ del kwds[kw]
columns[column] = defi.__class__(**kwds)
# ascend heirarchy
http://sourceforge.net/p/sqlobject/sqlobject/ci/86bbf2cc2f501dddad230797f70e02e78fb3c193
commit 86bbf2cc2f501dddad230797f70e02e78fb3c193
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 24 12:18:54 2015 +0300
Fix #11 flake8 E302 expected 2 blank lines
diff --git a/docs/interface.py b/docs/interface.py
index 0a57f8a..6bd4a68 100644
--- a/docs/interface.py
+++ b/docs/interface.py
@@ -4,9 +4,11 @@ provides. While its in the form of a formal interface, it doesn't
use any interface system.
"""
+
class Interface(object):
pass
+
class ISQLObject(Interface):
sqlmeta = """
@@ -125,6 +127,7 @@ class ISQLObject(Interface):
configured database connection.
"""
+
class Isqlmeta(Interface):
table = """
@@ -287,6 +290,7 @@ class ICol(Interface):
object is assigned to.
"""
+
class ISOCol(Interface):
"""
diff --git a/docs/test.py b/docs/test.py
index 4e228e8..a6e475e 100644
--- a/docs/test.py
+++ b/docs/test.py
@@ -4,6 +4,7 @@ import doctest
sys.path.insert(
0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
def test():
for doc in ['SQLObject.txt']:
doctest.testfile(doc, optionflags=doctest.ELLIPSIS)
diff --git a/setup.cfg b/setup.cfg
index f59c08a..85d1659 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,11 +16,10 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; E126 continuation line over-indented for hanging indent
; E221 multiple spaces before operator
; E226 missing whitespace around arithmetic operator
-; E302 expected 2 blank lines, found <n>
; E401 multiple imports on one line
; E502 the backslash is redundant between brackets
; E701 multiple statements on one line (colon)
-ignore = E123,E124,E126,E221,E226,E302,E401,E502,E701,F
+ignore = E123,E124,E126,E221,E226,E401,E502,E701,F
[pudge]
theme = pythonpaste.org
diff --git a/sqlobject/boundattributes.py b/sqlobject/boundattributes.py
index b6b013f..72d1c5d 100644
--- a/sqlobject/boundattributes.py
+++ b/sqlobject/boundattributes.py
@@ -29,6 +29,7 @@ __all__ = ['BoundAttribute', 'BoundFactory', 'bind_attributes',
import declarative
import events
+
class BoundAttribute(declarative.Declarative):
"""
@@ -114,6 +115,7 @@ class BoundAttribute(declarative.Declarative):
self.__dict__['_all_attrs'] = self._add_attrs(self, {name: value})
self.__dict__[name] = value
+
class BoundFactory(BoundAttribute):
"""
diff --git a/sqlobject/cache.py b/sqlobject/cache.py
index 736e0e7..690b137 100644
--- a/sqlobject/cache.py
+++ b/sqlobject/cache.py
@@ -9,6 +9,7 @@ objects in a cache that doesn't allow them to be garbage collected
import threading
from weakref import ref
+
class CacheFactory(object):
"""
@@ -277,6 +278,7 @@ class CacheFactory(object):
all.append(value())
return all
+
class CacheSet(object):
"""
diff --git a/sqlobject/classregistry.py b/sqlobject/classregistry.py
index 7681718..132afef 100644
... 6523 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-20 20:56: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 1711dd6a30542d836254f8045f2ffdff61b44947 (commit)
via 4b27e7a8884c4a9060b1fbf655e926b100976135 (commit)
via e20eb5580d60fc7fb6611fc828e50ff3facc3384 (commit)
via 42356bd06f13d161e6e1c1aedacc064b13d9e4a5 (commit)
via d9258bfd300af2343389dca94017561db6c72a2f (commit)
via 82fbef11cf975ed2cba518afbbc57e23f65fe6ba (commit)
via 051e1c969930009e0b3e634cd2fbf90526a0627d (commit)
via f67843a69941a12962bbef4acb35d5e431740118 (commit)
via 4554be711062c346ea161cb74271d0abd2843ecf (commit)
via 17a6f70b21cb194d5e15cbe88421f48ad4cd69b1 (commit)
via a19132ea7b132dbc5ceb60d221c5e0e11c7206c1 (commit)
via c74a965c183ddd193e3040ebb660a4ac19f9a039 (commit)
via c728128ff3387fbf78f42f64d9985d117ec7c9fd (commit)
via 524a742996f7efffb5f8cf00d062283f4473e6b7 (commit)
via b1de2edcee3bbf17c8b8927cb36a72a7e92ac42a (commit)
via 6720c05b668e88f75601d136560e414bc3009ced (commit)
via dcf5a9fd11dc18d187c6fb5170712f3f829b9491 (commit)
via dc1f5b4a5f91d5e327ab54f0e8b5ba2c8caf2191 (commit)
via 5fd2cc1d1b3b301a3cb4d6146acc5f9c07bf33ad (commit)
via 7974c0ce8b08cbbcac6e872a8e8c9b4ad1419925 (commit)
via d4374a6696bbfeb45aa6e772350c4f067197ba4f (commit)
via da164e0b4f5b6905a4484cba3b2bd11fa5218326 (commit)
via d19da7986a204d72c3845d08735308fc0dad3718 (commit)
via e91a3f3a7750f92f85874db120cfd44f1295563c (commit)
via abfb5ed80c67df511477e17b9e031403dd806149 (commit)
via c5b51ced08b1b66059ceab7c94ce120dfb376981 (commit)
via 223c4deb29df12b49b3dfddd5dc3eef2a99a45f0 (commit)
via 84a2aa1187cf7a9ec7593920d9ad0708b7d28f55 (commit)
from 30d92f73c22087bd69e58b44153912dea1eadd25 (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/1711dd6a30542d836254f8045f2ffdff61b44947
commit 1711dd6a30542d836254f8045f2ffdff61b44947
Merge: 30d92f7 4b27e7a
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 20 23:54:47 2015 +0300
Merge branch 'flake8-fixes'
http://sourceforge.net/p/sqlobject/sqlobject/ci/4b27e7a8884c4a9060b1fbf655e926b100976135
commit 4b27e7a8884c4a9060b1fbf655e926b100976135
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 20 23:54:08 2015 +0300
Fix #12 flake8 E501 line too long
diff --git a/setup.cfg b/setup.cfg
index 1e37b25..f59c08a 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,10 +18,9 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; E226 missing whitespace around arithmetic operator
; E302 expected 2 blank lines, found <n>
; E401 multiple imports on one line
-; E501 line too long (168 > 79 characters)
; E502 the backslash is redundant between brackets
; E701 multiple statements on one line (colon)
-ignore = E123,E124,E126,E221,E226,E302,E401,E501,E502,E701,F
+ignore = E123,E124,E126,E221,E226,E302,E401,E502,E701,F
[pudge]
theme = pythonpaste.org
diff --git a/setup.py b/setup.py
index e7fffb3..bcb4e8f 100755
--- a/setup.py
+++ b/setup.py
@@ -62,27 +62,30 @@ and `GitHub <https://github.com/sqlobject>`_.
:target: https://travis-ci.org/sqlobject/sqlobject
""",
classifiers=[
- "Development Status :: 2 - Pre-Alpha",
- "Intended Audience :: Developers",
- "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
- "Programming Language :: Python",
- "Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.6",
- "Programming Language :: Python :: 2.7",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.4",
- "Topic :: Database",
- "Topic :: Database :: Front-Ends",
- "Topic :: Software Development :: Libraries :: Python Modules",
- ],
+ "Development Status :: 2 - Pre-Alpha",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: "
+ "GNU Library or Lesser General Public License (LGPL)",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.6",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.4",
+ "Topic :: Database",
+ "Topic :: Database :: Front-Ends",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
author="Ian Bicking",
author_email="ia...@co...",
maintainer="Oleg Broytman",
maintainer_email="ph...@ph...",
url="http://sqlobject.org/devel/",
- download_url="https://pypi.python.org/pypi/SQLObject/%sdev-2014" % version,
+ download_url="https://pypi.python.org/pypi/SQLObject/"
+ "%sdev-2014" % version,
license="LGPL",
- packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages],
+ packages=["sqlobject"] + \
+ ['sqlobject.%s' % package for package in subpackages],
scripts=["scripts/sqlobject-admin", "scripts/sqlobject-convertOldURI"],
package_data={"sqlobject": [
"../docs/LICENSE", "../docs/*.txt", "../docs/*.css",
diff --git a/sqlobject/classregistry.py b/sqlobject/classregistry.py
index 374c0b0..7681718 100644
--- a/sqlobject/classregistry.py
+++ b/sqlobject/classregistry.py
@@ -58,7 +58,8 @@ class ClassRegistry(object):
if className in self.classes:
callback(self.classes[className], *args, **kw)
else:
- self.callbacks.setdefault(className, []).append((callback, args, kw))
+ self.callbacks.setdefault(className, []).append(
+ (callback, args, kw))
def addCallback(self, callback, *args, **kw):
"""
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 0232d6b..6b3911f 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -43,7 +43,9 @@ try:
from mx import DateTime
except ImportError:
try:
- import DateTime # old version of mxDateTime, or Zope's Version if we're running with Zope
+ # old version of mxDateTime,
+ # or Zope's Version if we're running with Zope
+ import DateTime
except ImportError:
mxdatetime_available = False
else:
@@ -118,9 +120,13 @@ class SOCol(object):
# @@: I suppose we could actually add backquotes to the
# dbName if we needed to...
if not forceDBName:
- assert sqlbuilder.sqlIdentifier(name), 'Name must be SQL-safe (letters, numbers, underscores): %s (or use forceDBName=True)' \
- % repr(name)
- assert name != 'id', 'The column name "id" is reserved for SQLObject use (and is implicitly created).'
+ assert sqlbuilder.sqlIdentifier(name), (
+ 'Name must be SQL-safe '
+ '(letters, numbers, underscores): %s (or use forceDBName=True)'
+ % repr(name))
+ assert name != 'id', (
+ 'The column name "id" is reserved for SQLObject use '
+ '(and is implicitly created).')
assert name, "You must provide a name for all columns"
self.columnDef = columnDef
@@ -135,7 +141,8 @@ class SOCol(object):
# 'null': a SET NULL trigger is generated
if isinstance(cascade, str):
assert cascade == 'null', (
- "The only string value allowed for cascade is 'null' (you gave: %r)" % cascade)
+ "The only string value allowed for cascade is 'null' "
+ "(you gave: %r)" % cascade)
self.cascade = cascade
if not isinstance(constraints, (list, tuple)):
@@ -145,9 +152,10 @@ class SOCol(object):
self.notNone = False
if notNull is not NoDefault:
self.notNone = notNull
- assert notNone is NoDefault or \
- (not notNone) == (not notNull), \
- "The notNull and notNone arguments are aliases, and must not conflict. You gave notNull=%r, notNone=%r" % (notNull, notNone)
+ assert notNone is NoDefault or (not notNone) == (not notNull), (
+ "The notNull and notNone arguments are aliases, "
+ "and must not conflict. "
+ "You gave notNull=%r, notNone=%r" % (notNull, notNone))
elif notNone is not NoDefault:
self.notNone = notNone
if self.notNone:
@@ -170,7 +178,8 @@ class SOCol(object):
self.foreignName = self.name
self.name = idname
else:
- self.foreignName = soClass.sqlmeta.style.instanceIDAttrToAttr(self.name)
+ self.foreignName = soClass.sqlmeta.style.\
+ instanceIDAttrToAttr(self.name)
else:
self.foreignName = None
@@ -207,7 +216,8 @@ class SOCol(object):
elif _vlen == 1:
self.validator = _validators[0]
elif _vlen > 1:
- self.validator = compound.All.join(_validators[0], *_validators[1:])
+ self.validator = compound.All.join(
+ _validators[0], *_validators[1:])
self.noCache = noCache
self.lazy = lazy
# this is in case of ForeignKey, where we rename the column
@@ -340,9 +350,12 @@ class SOCol(object):
# of the NOT NULL clause in a create statement. So, we handle
# them differently for Enum columns.
if not isinstance(self, SOEnumCol):
- return ' '.join([self.dbName, self._firebirdType()] + self._extraSQL())
+ return ' '.join(
+ [self.dbName, self._firebirdType()] + self._extraSQL())
else:
- return ' '.join([self.dbName] + [self._firebirdType()[0]] + self._extraSQL() + [self._firebirdType()[1]])
+ return ' '.join(
+ [self.dbName] + [self._firebirdType()[0]] +
+ self._extraSQL() + [self._firebirdType()[1]])
def maxdbCreateSQL(self):
return ' '.join([self.dbName, self._maxdbType()] + self._extraSQL())
@@ -474,7 +487,8 @@ class SOStringLikeCol(SOCol):
def _check_case_sensitive(self, db):
if self.char_binary:
- raise ValueError("%s does not support binary character columns" % db)
+ raise ValueError("%s does not support "
+ "binary character columns" % db)
def _mysqlType(self):
type = self._sqlType()
@@ -543,7 +557,8 @@ class StringValidator(SOValidator):
return value.encode(dbEncoding)
if self.dataType and isinstance(value, self.dataType):
return value
- if isinstance(value, (str, buffer, binaryType, sqlbuilder.SQLExpression)):
+ if isinstance(value,
+ (str, buffer, binaryType, sqlbuilder.SQLExpression)):
return value
if hasattr(value, '__unicode__'):
return unicode(value).encode(dbEncoding)
@@ -766,7 +781,8 @@ class FloatValidator(SOValidator):
return None
if isinstance(value, (float, int, long, sqlbuilder.SQLExpression)):
return value
- for converter, attr_name in (float, '__float__'), (int, '__int__'), (long, '__long__'):
+ for converter, attr_name in (
+ (float, '__float__'), (int, '__int__'), (long, '__long__')):
if hasattr(value, attr_name):
try:
return converter(value)
@@ -832,7 +848,8 @@ class SOForeignKey(SOKeyCol):
kw['origName'] = kw['name']
kw['name'] = style.instanceAttrToIDAttr(kw['name'])
else:
- kw['name'] = style.instanceAttrToIDAttr(style.pythonClassToAttr(foreignKey))
+ kw['name'] = style.instanceAttrToIDAttr(
+ style.pythonClassToAttr(foreignKey))
super(SOForeignKey, self).__init__(**kw)
def sqliteCreateSQL(self):
@@ -878,7 +895,8 @@ class SOForeignKey(SOKeyCol):
action = 'ON DELETE RESTRICT'
else:
action = ''
- constraint = ('ALTER TABLE %(sTName)s ADD CONSTRAINT %(colName)s_exists '
+ constraint = ('ALTER TABLE %(sTName)s '
+ 'ADD CONSTRAINT %(colName)s_exists '
'FOREIGN KEY (%(colName)s) '
'REFERENCES %(tName)s (%(idName)s) '
'%(action)s' %
@@ -904,7 +922,8 @@ class SOForeignKey(SOKeyCol):
action = 'ON DELETE RESTRICT'
else:
action = ''
- constraint = ('ALTER TABLE %(sTName)s ADD CONSTRAINT %(sTLocalName)s_%(colName)s_exists '
+ constraint = ('ALTER TABLE %(sTName)s '
+ 'ADD CONSTRAINT %(sTLocalName)s_%(colName)s_exists '
'FOREIGN KEY (%(colName)s) '
'REFERENCES %(tName)s (%(idName)s) '
'%(action)s' %
@@ -952,12 +971,14 @@ class SOForeignKey(SOKeyCol):
def maxdbCreateSQL(self):
other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
fidName = self.dbName
- # I assume that foreign key name is identical to the id of the reference table
+ # I assume that foreign key name is identical
+ # to the id of the reference table
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 = sql + 'FOREIGN KEY (%s) REFERENCES %s(%s)' % (fidName, tName,
+ idName)
return sql
def maxdbCreateReferenceConstraint(self):
@@ -1008,13 +1029,17 @@ class SOEnumCol(SOCol):
# We need to map None in the enum expression to an appropriate
# condition on NULL
if None in self.enumValues:
- return "ENUM(%s)" % ', '.join([sqlbuilder.sqlrepr(v, 'mysql') for v in self.enumValues if v is not None])
+ return "ENUM(%s)" % ', '.join(
+ [sqlbuilder.sqlrepr(v, 'mysql') for v in self.enumValues
+ if v is not None])
else:
- return "ENUM(%s) NOT NULL" % ', '.join([sqlbuilder.sqlrepr(v, 'mysql') for v in self.enumValues])
+ return "ENUM(%s) NOT NULL" % ', '.join(
+ [sqlbuilder.sqlrepr(v, 'mysql') for v in self.enumValues])
def _postgresType(self):
length = max(map(self._getlength, self.enumValues))
- enumValues = ', '.join([sqlbuilder.sqlrepr(v, 'postgres') for v in self.enumValues])
+ enumValues = ', '.join(
+ [sqlbuilder.sqlrepr(v, 'postgres') for v in self.enumValues])
checkConstraint = "CHECK (%s in (%s))" % (self.dbName, enumValues)
return "VARCHAR(%i) %s" % (length, checkConstraint)
@@ -1028,7 +1053,8 @@ class SOEnumCol(SOCol):
def _firebirdType(self):
length = max(map(self._getlength, self.enumValues))
- enumValues = ', '.join([sqlbuilder.sqlrepr(v, 'firebird') for v in self.enumValues])
+ enumValues = ', '.join(
+ [sqlbuilder.sqlrepr(v, 'firebird') for v in self.enumValues])
checkConstraint = "CHECK (%s in (%s))" % (self.dbName, enumValues)
# NB. Return a tuple, not a string here
return "VARCHAR(%i)" % (length), checkConstraint
@@ -1087,7 +1113,8 @@ class SOSetCol(SOCol):
super(SOSetCol, self).createValidators()
def _mysqlType(self):
- return "SET(%s)" % ', '.join([sqlbuilder.sqlrepr(v, 'mysql') for v in self.setValues])
+ return "SET(%s)" % ', '.join(
+ [sqlbuilder.sqlrepr(v, 'mysql') for v in self.setValues])
class SetCol(Col):
baseClass = SOSetCol
@@ -1097,13 +1124,17 @@ class DateTimeValidator(validators.DateValidator):
def to_python(self, value, state):
if value is None:
return None
- if isinstance(value, (datetime.datetime, datetime.date, datetime.time, sqlbuilder.SQLExpression)):
+ if isinstance(value,
+ (datetime.datetime, datetime.date,
+ datetime.time, sqlbuilder.SQLExpression)):
return value
if mxdatetime_available:
if isinstance(value, DateTimeType):
# convert mxDateTime instance to datetime
- if (self.format.find("%H") >= 0) or (self.format.find("%T")) >= 0:
- return datetime.datetime(value.year, value.month, value.day,
+ if (self.format.find("%H") >= 0) or \
+ (self.format.find("%T")) >= 0:
+ return datetime.datetime(value.year, value.month,
+ value.day,
value.hour, value.minute,
int(value.second))
else:
@@ -1113,7 +1144,8 @@ class DateTimeValidator(validators.DateValidator):
if self.format.find("%d") >= 0:
return datetime.timedelta(seconds=value.seconds)
else:
- return datetime.time(value.hour, value.minute, int(value.second))
+ return datetime.time(value.hour, value.minute,
+ int(value.second))
try:
if self.format.find(".%f") >= 0:
if '.' in value:
@@ -1138,12 +1170,15 @@ class DateTimeValidator(validators.DateValidator):
def from_python(self, value, state):
if value is None:
return None
- if isinstance(value, (datetime.datetime, datetime.date, datetime.time, sqlbuilder.SQLExpression)):
+ if isinstance(value,
+ (datetime.datetime, datetime.date,
+ datetime.time, sqlbuilder.SQLExpression)):
return value
if hasattr(value, "strftime"):
return value.strftime(self.format)
raise validators.Invalid(
- "expected a datetime in the DateTimeCol '%s', got %s %r instead" % (
+ "expected a datetime in the DateTimeCol '%s', "
+ "got %s %r instead" % (
self.name, type(value), value), value, state)
if mxdatetime_available:
@@ -1151,11 +1186,13 @@ if mxdatetime_available:
def to_python(self, value, state):
if value is None:
return None
- if isinstance(value, (DateTimeType, TimeType, sqlbuilder.SQLExpression)):
+ if isinstance(value,
+ (DateTimeType, TimeType, sqlbuilder.SQLExpression)):
return value
if isinstance(value, datetime.datetime):
return DateTime.DateTime(value.year, value.month, value.day,
- value.hour, value.minute, value.second)
+ value.hour, value.minute,
+ value.second)
elif isinstance(value, datetime.date):
return DateTime.Date(value.year, value.month, value.day)
elif isinstance(value, datetime.time):
@@ -1176,7 +1213,8 @@ if mxdatetime_available:
value += '.0'
value = datetime.datetime.strptime(value, self.format)
return DateTime.DateTime(value.year, value.month, value.day,
- value.hour, value.minute, value.second)
+ value.hour, value.minute,
+ value.second)
except:
raise validators.Invalid(
"expected a date/time string of the '%s' format "
@@ -1187,7 +1225,8 @@ if mxdatetime_available:
def from_python(self, value, state):
if value is None:
return None
- if isinstance(value, (DateTimeType, TimeType, sqlbuilder.SQLExpression)):
+ if isinstance(value,
+ (DateTimeType, TimeType, sqlbuilder.SQLExpression)):
return value
if hasattr(value, "strftime"):
return value.strftime(self.format)
@@ -1212,7 +1251,8 @@ class SODateTimeCol(SOCol):
elif default_datetime_implementation == MXDATETIME_IMPLEMENTATION:
validatorClass = MXDateTimeValidator
if default_datetime_implementation:
- _validators.insert(0, validatorClass(name=self.name, format=self.datetimeFormat))
+ _validators.insert(0, validatorClass(name=self.name,
+ format=self.datetimeFormat))
return _validators
def _mysqlType(self):
@@ -1276,14 +1316,19 @@ class SODateCol(SOCol):
super(SODateCol, self).__init__(**kw)
def createValidators(self):
- """Create a validator for the column. Can be overriden in descendants."""
+ """Create a validator for the column.
+
+ Can be overriden in descendants.
+
+ """
_validators = super(SODateCol, self).createValidators()
if default_datetime_implementation == DATETIME_IMPLEMENTATION:
validatorClass = DateValidator
elif default_datetime_implementation == MXDATETIME_IMPLEMENTATION:
validatorClass = MXDateTimeValidator
if default_datetime_implementation:
- _validators.insert(0, validatorClass(name=self.name, format=self.dateFormat))
+ _validators.insert(0, validatorClass(name=self.name,
+ format=self.dateFormat))
return _validators
def _mysqlType(self):
@@ -1321,8 +1366,8 @@ class TimeValidator(DateTimeValidator):
if isinstance(value, datetime.timedelta):
if value.days:
raise validators.Invalid(
- "the value for the TimeCol '%s' must has days=0, it has days=%d" %
- (self.name, value.days), value, state)
+ "the value for the TimeCol '%s' must has days=0, "
+ "it has days=%d" % (self.name, value.days), value, state)
return datetime.time(*time.gmtime(value.seconds)[3:6])
value = super(TimeValidator, self).to_python(value, state)
if isinstance(value, datetime.datetime):
@@ -1347,7 +1392,8 @@ class SOTimeCol(SOCol):
elif default_datetime_implementation == MXDATETIME_IMPLEMENTATION:
validatorClass = MXDateTimeValidator
if default_datetime_implementation:
- _validators.insert(0, validatorClass(name=self.name, format=self.timeFormat))
+ _validators.insert(0, validatorClass(name=self.name,
+ format=self.timeFormat))
return _validators
def _mysqlType(self):
@@ -1593,7 +1639,8 @@ class BinaryValidator(SOValidator):
class SOBLOBCol(SOStringCol):
def __init__(self, **kw):
- # Change the default from 'auto' to False - this is a (mostly) binary column
+ # Change the default from 'auto' to False -
+ # this is a (mostly) binary column
if 'varchar' not in kw: kw['varchar'] = False
super(SOBLOBCol, self).__init__(**kw)
diff --git a/sqlobject/conftest.py b/sqlobject/conftest.py
index 05203e3..fd458f2 100644
--- a/sqlobject/conftest.py
+++ b/sqlobject/conftest.py
@@ -26,7 +26,8 @@ connectionShortcuts = {
'pygresql': 'pygresql://localhost/test',
'sqlite': 'sqlite:/:memory:',
'sybase': 'sybase://test:test123@sybase/test?autoCommit=0',
- 'firebird': 'firebird://sysdba:masterkey@localhost/var/lib/firebird/data/test.gdb',
+ 'firebird':
... 11244 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-20 03:29:58
|
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 30d92f73c22087bd69e58b44153912dea1eadd25 (commit)
via d25d27fb9fa8a39a5ef11b7d7689ab14b90f0007 (commit)
via 79e14c896f8c9792e70704429a68d69e216813a6 (commit)
via 96a6e8838978f2d39efa6913676298f044729eab (commit)
from b959a26ae4ab8be1f73a43b07ff9a5ffe868d067 (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/30d92f73c22087bd69e58b44153912dea1eadd25
commit 30d92f73c22087bd69e58b44153912dea1eadd25
Merge: b959a26 d25d27f
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 20 06:28:05 2015 +0300
Merge branch '2.1'
-----------------------------------------------------------------------
Summary of changes:
docs/News1.txt | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-20 03:29:49
|
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, 2.1 has been updated
via d25d27fb9fa8a39a5ef11b7d7689ab14b90f0007 (commit)
from 79e14c896f8c9792e70704429a68d69e216813a6 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
docs/News1.txt | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-07 00:49:52
|
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 b959a26ae4ab8be1f73a43b07ff9a5ffe868d067 (commit)
via bc33d8f2cb09f3d143e39856c4749874f4cc20c1 (commit)
from f47600ce8b3fcc60dc45adf89e498e51da11eac3 (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/b959a26ae4ab8be1f73a43b07ff9a5ffe868d067
commit b959a26ae4ab8be1f73a43b07ff9a5ffe868d067
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 7 03:46:13 2015 +0300
Fix #54: convert `assert False` to `py.test.raises`
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index bab70f7..cb50baa 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -107,11 +107,7 @@ def test_selectBy():
def test_selectBy_kwargs():
setupClass(IterTest)
- try:
- b = IterTest(nonexistant='b')
- except TypeError:
- return
- assert False, "IterTest(nonexistant='b') should raise TypeError"
+ raises(TypeError, IterTest, nonexistant='b')
class UniqTest(SQLObject):
name = StringCol(dbName='name_col', unique=True, length=100)
http://sourceforge.net/p/sqlobject/sqlobject/ci/bc33d8f2cb09f3d143e39856c4749874f4cc20c1
commit bc33d8f2cb09f3d143e39856c4749874f4cc20c1
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 7 03:40:19 2015 +0300
Fix #53: report skipped tests
Also merge test_psycopg_sslmode.py into test_postgres.py.
diff --git a/sqlobject/inheritance/tests/test_deep_inheritance.py b/sqlobject/inheritance/tests/test_deep_inheritance.py
index 6e04e75..ec31be6 100644
--- a/sqlobject/inheritance/tests/test_deep_inheritance.py
+++ b/sqlobject/inheritance/tests/test_deep_inheritance.py
@@ -1,4 +1,4 @@
-from py.test import raises
+from py.test import raises, skip
from sqlobject import *
from sqlobject.tests.dbtest import *
from sqlobject.inheritance import InheritableSQLObject
@@ -52,7 +52,7 @@ def test_creation_fail2():
assert persons.count() == 1
if not supports('transactions'):
- return
+ skip("Transactions aren't supported")
transaction = DIPerson._connection.transaction()
kwargs ={'firstName': 'John', 'lastName': 'Doe III', 'position': 'Project Manager'}
raises(Exception, DIManager, connection=transaction, **kwargs)
diff --git a/sqlobject/tests/dbtest.py b/sqlobject/tests/dbtest.py
index 753f950..e99aed8 100644
--- a/sqlobject/tests/dbtest.py
+++ b/sqlobject/tests/dbtest.py
@@ -30,7 +30,7 @@ and you can use it like::
def test_featureX():
if not supports('featureX'):
- return
+ py.test.skip("Doesn't support featureX")
"""
supportsMatrix = {
'+exceptions': 'mysql postgres sqlite',
diff --git a/sqlobject/tests/test_SQLMultipleJoin.py b/sqlobject/tests/test_SQLMultipleJoin.py
index fbf8f6b..db7ce67 100644
--- a/sqlobject/tests/test_SQLMultipleJoin.py
+++ b/sqlobject/tests/test_SQLMultipleJoin.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -44,7 +45,7 @@ def test_1():
def test_multiple_join_transaction():
if not supports('transactions'):
- return
+ py.test.skip("Transactions aren't supported")
createAllTables()
trans = Race._connection.transaction()
try:
diff --git a/sqlobject/tests/test_SQLRelatedJoin.py b/sqlobject/tests/test_SQLRelatedJoin.py
index 96320f2..1a16ae6 100644
--- a/sqlobject/tests/test_SQLRelatedJoin.py
+++ b/sqlobject/tests/test_SQLRelatedJoin.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -45,7 +46,7 @@ def test_1():
def test_related_join_transaction():
if not supports('transactions'):
- return
+ py.test.skip("Transactions aren't supported")
createAllTables()
trans = Tourtment._connection.transaction()
try:
diff --git a/sqlobject/tests/test_basic.py b/sqlobject/tests/test_basic.py
index 869567b..6ddf03e 100644
--- a/sqlobject/tests/test_basic.py
+++ b/sqlobject/tests/test_basic.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -188,7 +189,7 @@ def test_foreignKeyDestroySelfCascade():
def testForeignKeyDropTableCascade():
if not supports('dropTableCascade'):
- return
+ py.test.skip("dropTableCascade isn't supported")
setupClass(TestSO7)
setupClass(TestSO6)
setupClass(TestSO5)
diff --git a/sqlobject/tests/test_blob.py b/sqlobject/tests/test_blob.py
index f158bd5..219ff10 100644
--- a/sqlobject/tests/test_blob.py
+++ b/sqlobject/tests/test_blob.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -10,7 +11,7 @@ class ImageData(SQLObject):
def test_BLOBCol():
if not supports('blobData'):
- return
+ py.test.skip("blobData isn't supported")
setupClass(ImageData)
data = ''.join([chr(x) for x in range(256)])
diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py
index 1fbe9b2..02e3bff 100644
--- a/sqlobject/tests/test_cyclic_reference.py
+++ b/sqlobject/tests/test_cyclic_reference.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -25,7 +26,7 @@ class TestCyclicReferenceB(SQLObject):
def test_cyclic_reference():
if not supports('dropTableCascade'):
- return
+ py.test.skip("dropTableCascade isn't supported")
conn = getConnection()
TestCyclicReferenceA.setConnection(conn)
TestCyclicReferenceB.setConnection(conn)
diff --git a/sqlobject/tests/test_decimal.py b/sqlobject/tests/test_decimal.py
index 9e61a67..9b76cc5 100644
--- a/sqlobject/tests/test_decimal.py
+++ b/sqlobject/tests/test_decimal.py
@@ -1,5 +1,3 @@
-# -*- coding: koi8-r -*-
-
from decimal import Decimal
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -8,44 +6,47 @@ from sqlobject.tests.dbtest import *
## Decimal columns
########################################
+if not supports('decimalColumn'):
+ import py.test
+ pytestmark = py.test.mark.skipif('True')
+
class DecimalTable(SQLObject):
name = UnicodeCol(length=255)
col1 = DecimalCol(size=6, precision=4)
col2 = DecimalStringCol(size=6, precision=4)
col3 = DecimalStringCol(size=6, precision=4, quantize=True)
-if supports('decimalColumn'):
- def test_1_decimal():
- setupClass(DecimalTable)
- d = DecimalTable(name='test', col1=21.12, col2='10.01', col3='10.01')
- # psycopg2 returns float as Decimal
- if isinstance(d.col1, Decimal):
- assert d.col1 == Decimal("21.12")
- else:
- assert d.col1 == 21.12
- assert d.col2 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].to_python('10.01',
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].from_python('10.01',
- d._SO_validatorState) == "10.01"
- assert d.col3 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].to_python('10.01',
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].from_python('10.01',
- d._SO_validatorState) == "10.0100"
-
- def test_2_decimal():
- setupClass(DecimalTable)
- d = DecimalTable(name='test', col1=Decimal("21.12"),
- col2=Decimal('10.01'), col3=Decimal('10.01'))
+def test_1_decimal():
+ setupClass(DecimalTable)
+ d = DecimalTable(name='test', col1=21.12, col2='10.01', col3='10.01')
+ # psycopg2 returns float as Decimal
+ if isinstance(d.col1, Decimal):
assert d.col1 == Decimal("21.12")
- assert d.col2 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].to_python(Decimal('10.01'),
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].from_python(Decimal('10.01'),
- d._SO_validatorState) == "10.01"
- assert d.col3 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].to_python(Decimal('10.01'),
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].from_python(Decimal('10.01'),
- d._SO_validatorState) == "10.0100"
+ else:
+ assert d.col1 == 21.12
+ assert d.col2 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].to_python('10.01',
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].from_python('10.01',
+ d._SO_validatorState) == "10.01"
+ assert d.col3 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].to_python('10.01',
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].from_python('10.01',
+ d._SO_validatorState) == "10.0100"
+
+def test_2_decimal():
+ setupClass(DecimalTable)
+ d = DecimalTable(name='test', col1=Decimal("21.12"),
+ col2=Decimal('10.01'), col3=Decimal('10.01'))
+ assert d.col1 == Decimal("21.12")
+ assert d.col2 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].to_python(Decimal('10.01'),
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].from_python(Decimal('10.01'),
+ d._SO_validatorState) == "10.01"
+ assert d.col3 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].to_python(Decimal('10.01'),
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].from_python(Decimal('10.01'),
+ d._SO_validatorState) == "10.0100"
diff --git a/sqlobject/tests/test_empty.py b/sqlobject/tests/test_empty.py
index f7d9466..1523ea9 100644
--- a/sqlobject/tests/test_empty.py
+++ b/sqlobject/tests/test_empty.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -7,7 +8,7 @@ class EmptyClass(SQLObject):
def test_empty():
if not supports('emptyTable'):
- return
+ py.test.skip("emptyTable isn't supported")
setupClass(EmptyClass)
e1 = EmptyClass()
e2 = EmptyClass()
diff --git a/sqlobject/tests/test_exceptions.py b/sqlobject/tests/test_exceptions.py
index 0588bbc..fbc0d8a 100644
--- a/sqlobject/tests/test_exceptions.py
+++ b/sqlobject/tests/test_exceptions.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.dberrors import *
from sqlobject.tests.dbtest import *
@@ -14,7 +15,7 @@ class TestExceptionWithNonexistingTable(SQLObject):
def test_exceptions():
if not supports("exceptions"):
- return
+ py.test.skip("exceptions aren't supported")
setupClass(TestException)
TestException(name="test")
raises(DuplicateEntryError, TestException, name="test")
diff --git a/sqlobject/tests/test_indexes.py b/sqlobject/tests/test_indexes.py
index 56e0f31..ea3a7b1 100644
--- a/sqlobject/tests/test_indexes.py
+++ b/sqlobject/tests/test_indexes.py
@@ -1,5 +1,6 @@
from __future__ import print_function
+import py.test
from sqlobject import *
from sqlobject.dberrors import *
from sqlobject.tests.dbtest import *
@@ -40,7 +41,7 @@ def test_indexes_1():
def test_indexes_2():
if not supports('expressionIndex'):
- return
+ py.test.skip("expressionIndex isn't supported")
setupClass(SOIndex2)
SOIndex2(name='')
diff --git a/sqlobject/tests/test_mysql.py b/sqlobject/tests/test_mysql.py
index 394124e..f568b2b 100644
--- a/sqlobject/tests/test_mysql.py
+++ b/sqlobject/tests/test_mysql.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -7,12 +8,12 @@ class TestSOListMySQL(SQLObject):
def test_list_databases():
connection = getConnection()
if connection.dbName != "mysql":
- return
+ py.test.skip("These tests require MySQL")
assert connection.db in connection.listDatabases()
def test_list_tables():
connection = getConnection()
if connection.dbName != "mysql":
- return
+ py.test.skip("These tests require MySQL")
setupClass(TestSOListMySQL)
assert TestSOListMySQL.sqlmeta.table in connection.listTables()
diff --git a/sqlobject/tests/test_paste.py b/sqlobject/tests/test_paste.py
index 1aecda0..658c3f2 100644
--- a/sqlobject/tests/test_paste.py
+++ b/sqlobject/tests/test_paste.py
@@ -74,7 +74,7 @@ def test_other():
# @@: Dammit, I can't get these to pass because I can't get the
# stupid table to clear itself. setupClass() sucks. When I
# fix it I'll take this disabling out:
- return
+ py.test.skip("Oops...")
assert names() == []
assert runapp(fail=False, begin=True, abort=True, use_transaction=True)
assert names() == ['app1']
diff --git a/sqlobject/tests/test_pickle.py b/sqlobject/tests/test_pickle.py
index e782f93..1869598 100644
--- a/sqlobject/tests/test_pickle.py
+++ b/sqlobject/tests/test_pickle.py
@@ -1,4 +1,5 @@
import pickle
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -28,7 +29,7 @@ def test_pickleCol():
assert test.answer == test_answer
if (connection.dbName == 'sqlite') and connection._memory:
- return # The following test requires a different connection
+ py.test.skip("The following test requires a different connection")
test = TestPickle.get(test.id,
connection=getConnection(registry='')) # to make a different DB URI
diff --git a/sqlobject/tests/test_picklecol.py b/sqlobject/tests/test_picklecol.py
index a74914d..bcddc4f 100644
--- a/sqlobject/tests/test_picklecol.py
+++ b/sqlobject/tests/test_picklecol.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -16,7 +17,7 @@ class PickleContainer(SQLObject):
def test_pickleCol():
if not supports('blobData'):
- return
+ py.test.skip("blobData isn't supported")
setupClass([PickleContainer], force=True)
mypickledata = PickleData()
diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py
index 97ac280..3511348 100644
--- a/sqlobject/tests/test_postgres.py
+++ b/sqlobject/tests/test_postgres.py
@@ -1,18 +1,45 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
+########################################
+## Test PosgreSQL sslmode
+########################################
+
+class TestSSLMode(SQLObject):
+ test = StringCol()
+
+def test_sslmode():
+ setupClass(TestSSLMode)
+ connection = TestSSLMode._connection
+ if (connection.dbName != 'postgres') or \
+ (not connection.module.__name__.startswith('psycopg')):
+ py.test.skip("The test requires PostgreSQL, psycopg and ssl mode")
+
+ connection = getConnection(sslmode='require')
+ TestSSLMode._connection = connection
+ test = TestSSLMode(test='test') # Connect to the DB to test sslmode
+
+ connection.cache.clear()
+ test = TestSSLMode.select()[0]
+ assert test.test == 'test'
+
+########################################
+## Test PosgreSQL list{Database,Tables}
+########################################
+
class TestSOList(SQLObject):
pass
def test_list_databases():
connection = getConnection()
if connection.dbName != "postgres":
- return
+ py.test.skip("These tests require PostgreSQL")
assert connection.db in connection.listDatabases()
def test_list_tables():
connection = getConnection()
if connection.dbName != "postgres":
- return
+ py.test.skip("These tests require PostgreSQL")
setupClass(TestSOList)
assert TestSOList.sqlmeta.table in connection.listTables()
diff --git a/sqlobject/tests/test_psycopg_sslmode.py b/sqlobject/tests/test_psycopg_sslmode.py
deleted file mode 100644
index a899db9..0000000
--- a/sqlobject/tests/test_psycopg_sslmode.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from sqlobject import *
-from sqlobject.tests.dbtest import *
-
-########################################
-## Test PosgreSQL sslmode
-########################################
-
-class TestSSLMode(SQLObject):
- test = StringCol()
-
-def test_sslmode():
- setupClass(TestSSLMode)
- connection = TestSSLMode._connection
- if (connection.dbName != 'postgres') or \
- (not connection.module.__name__.startswith('psycopg')):
- # sslmode is only implemented by psycopg[12] PostgreSQL driver
- return
-
- connection = getConnection(sslmode='require')
- TestSSLMode._connection = connection
- test = TestSSLMode(test='test') # Connect to the DB to test sslmode
-
- connection.cache.clear()
- test = TestSSLMode.select()[0]
- assert test.test == 'test'
diff --git a/sqlobject/tests/test_schema.py b/sqlobject/tests/test_schema.py
index 66db804..820d6cf 100644
--- a/sqlobject/tests/test_schema.py
+++ b/sqlobject/tests/test_schema.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -10,7 +11,7 @@ class TestSchema(SQLObject):
def test_connection_schema():
if not supports('schema'):
- return
+ py.test.skip("schemas aren't supported")
conn = getConnection()
conn.schema = None
conn.query('CREATE SCHEMA test')
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index 77b7f13..bab70f7 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.sqlbuilder import func
from sqlobject.main import SQLObjectIntegrityError
@@ -50,7 +51,7 @@ def test_03_ranged_indexed():
... 282 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 23:29:18
|
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, 2.0 has been deleted
was 96a6e8838978f2d39efa6913676298f044729eab
- Log -----------------------------------------------------------------
96a6e8838978f2d39efa6913676298f044729eab Branch 2.0 is no longer maintained
-----------------------------------------------------------------------
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 23:29:11
|
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, 1.5 has been deleted
was 0d4029bf78984e43e7269a760fc214495c0766fd
- Log -----------------------------------------------------------------
0d4029bf78984e43e7269a760fc214495c0766fd Branch 1.5 reached EOL
-----------------------------------------------------------------------
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 23:28:27
|
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, 2.1 has been updated
via 79e14c896f8c9792e70704429a68d69e216813a6 (commit)
via 96a6e8838978f2d39efa6913676298f044729eab (commit)
from aa209bdfc8d30ed39e04b5d65242b22dcb465970 (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/79e14c896f8c9792e70704429a68d69e216813a6
commit 79e14c896f8c9792e70704429a68d69e216813a6
Merge: aa209bd 96a6e88
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 7 02:25:46 2015 +0300
Merge branch '2.0' into 2.1 before removing it
[skip ci]
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 15:45:03
|
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 annotated tag, 2.1.0 has been created
at e8537ad5119123c88d21231bb6bbb5853c34588a (tag)
tagging aa209bdfc8d30ed39e04b5d65242b22dcb465970 (commit)
replaces 2.0.0
tagged by Oleg Broytman
on Tue Jan 6 18:23:45 2015 +0300
- Log -----------------------------------------------------------------
Release 2.1.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABCgAGBQJUq/4BAAoJEG4IC3C2KHsD2hAQAJkdvLsbvYhXA1juC7UZ73ER
GNFE7dy8jIV41P0IHFM7fuHyT9yZAEOpLoDUhbLaIkXL3Tt/8WEoSe+0YsenEvsa
eP1EI4pZhvrRuGen5O3+5ojRbyrlS5504Xr4JnEAi1x+G2lM5AiKCFK2LGB+IF6K
+UBWQtK29FU/xVEqIBfWNNLx4zdB/0hcSpZ9oRI80qeihbveY808hoTrqYPbI+TL
+muuopFAz5TPf6WodY/2WcSwj9EgWNl9RAj/GiTGfYWeYIoSEH1q0WSbbhZSqoGn
DEkb/2RjjQ4jUObaCouYGM64GyOs9j6Mvw9sVPSGGIL+8kEtEmQG/ckbIXPgIEBT
jvecEID6uC/l9Crm/wLSbydhU24VL566MUQILYppSIt8/nqHIrmu+3yY1mnTqyLw
SHUw42GpGExTDm+E8az5oI1xihv2yo2LUUfeMmya7HlhctG8hxcwhNgTQNb7XDwB
a0fNId+Vwqn27tABkwA18pmeTZcpzoIyzbdofJuJRgS/U+eOmmv93W+lJki+uMWP
6NYnh+ZUrJzXMq0uyIw7lSbAkQquTKtIFgEzLimyzFeCqgoamEUvlydOzQgPApyZ
qyocIx1B8EkAFaAa4nbAXMnY9lFIaw30irTqPQ70Jm+1iWgW4vVTGakSnnH+d/Jt
OgTBJTSY/2wLMvrXTxrl
=cMh2
-----END PGP SIGNATURE-----
Ian Cordasco (4):
Sort the column items in DBAPI
Use columnList instead of sorting alphabetically
Further simplify how we construct our data in DBAPI
Merge pull request #2 from sqlobject/feature/use-sorted-list
Oleg Broytman (34):
Next branch will be 3.0
Merge branch '2.0'
Merge branch '2.0'
Merge branch '2.0'
Merge branch '2.0'
Merge branch '2.0'
Merge branch '2.0'
Add Ian Cordasco
Branch 1.5 reached EOL
Merge branch '1.5' into 1.6
Branch 1.6 is in maintenance mode
Merge branch '1.6' into 1.7
Branch 2.1
Merge branch 'master' into 2.1
Sort columns by creation order or alphabetically
Tables in SELECT...FROM clause are sorted alphabetically
Remove outdated TODO item
Merge branch '1.6' into 1.7
Merge branch '1.7' into 2.0
Merge branch '2.0' into 2.1
Minor refactoring
Merge branch '1.6' into 1.7
Merge branch '1.7' into 2.0
Merge branch '2.0' into 2.1
SQLiteConnection has got a new method listDatabases
PostgresConnection has got a new method listDatabases
MySQLConnection has got a new method listDatabases
Minor refactoring
SQLiteConnection has got a new method listTables
PostgresConnection has got a new method listTables
MySQLConnection has got a new method listTables
List tables methods were implemented
SQLObject 2.1.0 was released 6 Jan 2015
Release 2.1.0
-----------------------------------------------------------------------
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 15:44:33
|
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 f47600ce8b3fcc60dc45adf89e498e51da11eac3 (commit)
via aa209bdfc8d30ed39e04b5d65242b22dcb465970 (commit)
via 7ea628a77a9448600b4b69ad07c87785cf28f66f (commit)
via d0d760a2b14e6727db35ace706e7b9c687f39230 (commit)
via df0823bae3d797082bbdd5a134fe9ea055d803bc (commit)
from e5862d48231274ede862cf06559d2eb9d3d9acf3 (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/f47600ce8b3fcc60dc45adf89e498e51da11eac3
commit f47600ce8b3fcc60dc45adf89e498e51da11eac3
Merge: 7ea628a aa209bd
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 18:24:27 2015 +0300
Merge branch '2.1'
[skip ci]
http://sourceforge.net/p/sqlobject/sqlobject/ci/7ea628a77a9448600b4b69ad07c87785cf28f66f
commit 7ea628a77a9448600b4b69ad07c87785cf28f66f
Merge: e5862d4 d0d760a
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 18:17:31 2015 +0300
Merge branch '2.1'
-----------------------------------------------------------------------
Summary of changes:
docs/News.txt | 2 ++
docs/TODO.txt | 10 ----------
2 files changed, 2 insertions(+), 10 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 15:44:26
|
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, 2.1 has been updated
via aa209bdfc8d30ed39e04b5d65242b22dcb465970 (commit)
via d0d760a2b14e6727db35ace706e7b9c687f39230 (commit)
via df0823bae3d797082bbdd5a134fe9ea055d803bc (commit)
from 8d8b4ec526b7f74b577c7d69fa6957b8073cb09a (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 -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
docs/News.txt | 2 ++
docs/TODO.txt | 10 ----------
setup.cfg | 4 ++--
setup.py | 4 ++--
sqlobject/__version__.py | 4 ++--
5 files changed, 8 insertions(+), 16 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 15:44:20
|
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, 2.0 has been updated
via 96a6e8838978f2d39efa6913676298f044729eab (commit)
from 1fd5a272b6316f31e3e41898d4614d9710ffe5ca (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/96a6e8838978f2d39efa6913676298f044729eab
commit 96a6e8838978f2d39efa6913676298f044729eab
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 18:42:49 2015 +0300
Branch 2.0 is no longer maintained
diff --git a/setup.py b/setup.py
index 4adfebe..05109ad 100755
--- a/setup.py
+++ b/setup.py
@@ -62,7 +62,7 @@ and `GitHub <https://github.com/sqlobject>`_.
:target: https://travis-ci.org/sqlobject/sqlobject
""",
classifiers=[
- "Development Status :: 5 - Production/Stable",
+ "Development Status :: 7 - Inactive",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python",
-----------------------------------------------------------------------
Summary of changes:
setup.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-06 01:33:37
|
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 e5862d48231274ede862cf06559d2eb9d3d9acf3 (commit)
via 8d8b4ec526b7f74b577c7d69fa6957b8073cb09a (commit)
via 361484195ec9bbe19cdbef400f856554664f6b3b (commit)
via 23b6f30adc2e3e2459271ca32dc2ab265c0b31cd (commit)
via 8679b81f77d1ad5e69add8cd8787d0d3ae87f806 (commit)
from e1b5f794f78ad91dcbe01589994cdb76d5507997 (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/e5862d48231274ede862cf06559d2eb9d3d9acf3
commit e5862d48231274ede862cf06559d2eb9d3d9acf3
Merge: e1b5f79 8d8b4ec
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 04:30:04 2015 +0300
Merge branch '2.1'
http://sourceforge.net/p/sqlobject/sqlobject/ci/8d8b4ec526b7f74b577c7d69fa6957b8073cb09a
commit 8d8b4ec526b7f74b577c7d69fa6957b8073cb09a
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 04:27:08 2015 +0300
MySQLConnection has got a new method listTables
diff --git a/docs/News.txt b/docs/News.txt
index 48d1163..b51fb96 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -25,7 +25,7 @@ Minor features
a new method listDatabases() that lists databases in the connection
and returns a list of names.
-* PostgresConnection and SQLiteConnection have got
+* MySQLConnection, PostgresConnection and SQLiteConnection have got
a new method listTables() that returns a list of table names in the database.
SQLObject 2.0.0
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index f51eed6..f8e9226 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -297,6 +297,9 @@ class MySQLConnection(DBAPI):
else:
return col.Col, {}
+ def listTables(self):
+ return [v[0] for v in self.queryAll("SHOW TABLES")]
+
def listDatabases(self):
return [v[0] for v in self.queryAll("SHOW DATABASES")]
diff --git a/sqlobject/tests/test_mysql.py b/sqlobject/tests/test_mysql.py
index c22a0ed..394124e 100644
--- a/sqlobject/tests/test_mysql.py
+++ b/sqlobject/tests/test_mysql.py
@@ -1,8 +1,18 @@
from sqlobject import *
from sqlobject.tests.dbtest import *
+class TestSOListMySQL(SQLObject):
+ pass
+
def test_list_databases():
connection = getConnection()
if connection.dbName != "mysql":
return
assert connection.db in connection.listDatabases()
+
+def test_list_tables():
+ connection = getConnection()
+ if connection.dbName != "mysql":
+ return
+ setupClass(TestSOListMySQL)
+ assert TestSOListMySQL.sqlmeta.table in connection.listTables()
http://sourceforge.net/p/sqlobject/sqlobject/ci/361484195ec9bbe19cdbef400f856554664f6b3b
commit 361484195ec9bbe19cdbef400f856554664f6b3b
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 04:21:30 2015 +0300
PostgresConnection has got a new method listTables
diff --git a/docs/News.txt b/docs/News.txt
index a1ad154..48d1163 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -25,8 +25,8 @@ Minor features
a new method listDatabases() that lists databases in the connection
and returns a list of names.
-* SQLiteConnection has got a new method listTables() that returns a list
- of table names in the database.
+* PostgresConnection and SQLiteConnection have got
+ a new method listTables() that returns a list of table names in the database.
SQLObject 2.0.0
===============
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 6809ab6..3b91e67 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -426,6 +426,14 @@ class PostgresConnection(DBAPI):
cur.close()
conn.close()
+ def listTables(self):
+ return [v[0] for v in self.queryAll(
+ """SELECT c.relname FROM pg_catalog.pg_class c
+ LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
+ WHERE c.relkind IN ('r','') AND
+ n.nspname NOT IN ('pg_catalog', 'pg_toast') AND
+ pg_catalog.pg_table_is_visible(c.oid)""")]
+
def listDatabases(self):
return [v[0] for v in self.queryAll("SELECT datname FROM pg_database")]
diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py
index abf6674..97ac280 100644
--- a/sqlobject/tests/test_postgres.py
+++ b/sqlobject/tests/test_postgres.py
@@ -1,8 +1,18 @@
from sqlobject import *
from sqlobject.tests.dbtest import *
+class TestSOList(SQLObject):
+ pass
+
def test_list_databases():
connection = getConnection()
if connection.dbName != "postgres":
return
assert connection.db in connection.listDatabases()
+
+def test_list_tables():
+ connection = getConnection()
+ if connection.dbName != "postgres":
+ return
+ setupClass(TestSOList)
+ assert TestSOList.sqlmeta.table in connection.listTables()
http://sourceforge.net/p/sqlobject/sqlobject/ci/23b6f30adc2e3e2459271ca32dc2ab265c0b31cd
commit 23b6f30adc2e3e2459271ca32dc2ab265c0b31cd
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 04:00:18 2015 +0300
SQLiteConnection has got a new method listTables
diff --git a/docs/News.txt b/docs/News.txt
index 1b15502..a1ad154 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -25,6 +25,9 @@ Minor features
a new method listDatabases() that lists databases in the connection
and returns a list of names.
+* SQLiteConnection has got a new method listTables() that returns a list
+ of table names in the database.
+
SQLObject 2.0.0
===============
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 90d3f8e..0c28a34 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -397,6 +397,10 @@ class SQLiteConnection(DBAPI):
else:
return col.Col, {}
+ def listTables(self):
+ return [v[0] for v in self.queryAll(
+ "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name")]
+
def listDatabases(self):
# The pragma returns a list of (index, name, filename)
return [v[1] for v in self.queryAll("PRAGMA database_list")]
diff --git a/sqlobject/tests/test_sqlite.py b/sqlobject/tests/test_sqlite.py
index 3d5d4a4..9ccdcf4 100644
--- a/sqlobject/tests/test_sqlite.py
+++ b/sqlobject/tests/test_sqlite.py
@@ -123,3 +123,10 @@ def test_list_databases():
if connection.dbName != "sqlite":
return
assert connection.listDatabases() == ['main']
+
+def test_list_tables():
+ connection = getConnection()
+ if connection.dbName != "sqlite":
+ return
+ setupClass(TestSO1)
+ assert TestSO1.sqlmeta.table in connection.listTables()
http://sourceforge.net/p/sqlobject/sqlobject/ci/8679b81f77d1ad5e69add8cd8787d0d3ae87f806
commit 8679b81f77d1ad5e69add8cd8787d0d3ae87f806
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 03:28:42 2015 +0300
Minor refactoring
Make SQLiteConnection.listDatabases() like other listDatabases'.
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 452fd1c..90d3f8e 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -398,10 +398,8 @@ class SQLiteConnection(DBAPI):
return col.Col, {}
def listDatabases(self):
- results = []
- for index, name, filename in self.queryAll("PRAGMA database_list"):
- results.append(name)
- return results
+ # The pragma returns a list of (index, name, filename)
+ return [v[1] for v in self.queryAll("PRAGMA database_list")]
def createEmptyDatabase(self):
if self._memory:
-----------------------------------------------------------------------
Summary of changes:
docs/News.txt | 3 +++
sqlobject/mysql/mysqlconnection.py | 3 +++
sqlobject/postgres/pgconnection.py | 8 ++++++++
sqlobject/sqlite/sqliteconnection.py | 10 ++++++----
sqlobject/tests/test_mysql.py | 10 ++++++++++
sqlobject/tests/test_postgres.py | 10 ++++++++++
sqlobject/tests/test_sqlite.py | 7 +++++++
7 files changed, 47 insertions(+), 4 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-05 21:58:13
|
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 e1b5f794f78ad91dcbe01589994cdb76d5507997 (commit)
via 46c7a9ec9748261ffc8a41112c2220ff48cc19a2 (commit)
via f38227c73347b11c0bc8be066a84be4e4509d7c2 (commit)
via e0dcd43d4bae2e2262668b982fbf1b9206cc4024 (commit)
via 066f269b2de98a9336e37b6208c55e78e6c18558 (commit)
via 2795fdc1dc4a20a054552802605d2d0edd66c2e1 (commit)
via 537e1abf0afe981e6a4e2cf1447e967053c23072 (commit)
via 4347f3887fac8b13e2c358613922b58f7e7fdbad (commit)
via f2e80477601641c8c313dd204abeda41fed787e7 (commit)
from b1a11f087f1528dffaa89101ba350442fd355c39 (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/e1b5f794f78ad91dcbe01589994cdb76d5507997
commit e1b5f794f78ad91dcbe01589994cdb76d5507997
Merge: 066f269 46c7a9e
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:55:29 2015 +0300
Merge branch '2.1'
http://sourceforge.net/p/sqlobject/sqlobject/ci/46c7a9ec9748261ffc8a41112c2220ff48cc19a2
commit 46c7a9ec9748261ffc8a41112c2220ff48cc19a2
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:49:13 2015 +0300
MySQLConnection has got a new method listDatabases
diff --git a/docs/News.txt b/docs/News.txt
index 6ace404..1b15502 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -21,9 +21,9 @@ Minor features
* Tables in SELECT...FROM clause are sorted alphabetically.
-* PostgresConnection and SQLiteConnection have got a new method
- listDatabases() that lists databases in the connection and returns a
- list of names.
+* MySQLConnection, PostgresConnection and SQLiteConnection have got
+ a new method listDatabases() that lists databases in the connection
+ and returns a list of names.
SQLObject 2.0.0
===============
diff --git a/docs/TODO.txt b/docs/TODO.txt
index 9334565..43ef935 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -16,8 +16,6 @@ TODO
* SQLObject.fastInsert().
-* List databases in the connection.
-
* List tables/indices in the DB. The query in MySQL is ``SHOW TABLES``;
in SQLite it is
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index df02b9b..f51eed6 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -297,6 +297,9 @@ class MySQLConnection(DBAPI):
else:
return col.Col, {}
+ def listDatabases(self):
+ return [v[0] for v in self.queryAll("SHOW DATABASES")]
+
def _createOrDropDatabase(self, op="CREATE"):
self.query('%s DATABASE %s' % (op, self.db))
diff --git a/sqlobject/tests/test_mysql.py b/sqlobject/tests/test_mysql.py
new file mode 100644
index 0000000..c22a0ed
--- /dev/null
+++ b/sqlobject/tests/test_mysql.py
@@ -0,0 +1,8 @@
+from sqlobject import *
+from sqlobject.tests.dbtest import *
+
+def test_list_databases():
+ connection = getConnection()
+ if connection.dbName != "mysql":
+ return
+ assert connection.db in connection.listDatabases()
http://sourceforge.net/p/sqlobject/sqlobject/ci/f38227c73347b11c0bc8be066a84be4e4509d7c2
commit f38227c73347b11c0bc8be066a84be4e4509d7c2
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:41:56 2015 +0300
PostgresConnection has got a new method listDatabases
diff --git a/docs/News.txt b/docs/News.txt
index ad9f168..6ace404 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -21,8 +21,9 @@ Minor features
* Tables in SELECT...FROM clause are sorted alphabetically.
-* SQLiteConnection has got a new method listDatabases() that list
- databases in the connection and return a list of names.
+* PostgresConnection and SQLiteConnection have got a new method
+ listDatabases() that lists databases in the connection and returns a
+ list of names.
SQLObject 2.0.0
===============
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 1f94ee3..6809ab6 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -426,6 +426,9 @@ class PostgresConnection(DBAPI):
cur.close()
conn.close()
+ def listDatabases(self):
+ return [v[0] for v in self.queryAll("SELECT datname FROM pg_database")]
+
def createEmptyDatabase(self):
self._createOrDropDatabase()
diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py
new file mode 100644
index 0000000..abf6674
--- /dev/null
+++ b/sqlobject/tests/test_postgres.py
@@ -0,0 +1,8 @@
+from sqlobject import *
+from sqlobject.tests.dbtest import *
+
+def test_list_databases():
+ connection = getConnection()
+ if connection.dbName != "postgres":
+ return
+ assert connection.db in connection.listDatabases()
http://sourceforge.net/p/sqlobject/sqlobject/ci/e0dcd43d4bae2e2262668b982fbf1b9206cc4024
commit e0dcd43d4bae2e2262668b982fbf1b9206cc4024
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:31:37 2015 +0300
SQLiteConnection has got a new method listDatabases
diff --git a/docs/News.txt b/docs/News.txt
index 8bb3165..ad9f168 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -21,6 +21,9 @@ Minor features
* Tables in SELECT...FROM clause are sorted alphabetically.
+* SQLiteConnection has got a new method listDatabases() that list
+ databases in the connection and return a list of names.
+
SQLObject 2.0.0
===============
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 66a6e04..452fd1c 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -397,6 +397,12 @@ class SQLiteConnection(DBAPI):
else:
return col.Col, {}
+ def listDatabases(self):
+ results = []
+ for index, name, filename in self.queryAll("PRAGMA database_list"):
+ results.append(name)
+ return results
+
def createEmptyDatabase(self):
if self._memory:
return
diff --git a/sqlobject/tests/test_sqlite.py b/sqlobject/tests/test_sqlite.py
index 136e7f4..3d5d4a4 100644
--- a/sqlobject/tests/test_sqlite.py
+++ b/sqlobject/tests/test_sqlite.py
@@ -117,3 +117,9 @@ def test_memorydb():
connection.close() # create a new connection to an in-memory database
TestSO1.setConnection(connection)
TestSO1.createTable()
+
+def test_list_databases():
+ connection = getConnection()
+ if connection.dbName != "sqlite":
+ return
+ assert connection.listDatabases() == ['main']
http://sourceforge.net/p/sqlobject/sqlobject/ci/066f269b2de98a9336e37b6208c55e78e6c18558
commit 066f269b2de98a9336e37b6208c55e78e6c18558
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 5 00:36:27 2015 +0300
Run flake8 with default number of jobs
The problem with threads was fixed in flake8 2.3.0.
diff --git a/setup.cfg b/setup.cfg
index b041d96..65d890f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,10 +10,6 @@ tag_svn_revision = 0
[flake8]
exclude = .git,docs/europython/*.py,ez_setup.py
-; flake8 has problems when running with number of threads >1
-; see https://gitlab.com/pycqa/flake8/issues/17
-jobs = 1
-
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
; E124: closing bracket does not match visual indentation
http://sourceforge.net/p/sqlobject/sqlobject/ci/2795fdc1dc4a20a054552802605d2d0edd66c2e1
commit 2795fdc1dc4a20a054552802605d2d0edd66c2e1
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 4 23:14:56 2015 +0300
Run flake8 with 1 thread
diff --git a/setup.cfg b/setup.cfg
index 65d890f..b041d96 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,6 +10,10 @@ tag_svn_revision = 0
[flake8]
exclude = .git,docs/europython/*.py,ez_setup.py
+; flake8 has problems when running with number of threads >1
+; see https://gitlab.com/pycqa/flake8/issues/17
+jobs = 1
+
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
; E124: closing bracket does not match visual indentation
http://sourceforge.net/p/sqlobject/sqlobject/ci/537e1abf0afe981e6a4e2cf1447e967053c23072
commit 537e1abf0afe981e6a4e2cf1447e967053c23072
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 4 22:24:31 2015 +0300
flake8: exclude ez_setup.py
diff --git a/setup.cfg b/setup.cfg
index 09bbe8d..65d890f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,7 +8,7 @@ tag_date = 1
tag_svn_revision = 0
[flake8]
-exclude = .git,docs/europython/*.py
+exclude = .git,docs/europython/*.py,ez_setup.py
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
http://sourceforge.net/p/sqlobject/sqlobject/ci/4347f3887fac8b13e2c358613922b58f7e7fdbad
commit 4347f3887fac8b13e2c358613922b58f7e7fdbad
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 4 22:23:04 2015 +0300
flake8: exclude old europython slides
diff --git a/setup.cfg b/setup.cfg
index 9aee39f..09bbe8d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,7 +8,7 @@ tag_date = 1
tag_svn_revision = 0
[flake8]
-exclude = .git,docs/europython/europython_sqlobj.py
+exclude = .git,docs/europython/*.py
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
http://sourceforge.net/p/sqlobject/sqlobject/ci/f2e80477601641c8c313dd204abeda41fed787e7
commit f2e80477601641c8c313dd204abeda41fed787e7
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 3 17:10:20 2015 +0300
Silence the most obnoxious errors from flake8
diff --git a/setup.cfg b/setup.cfg
index bfc84e6..9aee39f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -7,6 +7,29 @@ tag_build = dev
tag_date = 1
tag_svn_revision = 0
+[flake8]
+exclude = .git,docs/europython/europython_sqlobj.py
+
+; Ignore:
+; E123: closing bracket does not match indentation of opening bracket's line
+; E124: closing bracket does not match visual indentation
+; E126: continuation line over-indented for hanging indent
+; E127: continuation line over-indented for visual indent
+; E128: continuation line under-indented for visual indent
+; E221 multiple spaces before operator
+; E225: missing whitespace around operator
+; E226 missing whitespace around arithmetic operator
+; E231 missing whitespace after ','
+; E261: at least two spaces before inline comment
+; E265 block comment should start with '# '
+; E301 expected 1 blank line, found 0
+; E302: expected 2 blank lines, found <n>
+; E401: multiple imports on one line
+; E501 line too long (168 > 79 characters)
+; E502 the backslash is redundant between brackets
+; E701: multiple statements on one line (colon)
+ignore = E123,E124,E126,E127,E128,E221,E225,E226,E231,E261,E265,E301,E302,E401,E501,E502,E701,F
+
[pudge]
theme = pythonpaste.org
docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt
-----------------------------------------------------------------------
Summary of changes:
docs/News.txt | 4 ++++
docs/TODO.txt | 2 --
setup.cfg | 23 +++++++++++++++++++++++
sqlobject/mysql/mysqlconnection.py | 3 +++
sqlobject/postgres/pgconnection.py | 3 +++
sqlobject/sqlite/sqliteconnection.py | 6 ++++++
sqlobject/tests/test_mysql.py | 8 ++++++++
sqlobject/tests/test_postgres.py | 8 ++++++++
sqlobject/tests/test_sqlite.py | 6 ++++++
9 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 sqlobject/tests/test_mysql.py
create mode 100644 sqlobject/tests/test_postgres.py
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-02 00:44:27
|
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 b1a11f087f1528dffaa89101ba350442fd355c39 (commit)
via 1e0f19edf7bda0aa4e460c104b4a3625ba16bfc4 (commit)
via 9f413031d8c9698b249e124e1cc85a46dda27472 (commit)
from 183e0fc1e2544f9041a9acc9a54db6ec1f5574ed (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/b1a11f087f1528dffaa89101ba350442fd355c39
commit b1a11f087f1528dffaa89101ba350442fd355c39
Author: Oleg Broytman <ph...@ph...>
Date: Fri Jan 2 03:36:13 2015 +0300
Python 2.6, 2.7 or 3.4+ is required
diff --git a/README.txt b/README.txt
index 35c9556..81952bc 100644
--- a/README.txt
+++ b/README.txt
@@ -7,7 +7,7 @@ classes, and your rows in Python instances.
It currently supports MySQL through the `MySQLdb` package, PostgreSQL
through the `psycopg` package, SQLite, Firebird, MaxDB (SAP DB), MS SQL
-Sybase and Rdbhost. Python 2.6, 2.7 or 3.4 is required.
+Sybase and Rdbhost. Python 2.6, 2.7 or 3.4+ is required.
For more information please see the documentation in
docs/SQLObject.txt, or online at http://sqlobject.org/
diff --git a/docs/SQLObject.txt b/docs/SQLObject.txt
index 0fe295d..92f78b9 100644
--- a/docs/SQLObject.txt
+++ b/docs/SQLObject.txt
@@ -66,7 +66,7 @@ ADODBAPI_ (Win32).
.. _FreeTDS: http://www.freetds.org/
.. _ADODBAPI: http://adodbapi.sourceforge.net/
-Python 2.6 or 2.7 is required.
+Python 2.6, 2.7 or 3.4+ is required.
Compared To Other Database Wrappers
===================================
diff --git a/setup.py b/setup.py
index 470dc20..5be8fc9 100755
--- a/setup.py
+++ b/setup.py
@@ -52,7 +52,7 @@ more abstract, and provides substantial database independence for
applications.
Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB).
-Python 2.6, 2.7 or 3.4 is required.
+Python 2.6, 2.7 or 3.4+ is required.
For development see the projects at
`SourceForge <http://sourceforge.net/projects/sqlobject/>`_
@@ -136,7 +136,7 @@ easy to use and quick to get started with.
It currently supports MySQL through the `MySQLdb` package, PostgreSQL
through the `psycopg` package, SQLite, Firebird, MaxDB (SAP DB), MS SQL
-Sybase and Rdbhost. Python 2.6 or 2.7 is required.
+Sybase and Rdbhost. Python 2.6, 2.7 or 3.4+ is required.
Where is SQLObject
diff --git a/sqlobject/main.py b/sqlobject/main.py
index 5fb2883..340b585 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -43,8 +43,9 @@ from sresults import SelectResults
from util.threadinglocal import local
import sys
-if sys.version_info[:3] < (2, 6, 0):
- raise ImportError("SQLObject requires Python 2.6 or 2.7")
+if ((sys.version_info[0] == 2) and (sys.version_info[:3] < (2, 6, 0))) \
+or ((sys.version_info[0] == 3) and (sys.version_info[:3] < (3, 4, 0))):
+ raise ImportError("SQLObject requires Python 2.6, 2.7 or 3.4+")
"""
This thread-local storage is needed for RowCreatedSignals. It gathers
http://sourceforge.net/p/sqlobject/sqlobject/ci/1e0f19edf7bda0aa4e460c104b4a3625ba16bfc4
commit 1e0f19edf7bda0aa4e460c104b4a3625ba16bfc4
Merge: 183e0fc 9f41303
Author: Ian Cordasco <sig...@us...>
Date: Thu Jan 1 18:38:28 2015 -0600
Merge pull request #7 from sqlobject/python3/except-syntax
Use new-style exception handling syntax
http://sourceforge.net/p/sqlobject/sqlobject/ci/9f413031d8c9698b249e124e1cc85a46dda27472
commit 9f413031d8c9698b249e124e1cc85a46dda27472
Author: Ian Cordasco <gra...@gm...>
Date: Thu Dec 25 22:26:52 2014 -0600
Use new-style exception handling syntax
diff --git a/sqlobject/inheritance/__init__.py b/sqlobject/inheritance/__init__.py
index 142c520..0d4a2ce 100644
--- a/sqlobject/inheritance/__init__.py
+++ b/sqlobject/inheritance/__init__.py
@@ -485,7 +485,7 @@ class InheritableSQLObject(SQLObject):
try:
clause.append(getattr(currentClass.q, name) == value)
break
- except AttributeError, err:
+ except AttributeError as err:
pass
currentClass = currentClass.sqlmeta.parentClass
else:
diff --git a/sqlobject/main.py b/sqlobject/main.py
index 4ed836e..5fb2883 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -1097,7 +1097,7 @@ class SQLObject(object):
raise TypeError("%s.set() got an unexpected keyword argument %s" % (self.__class__.__name__, name))
try:
setattr(self, name, value)
- except AttributeError, e:
+ except AttributeError as e:
raise AttributeError('%s (with attribute %r)' % (e, name))
self.sqlmeta.dirty = True
@@ -1135,7 +1135,7 @@ class SQLObject(object):
raise TypeError("%s.set() got an unexpected keyword argument %s" % (self.__class__.__name__, name))
try:
setattr(self, name, value)
- except AttributeError, e:
+ except AttributeError as e:
raise AttributeError('%s (with attribute %r)' % (e, name))
if toUpdate:
diff --git a/sqlobject/manager/command.py b/sqlobject/manager/command.py
index 7ef787e..94335ca 100755
--- a/sqlobject/manager/command.py
+++ b/sqlobject/manager/command.py
@@ -249,7 +249,7 @@ class Command(object):
sorter.append((level, cls))
sorter.sort()
ordered_classes = [cls for level, cls in sorter]
- except SQLObjectCircularReferenceError, msg:
+ except SQLObjectCircularReferenceError as msg:
# Failsafe: return the classes as-is if a circular reference
# prevented the dependency levels to be calculated.
print("Warning: a circular reference was detected in the "
@@ -463,11 +463,11 @@ class Command(object):
module_name = module_name.replace(os.path.sep,'.')[:-3]
try:
module = moduleloader.load_module(module_name)
- except ImportError, err:
+ except ImportError as err:
if self.options.verbose:
print('Could not import module "%s". Error was : "%s"' % (module_name, err))
continue
- except Exception, exc:
+ except Exception as exc:
if self.options.verbose:
print('Unknown exception while processing module "%s" : "%s"' % (module_name, exc))
continue
@@ -634,7 +634,7 @@ class CommandCreate(Command):
if not self.options.simulate:
try:
soClass._connection.createEmptyDatabase()
- except soClass._connection.module.ProgrammingError, e:
+ except soClass._connection.module.ProgrammingError as e:
if str(e).find('already exists') != -1:
print('Database already exists')
else:
@@ -757,7 +757,7 @@ class CommandStatus(Command):
columnsFromSchema_warning = True
good += 1
continue
- except AssertionError, e:
+ except AssertionError as e:
print('Cannot read db table %s: %s' % (
soClass.sqlmeta.table, e))
continue
@@ -847,7 +847,7 @@ class CommandExecute(Command):
print(sql)
try:
self.cursor.execute(sql)
- except Exception, e:
+ except Exception as e:
if not self.options.verbose:
print(sql)
print("****Error:")
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index df02b9b..87011b2 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -71,7 +71,7 @@ class MySQLConnection(DBAPI):
db=self.db, user=self.user, passwd=self.password, **self.kw)
if self.module.version_info[:3] >= (1, 2, 2):
conn.ping(True) # Attempt to reconnect. This setting is persistent.
- except self.module.OperationalError, e:
+ except self.module.OperationalError as e:
conninfo = "; used connection string: host=%(host)s, port=%(port)s, db=%(db)s, user=%(user)s" % self.__dict__
raise OperationalError(ErrorMessage(e, conninfo))
@@ -113,7 +113,7 @@ class MySQLConnection(DBAPI):
for count in range(3):
try:
return cursor.execute(query)
- except self.module.OperationalError, e:
+ except self.module.OperationalError as e:
if e.args[0] in (self.module.constants.CR.SERVER_GONE_ERROR, self.module.constants.CR.SERVER_LOST):
if count == 2:
raise OperationalError(ErrorMessage(e))
@@ -121,27 +121,27 @@ class MySQLConnection(DBAPI):
self.printDebug(conn, str(e), 'ERROR')
else:
raise OperationalError(ErrorMessage(e))
- except self.module.IntegrityError, e:
+ except self.module.IntegrityError as e:
msg = ErrorMessage(e)
if e.args[0] == self.module.constants.ER.DUP_ENTRY:
raise DuplicateEntryError(msg)
else:
raise IntegrityError(msg)
- except self.module.InternalError, e:
+ except self.module.InternalError as e:
raise InternalError(ErrorMessage(e))
- except self.module.ProgrammingError, e:
+ except self.module.ProgrammingError as e:
raise ProgrammingError(ErrorMessage(e))
- except self.module.DataError, e:
+ except self.module.DataError as e:
raise DataError(ErrorMessage(e))
- except self.module.NotSupportedError, e:
+ except self.module.NotSupportedError as e:
raise NotSupportedError(ErrorMessage(e))
- except self.module.DatabaseError, e:
+ except self.module.DatabaseError as e:
raise DatabaseError(ErrorMessage(e))
- except self.module.InterfaceError, e:
+ except self.module.InterfaceError as e:
raise InterfaceError(ErrorMessage(e))
- except self.module.Warning, e:
+ except self.module.Warning as e:
raise Warning(ErrorMessage(e))
- except self.module.Error, e:
+ except self.module.Error as e:
raise Error(ErrorMessage(e))
def _queryInsertID(self, conn, soInstance, id, names, values):
@@ -196,7 +196,7 @@ class MySQLConnection(DBAPI):
# which is not always True (for an embedded application, e.g.)
self.query('DESCRIBE %s' % (tableName))
return True
- except ProgrammingError, e:
+ except ProgrammingError as e:
if e[0].code == 1146: # ER_NO_SUCH_TABLE
return False
raise
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 1f94ee3..6ddb40f 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -142,7 +142,7 @@ class PostgresConnection(DBAPI):
conn = self.module.connect(self.dsn)
else:
conn = self.module.connect(**self.dsn_dict)
- except self.module.OperationalError, e:
+ except self.module.OperationalError as e:
raise OperationalError(ErrorMessage(e, "used connection string %r" % self.dsn))
# For printDebug in _executeRetry
@@ -162,29 +162,29 @@ class PostgresConnection(DBAPI):
self.printDebug(conn, query, 'QueryR')
try:
return cursor.execute(query)
- except self.module.OperationalError, e:
+ except self.module.OperationalError as e:
raise OperationalError(ErrorMessage(e))
- except self.module.IntegrityError, e:
+ except self.module.IntegrityError as e:
msg = ErrorMessage(e)
if e.pgcode == '23505':
raise DuplicateEntryError(msg)
else:
raise IntegrityError(msg)
- except self.module.InternalError, e:
+ except self.module.InternalError as e:
raise InternalError(ErrorMessage(e))
- except self.module.ProgrammingError, e:
+ except self.module.ProgrammingError as e:
raise ProgrammingError(ErrorMessage(e))
- except self.module.DataError, e:
+ except self.module.DataError as e:
raise DataError(ErrorMessage(e))
- except self.module.NotSupportedError, e:
+ except self.module.NotSupportedError as e:
raise NotSupportedError(ErrorMessage(e))
- except self.module.DatabaseError, e:
+ except self.module.DatabaseError as e:
raise DatabaseError(ErrorMessage(e))
- except self.module.InterfaceError, e:
+ except self.module.InterfaceError as e:
raise InterfaceError(ErrorMessage(e))
- except self.module.Warning, e:
+ except self.module.Warning as e:
raise Warning(ErrorMessage(e))
- except self.module.Error, e:
+ except self.module.Error as e:
raise Error(ErrorMessage(e))
def _queryInsertID(self, conn, soInstance, id, names, values):
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 66a6e04..674543f 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -206,30 +206,30 @@ class SQLiteConnection(DBAPI):
self.printDebug(conn, query, 'QueryR')
try:
return cursor.execute(query)
- except self.module.OperationalError, e:
+ except self.module.OperationalError as e:
raise OperationalError(ErrorMessage(e))
- except self.module.IntegrityError, e:
+ except self.module.IntegrityError as e:
msg = ErrorMessage(e)
if msg.startswith('column') and msg.endswith('not unique') \
or msg.startswith('UNIQUE constraint failed:'):
raise DuplicateEntryError(msg)
else:
raise IntegrityError(msg)
- except self.module.InternalError, e:
+ except self.module.InternalError as e:
raise InternalError(ErrorMessage(e))
- except self.module.ProgrammingError, e:
+ except self.module.ProgrammingError as e:
raise ProgrammingError(ErrorMessage(e))
- except self.module.DataError, e:
+ except self.module.DataError as e:
raise DataError(ErrorMessage(e))
- except self.module.NotSupportedError, e:
+ except self.module.NotSupportedError as e:
raise NotSupportedError(ErrorMessage(e))
- except self.module.DatabaseError, e:
+ except self.module.DatabaseError as e:
raise DatabaseError(ErrorMessage(e))
- except self.module.InterfaceError, e:
+ except self.module.InterfaceError as e:
raise InterfaceError(ErrorMessage(e))
- except self.module.Warning, e:
+ except self.module.Warning as e:
raise Warning(ErrorMessage(e))
- except self.module.Error, e:
+ except self.module.Error as e:
raise Error(ErrorMessage(e))
def _queryInsertID(self, conn, soInstance, id, names, values):
diff --git a/sqlobject/tests/dbtest.py b/sqlobject/tests/dbtest.py
index 4467edf..753f950 100644
--- a/sqlobject/tests/dbtest.py
+++ b/sqlobject/tests/dbtest.py
@@ -101,7 +101,7 @@ def getConnectionURI():
try:
connection = getConnection()
-except Exception, e:
+except Exception as e:
# At least this module should be importable...
print("Could not open database: %s" % e, file=sys.stderr)
diff --git a/sqlobject/tests/test_exceptions.py b/sqlobject/tests/test_exceptions.py
index 6c37524..0588bbc 100644
--- a/sqlobject/tests/test_exceptions.py
+++ b/sqlobject/tests/test_exceptions.py
@@ -25,7 +25,7 @@ def test_exceptions():
TestExceptionWithNonexistingTable.setConnection(connection)
try:
list(TestExceptionWithNonexistingTable.select())
- except ProgrammingError, e:
+ except ProgrammingError as e:
assert e.args[0].code == '42P01'
else:
assert False, "DID NOT RAISE"
diff --git a/sqlobject/tests/test_indexes.py b/sqlobject/tests/test_indexes.py
index c665b6d..56e0f31 100644
--- a/sqlobject/tests/test_indexes.py
+++ b/sqlobject/tests/test_indexes.py
@@ -64,28 +64,28 @@ def test_index_get_1():
try:
print(PersonIndexGet.nameIndex.get(firstName='Graham', lastName='Chapman'))
- except Exception, e:
+ except Exception as e:
pass
else:
raise AssertError
try:
print(PersonIndexGet.nameIndex.get('Terry', lastName='Gilliam'))
- except Exception, e:
+ except Exception as e:
pass
else:
raise AssertError
try:
print(PersonIndexGet.nameIndex.get('Terry', 'Gilliam', 65))
- except Exception, e:
+ except Exception as e:
pass
else:
raise AssertError
try:
print(PersonIndexGet.nameIndex.get('Terry'))
- except Exception, e:
+ except Exception as e:
pass
else:
raise AssertError
diff --git a/sqlobject/util/moduleloader.py b/sqlobject/util/moduleloader.py
index f64f369..e3f8d29 100644
--- a/sqlobject/util/moduleloader.py
+++ b/sqlobject/util/moduleloader.py
@@ -15,7 +15,7 @@ def load_module_from_name(filename, module_name):
if not os.path.exists(init_filename):
try:
f = open(init_filename, 'w')
- except (OSError, IOError), e:
+ except (OSError, IOError) as e:
raise IOError(
'Cannot write __init__.py file into directory %s (%s)\n'
% (os.path.dirname(filename), e))
-----------------------------------------------------------------------
Summary of changes:
README.txt | 2 +-
docs/SQLObject.txt | 2 +-
setup.py | 4 ++--
sqlobject/inheritance/__init__.py | 2 +-
sqlobject/main.py | 9 +++++----
sqlobject/manager/command.py | 12 ++++++------
sqlobject/mysql/mysqlconnection.py | 24 ++++++++++++------------
sqlobject/postgres/pgconnection.py | 22 +++++++++++-----------
sqlobject/sqlite/sqliteconnection.py | 20 ++++++++++----------
sqlobject/tests/dbtest.py | 2 +-
sqlobject/tests/test_exceptions.py | 2 +-
sqlobject/tests/test_indexes.py | 8 ++++----
sqlobject/util/moduleloader.py | 2 +-
13 files changed, 56 insertions(+), 55 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2015-01-01 23:11:04
|
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 183e0fc1e2544f9041a9acc9a54db6ec1f5574ed (commit)
from 5c19f5671651a944a2b9eeebc82293c71a689499 (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/183e0fc1e2544f9041a9acc9a54db6ec1f5574ed
commit 183e0fc1e2544f9041a9acc9a54db6ec1f5574ed
Author: Oleg Broytman <ph...@ph...>
Date: Fri Jan 2 01:55:05 2015 +0300
PyDispatcher (>=2.0.4) was made an external dependency
diff --git a/MANIFEST.in b/MANIFEST.in
index 702c17e..3c13468 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,7 +2,6 @@ include .gitignore docs/.gitignore
include MANIFEST.in ez_setup.py
include .travis.yml tox.ini
include *.txt docs/LICENSE docs/*.txt docs/rebuild
-include sqlobject/include/pydispatch/README.txt
include sqlobject/maxdb/readme.txt
recursive-include debian *
recursive-include docs *.css *.html *.js *.gif *.py
diff --git a/docs/News.txt b/docs/News.txt
index 5c44f0f..249b475 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -10,6 +10,8 @@ News
SQLObject 3.0.0 (master)
========================
+* PyDispatcher (>=2.0.4) was made an external dependency.
+
SQLObject 2.1.0
===============
diff --git a/setup.py b/setup.py
index b79a210..470dc20 100755
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ versionpath = join(abspath(dirname(__file__)), "sqlobject", "__version__.py")
load_source("sqlobject_version", versionpath)
from sqlobject_version import version
-subpackages = ['firebird', 'include', 'include.pydispatch',
+subpackages = ['firebird', 'include',
'inheritance', 'inheritance.tests',
'manager', 'maxdb', 'mysql', 'mssql', 'postgres', 'rdbhost',
'sqlite', 'sybase', 'tests', 'util',
@@ -28,7 +28,7 @@ if is_setuptools:
[paste.filter_app_factory]
main = sqlobject.wsgi_middleware:make_middleware
"""
- kw['install_requires'] = ["FormEncode>=1.1.1"]
+ kw['install_requires'] = ["FormEncode>=1.1.1", "PyDispatcher>=2.0.4"]
kw['extras_require'] = {
'mysql': ['MySQLdb'],
'postgresql': ['psycopg'], # or pgdb from PyGreSQL
@@ -102,7 +102,6 @@ and `GitHub <https://github.com/sqlobject>`_.
"../docs/html/sqlobject/util/*.html",
"../docs/html/sqlobject/versioning/*.html",
],
- "sqlobject.include": ["pydispatch/*.txt"],
"sqlobject.maxdb": ["readme.txt"],
},
**kw
diff --git a/sqlobject/events.py b/sqlobject/events.py
index c4928bc..a36643c 100644
--- a/sqlobject/events.py
+++ b/sqlobject/events.py
@@ -1,7 +1,7 @@
from __future__ import print_function
import sys
import types
-from sqlobject.include.pydispatch import dispatcher
+from pydispatch import dispatcher
from weakref import ref
diff --git a/sqlobject/include/pydispatch/README.txt b/sqlobject/include/pydispatch/README.txt
deleted file mode 100644
index 7064a62..0000000
--- a/sqlobject/include/pydispatch/README.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This is from PyDispatcher <http://pydispatcher.sf.net>
-
-It was moved here because installation of PyDispatcher conflicts with
-RuleDispatch (they both use the dispatch top-level module), and I
-thought it would be easier to just put it here. Also, PyDispatcher is
-small and stable and doesn't need updating often.
-
-If the name conflict is resolved in the future, this package can go
-away.
diff --git a/sqlobject/include/pydispatch/__init__.py b/sqlobject/include/pydispatch/__init__.py
deleted file mode 100644
index b13f5f6..0000000
--- a/sqlobject/include/pydispatch/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-"""Multi-consumer multi-producer dispatching mechanism
-"""
-__version__ = "2.0.3"
-__author__ = "Patrick K. O'Brien"
-__license__ = "BSD-style, see license.txt for details"
-
diff --git a/sqlobject/include/pydispatch/dispatcher.py b/sqlobject/include/pydispatch/dispatcher.py
deleted file mode 100644
index 9b09503..0000000
--- a/sqlobject/include/pydispatch/dispatcher.py
+++ /dev/null
@@ -1,492 +0,0 @@
-"""Multiple-producer-multiple-consumer signal-dispatching
-
-dispatcher is the core of the PyDispatcher system,
-providing the primary API and the core logic for the
-system.
-
-Module attributes of note:
-
- Any -- Singleton used to signal either "Any Sender" or
- "Any Signal". See documentation of the _Any class.
- Anonymous -- Singleton used to signal "Anonymous Sender"
- See documentation of the _Anonymous class.
-
-Internal attributes:
- WEAKREF_TYPES -- tuple of types/classes which represent
- weak references to receivers, and thus must be de-
- referenced on retrieval to retrieve the callable
- object
- connections -- { senderkey (id) : { signal : [receivers...]}}
- senders -- { senderkey (id) : weakref(sender) }
- used for cleaning up sender references on sender
- deletion
- sendersBack -- { receiverkey (id) : [senderkey (id)...] }
- used for cleaning up receiver references on receiver
- deletion, (considerably speeds up the cleanup process
- vs. the original code.)
-"""
-from __future__ import generators
-import weakref
-import saferef, robustapply, errors
-
-__author__ = "Patrick K. O'Brien <po...@or...>"
-__cvsid__ = "$Id: dispatcher.py,v 1.1 2010/03/30 15:45:55 mcfletch Exp $"
-__version__ = "$Revision: 1.1 $"[11:-2]
-
-class _Parameter:
- """Used to represent default parameter values."""
- def __repr__(self):
- return self.__class__.__name__
-
-class _Any(_Parameter):
- """Singleton used to signal either "Any Sender" or "Any Signal"
-
- The Any object can be used with connect, disconnect,
- send, or sendExact to signal that the parameter given
- Any should react to all senders/signals, not just
- a particular sender/signal.
- """
-Any = _Any()
-
-class _Anonymous(_Parameter):
- """Singleton used to signal "Anonymous Sender"
-
- The Anonymous object is used to signal that the sender
- of a message is not specified (as distinct from being
- "any sender"). Registering callbacks for Anonymous
- will only receive messages sent without senders. Sending
- with anonymous will only send messages to those receivers
- registered for Any or Anonymous.
-
- Note:
- The default sender for connect is Any, while the
- default sender for send is Anonymous. This has
- the effect that if you do not specify any senders
- in either function then all messages are routed
- as though there was a single sender (Anonymous)
- being used everywhere.
- """
-Anonymous = _Anonymous()
-
-WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
-
-connections = {}
-senders = {}
-sendersBack = {}
-
-
-def connect(receiver, signal=Any, sender=Any, weak=True):
- """Connect receiver to sender for signal
-
- receiver -- a callable Python object which is to receive
- messages/signals/events. Receivers must be hashable
- objects.
-
- if weak is True, then receiver must be weak-referencable
- (more precisely saferef.safeRef() must be able to create
- a reference to the receiver).
-
- Receivers are fairly flexible in their specification,
- as the machinery in the robustApply module takes care
- of most of the details regarding figuring out appropriate
- subsets of the sent arguments to apply to a given
- receiver.
-
- Note:
- if receiver is itself a weak reference (a callable),
- it will be de-referenced by the system's machinery,
- so *generally* weak references are not suitable as
- receivers, though some use might be found for the
- facility whereby a higher-level library passes in
- pre-weakrefed receiver references.
-
- signal -- the signal to which the receiver should respond
-
- if Any, receiver will receive any signal from the
- indicated sender (which might also be Any, but is not
- necessarily Any).
-
- Otherwise must be a hashable Python object other than
- None (DispatcherError raised on None).
-
- sender -- the sender to which the receiver should respond
-
- if Any, receiver will receive the indicated signals
- from any sender.
-
- if Anonymous, receiver will only receive indicated
- signals from send/sendExact which do not specify a
- sender, or specify Anonymous explicitly as the sender.
-
- Otherwise can be any python object.
-
- weak -- whether to use weak references to the receiver
- By default, the module will attempt to use weak
- references to the receiver objects. If this parameter
- is false, then strong references will be used.
-
- returns None, may raise DispatcherTypeError
- """
- if signal is None:
- raise errors.DispatcherTypeError(
- 'Signal cannot be None (receiver=%r sender=%r)'%( receiver,sender)
- )
- if weak:
- receiver = saferef.safeRef(receiver, onDelete=_removeReceiver)
- senderkey = id(sender)
- if senderkey in connections:
- signals = connections[senderkey]
- else:
- connections[senderkey] = signals = {}
- # Keep track of senders for cleanup.
- # Is Anonymous something we want to clean up?
- if sender not in (None, Anonymous, Any):
- def remove(object, senderkey=senderkey):
- _removeSender(senderkey=senderkey)
- # Skip objects that can not be weakly referenced, which means
- # they won't be automatically cleaned up, but that's too bad.
- try:
- weakSender = weakref.ref(sender, remove)
- senders[senderkey] = weakSender
- except:
- pass
-
- receiverID = id(receiver)
- # get current set, remove any current references to
- # this receiver in the set, including back-references
- if signal in signals:
- receivers = signals[signal]
- _removeOldBackRefs(senderkey, signal, receiver, receivers)
- else:
- receivers = signals[signal] = []
- try:
- current = sendersBack.get( receiverID )
- if current is None:
- sendersBack[ receiverID ] = current = []
- if senderkey not in current:
- current.append(senderkey)
- except:
- pass
-
- receivers.append(receiver)
-
-
-
-def disconnect(receiver, signal=Any, sender=Any, weak=True):
- """Disconnect receiver from sender for signal
-
- receiver -- the registered receiver to disconnect
- signal -- the registered signal to disconnect
- sender -- the registered sender to disconnect
- weak -- the weakref state to disconnect
-
- disconnect reverses the process of connect,
- the semantics for the individual elements are
- logically equivalent to a tuple of
- (receiver, signal, sender, weak) used as a key
- to be deleted from the internal routing tables.
- (The actual process is slightly more complex
- but the semantics are basically the same).
-
- Note:
- Using disconnect is not required to cleanup
- routing when an object is deleted, the framework
- will remove routes for deleted objects
- automatically. It's only necessary to disconnect
- if you want to stop routing to a live object.
-
- returns None, may raise DispatcherTypeError or
- DispatcherKeyError
- """
- if signal is None:
- raise errors.DispatcherTypeError(
- 'Signal cannot be None (receiver=%r sender=%r)'%( receiver,sender)
- )
- if weak: receiver = saferef.safeRef(receiver)
- senderkey = id(sender)
- try:
- signals = connections[senderkey]
- receivers = signals[signal]
- except KeyError:
- raise errors.DispatcherKeyError(
- """No receivers found for signal %r from sender %r""" %(
- signal,
- sender
- )
- )
- try:
- # also removes from receivers
- _removeOldBackRefs(senderkey, signal, receiver, receivers)
- except ValueError:
- raise errors.DispatcherKeyError(
- """No connection to receiver %s for signal %s from sender %s""" %(
- receiver,
- signal,
- sender
- )
- )
- _cleanupConnections(senderkey, signal)
-
-def getReceivers( sender = Any, signal = Any ):
- """Get list of receivers from global tables
-
- This utility function allows you to retrieve the
- raw list of receivers from the connections table
- for the given sender and signal pair.
-
- Note:
- there is no guarantee that this is the actual list
- stored in the connections table, so the value
- should be treated as a simple iterable/truth value
- rather than, for instance a list to which you
- might append new records.
-
- Normally you would use liveReceivers( getReceivers( ...))
- to retrieve the actual receiver objects as an iterable
- object.
- """
- try:
- return connections[id(sender)][signal]
- except KeyError:
- return []
-
-def liveReceivers(receivers):
- """Filter sequence of receivers to get resolved, live receivers
-
- This is a generator which will iterate over
- the passed sequence, checking for weak references
- and resolving them, then returning all live
- receivers.
- """
- for receiver in receivers:
- if isinstance( receiver, WEAKREF_TYPES):
- # Dereference the weak reference.
- receiver = receiver()
- if receiver is not None:
- yield receiver
- else:
- yield receiver
-
-
-
-def getAllReceivers( sender = Any, signal = Any ):
- """Get list of all receivers from global tables
-
- This gets all receivers which should receive
- the given signal from sender, each receiver should
- be produced only once by the resulting generator
- """
- receivers = {}
- for set in (
- # Get receivers that receive *this* signal from *this* sender.
- getReceivers( sender, signal ),
- # Add receivers that receive *any* signal from *this* sender.
- getReceivers( sender, Any ),
- # Add receivers that receive *this* signal from *any* sender.
- getReceivers( Any, signal ),
- # Add receivers that receive *any* signal from *any* sender.
- getReceivers( Any, Any ),
- ):
- for receiver in set:
- if receiver: # filter out dead instance-method weakrefs
- try:
- if receiver not in receivers:
- receivers[receiver] = 1
- yield receiver
- except TypeError:
- # dead weakrefs raise TypeError on hash...
- pass
-
-def send(signal=Any, sender=Anonymous, *arguments, **named):
- """Send signal from sender to all connected receivers.
-
- signal -- (hashable) signal value, see connect for details
-
- sender -- the sender of the signal
-
- if Any, only receivers registered for Any will receive
- the message.
-
- if Anonymous, only receivers registered to receive
- messages from Anonymous or Any will receive the message
-
- Otherwise can be any python object (normally one
- registered with a connect if you actually want
- something to occur).
-
- arguments -- positional arguments which will be passed to
- *all* receivers. Note that this may raise TypeErrors
- if the receivers do not allow the particular arguments.
- Note also that arguments are applied before named
- arguments, so they should be used with care.
-
- named -- named arguments which will be filtered according
- to the parameters of the receivers to only provide those
- acceptable to the receiver.
-
- Return a list of tuple pairs [(receiver, response), ... ]
-
- if any receiver raises an error, the error propagates back
- through send, terminating the dispatch loop, so it is quite
- possible to not have all receivers called if a raises an
- error.
- """
- # Call each receiver with whatever arguments it can accept.
- # Return a list of tuple pairs [(receiver, response), ... ].
- responses = []
- for receiver in liveReceivers(getAllReceivers(sender, signal)):
- response = robustapply.robustApply(
- receiver,
- signal=signal,
- sender=sender,
- *arguments,
- **named
- )
- responses.append((receiver, response))
- return responses
-def sendExact( signal=Any, sender=Anonymous, *arguments, **named ):
- """Send signal only to those receivers registered for exact message
-
- sendExact allows for avoiding Any/Anonymous registered
- handlers, sending only to those receivers explicitly
- registered for a particular signal on a particular
- sender.
- """
- responses = []
- for receiver in liveReceivers(getReceivers(sender, signal)):
- response = robustapply.robustApply(
- receiver,
- signal=signal,
- sender=sender,
- *arguments,
- **named
- )
- responses.append((receiver, response))
- return responses
-
-
-def _removeReceiver(receiver):
- """Remove receiver from connections."""
- if not sendersBack:
- # During module cleanup the mapping will be replaced with None
- return False
- backKey = id(receiver)
- try:
- backSet = sendersBack.pop(backKey)
- except KeyError:
- return False
- else:
- for senderkey in backSet:
- try:
- signals = connections[senderkey].keys()
- except KeyError:
- pass
... 506 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2014-12-26 22:59:16
|
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, 2.0 has been updated
via 1fd5a272b6316f31e3e41898d4614d9710ffe5ca (commit)
via ea339a430e7a405078e5d28b79bd3319adab9cea (commit)
via 2504ac83de701741a703b6adc3d55eda0a5a6524 (commit)
from b78d5f641764a884ec8c2bbc4761282a77e1e134 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
MANIFEST.in | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
SQLObject development repository
|
|
From: Oleg B. <no...@so...> - 2014-12-26 04:11:16
|
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, 2.1 has been updated
via 2fb4ff258112fb5e67844101fc3b67ef8caa91ae (commit)
via b78d5f641764a884ec8c2bbc4761282a77e1e134 (commit)
via 42d1709776aa481d58bda2663aff5ea19a856272 (commit)
via c8ee606ae289b9a924d1f36f08efd53d9fa23c4b (commit)
via 5ce86792472056414c020c8d0e9ab2384eb42379 (commit)
via 196717ad6476e08a56c6ed4b923a2e82f60f3d55 (commit)
via eb9b737b26fc44626c6ec351551da5a3d61c9583 (commit)
via 0d4029bf78984e43e7269a760fc214495c0766fd (commit)
from 8745b5c54e476df1d13b7f24e51fbb799881136b (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 -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
docs/TODO.txt | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
hooks/post-receive
--
SQLObject development repository
|