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 18c14963a7a79ff81d1637dbf916a00aab893fba (commit)
via d12ab4b5e63904f3e45a2cb362cc37ba7a5edd43 (commit)
via d7b80b7237d79f94c3be05283dfa6b3f33e156d9 (commit)
from ff296ca1f8996fd5a38074a440ac9c1436c7fb0e (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/18c14963a7a79ff81d1637dbf916a00aab893fba
commit 18c14963a7a79ff81d1637dbf916a00aab893fba
Merge: ff296ca d12ab4b
Author: Oleg Broytman <ph...@ph...>
Date: Mon Feb 9 00:20:21 2015 +0300
Merge branch 'flake8-fixes'
diff --cc sqlobject/sqlite/sqliteconnection.py
index a62a9d8,57bedef..b3f009f
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@@ -142,9 -139,8 +142,8 @@@ 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):
+ if (self._pool is not None and threadid in self._threadPool):
conn = self._threadPool[threadid]
del self._threadPool[threadid]
if conn in self._pool:
http://sourceforge.net/p/sqlobject/sqlobject/ci/d12ab4b5e63904f3e45a2cb362cc37ba7a5edd43
commit d12ab4b5e63904f3e45a2cb362cc37ba7a5edd43
Author: Oleg Broytman <ph...@ph...>
Date: Mon Feb 9 00:10:39 2015 +0300
Fix #18 flake8 E261 at least two spaces before inline comment
diff --git a/sqlobject/inheritance/tests/test_foreignKey.py b/sqlobject/inheritance/tests/test_foreignKey.py
index ce71846..357a5a3 100644
--- a/sqlobject/inheritance/tests/test_foreignKey.py
+++ b/sqlobject/inheritance/tests/test_foreignKey.py
@@ -51,7 +51,9 @@ def test_foreignKey():
persons = PersonWithNotes.selectBy(noteID=person.note.id)
assert persons.count() == 1
- employee = EmployeeWithNotes.select(PersonWithNotes.q.noteID <> None)
+ # comparison to None needed to build the right SQL expression
+ employee = EmployeeWithNotes.select(
+ PersonWithNotes.q.noteID != None) # noqa
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..93d04cf 100644
--- a/sqlobject/inheritance/tests/test_inheritance.py
+++ b/sqlobject/inheritance/tests/test_inheritance.py
@@ -50,19 +50,23 @@ def test_inheritance():
def test_inheritance_select():
setup()
- persons = InheritablePerson.select(InheritablePerson.q.firstName <> None)
+ # comparison to None needed to build the right SQL expression
+ persons = InheritablePerson.select(
+ InheritablePerson.q.firstName != None) # noqa
assert persons.count() == 2
persons = InheritablePerson.select(InheritablePerson.q.firstName == "phd")
assert persons.count() == 0
- employees = Employee.select(Employee.q.firstName <> None)
+ # comparison to None needed to build the right SQL expression
+ employees = Employee.select(Employee.q.firstName != None) # noqa
assert employees.count() == 1
employees = Employee.select(Employee.q.firstName == "phd")
assert employees.count() == 0
- employees = Employee.select(Employee.q.position <> None)
+ # comparison to None needed to build the right SQL expression
+ employees = Employee.select(Employee.q.position != None) # noqa
assert employees.count() == 1
persons = InheritablePerson.selectBy(firstName="Project")
http://sourceforge.net/p/sqlobject/sqlobject/ci/d7b80b7237d79f94c3be05283dfa6b3f33e156d9
commit d7b80b7237d79f94c3be05283dfa6b3f33e156d9
Author: Oleg Broytman <ph...@ph...>
Date: Sun Feb 8 21:31:09 2015 +0300
Fix #31 flake8 E129
visually indented line with same indent as next logical line
diff --git a/sqlobject/conftest.py b/sqlobject/conftest.py
index 7d71dff..fa29e1c 100644
--- a/sqlobject/conftest.py
+++ b/sqlobject/conftest.py
@@ -67,8 +67,8 @@ def pytest_configure(config):
class SQLObjectClass(py.test.collect.Class):
def run(self):
- if (isinstance(self.obj, type)
- and issubclass(self.obj, sqlobject.SQLObject)):
+ if (isinstance(self.obj, type) and
+ issubclass(self.obj, sqlobject.SQLObject)):
return []
return super(SQLObjectClass, self).run()
diff --git a/sqlobject/main.py b/sqlobject/main.py
index e1ff1fa..b783a42 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -821,8 +821,7 @@ class SQLObject(object):
# class. If so, then we need to remove that column from
# _columns.
for key in sqlmeta.columnDefinitions.keys():
- if (key in new_attrs
- and new_attrs[key] is None):
+ if (key in new_attrs and new_attrs[key] is None):
del sqlmeta.columnDefinitions[key]
for column in sqlmeta.columnDefinitions.values():
@@ -876,8 +875,7 @@ class SQLObject(object):
inheritance. Lastly it calls sqlmeta.setClass, which handles
much of the setup.
"""
- if ('sqlmeta' not in new_attrs
- and not is_base):
+ if ('sqlmeta' not in new_attrs and not is_base):
# We have to create our own subclass, usually.
# type(className, bases_tuple, attr_dict) creates a new subclass.
cls.sqlmeta = type('sqlmeta', (cls.sqlmeta,), {})
@@ -1533,7 +1531,7 @@ class SQLObject(object):
conn = connection or cls._connection
for join in cls._getJoinsToCreate():
if (ifNotExists and
- conn.tableExists(join.intermediateTable)):
+ conn.tableExists(join.intermediateTable)):
continue
conn._SO_createJoinTable(join)
diff --git a/sqlobject/manager/command.py b/sqlobject/manager/command.py
index c310af7..1b66e81 100755
--- a/sqlobject/manager/command.py
+++ b/sqlobject/manager/command.py
@@ -295,8 +295,8 @@ class Command(object):
if self.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):
+ if (getattr(self.options, 'simulate', False) and
+ not self.options.verbose):
self.options.verbose = 1
if self.min_args is not None and len(self.args) < self.min_args:
self.runner.invalid(
@@ -389,9 +389,9 @@ class Command(object):
else:
for name in dir(module):
value = getattr(module, name)
- if (isinstance(value, type)
- and issubclass(value, sqlobject.SQLObject)
- and value.__module__ == module.__name__):
+ if (isinstance(value, type) and
+ issubclass(value, sqlobject.SQLObject) and
+ value.__module__ == module.__name__):
all.append(value)
return all
@@ -412,8 +412,8 @@ class Command(object):
return None
config_file = self.options.config_file
if appconfig:
- if (not config_file.startswith('egg:')
- and not config_file.startswith('config:')):
+ if (not config_file.startswith('egg:') and
+ not config_file.startswith('config:')):
config_file = 'config:' + config_file
return appconfig(config_file,
relative_to=os.getcwd())
@@ -508,9 +508,8 @@ class Command(object):
def load_options_from_egg(self, egg_spec):
dist, conf = self.config_from_egg(egg_spec)
- if (hasattr(self.options, 'output_dir')
- and not self.options.output_dir
- and conf.get('history_dir')):
+ if (hasattr(self.options, 'output_dir') and
+ not self.options.output_dir and conf.get('history_dir')):
dir = conf['history_dir']
dir = dir.replace('$base', dist.location)
self.options.output_dir = dir
@@ -648,8 +647,8 @@ class CommandCreate(Command):
dbs_created = []
constraints = {}
for soClass in self.classes(require_some=True):
- if (self.options.create_db
- and soClass._connection not in dbs_created):
+ if (self.options.create_db and
+ soClass._connection not in dbs_created):
if not self.options.simulate:
try:
soClass._connection.createEmptyDatabase()
@@ -673,8 +672,7 @@ class CommandCreate(Command):
if v >= 2:
sql, extra = soClass.createTableSQL()
print(sql)
- if (not self.options.simulate
- and not exists):
+ if (not self.options.simulate and not exists):
if self.options.interactive:
if self.ask('Create %s' % soClass.__name__):
created += 1
@@ -723,8 +721,7 @@ class CommandDrop(Command):
else:
not_existing += 1
print('%s does not exist.' % soClass.__name__)
- if (not self.options.simulate
- and exists):
+ if (not self.options.simulate and exists):
if self.options.interactive:
if self.ask('Drop %s' % soClass.__name__):
dropped += 1
@@ -1006,8 +1003,8 @@ class CommandRecord(Command):
f = open(os.path.join(last_version_dir, fn), 'r')
content = f.read()
f.close()
- if (self.strip_comments(files_copy[fn])
- != self.strip_comments(content)):
+ if (self.strip_comments(files_copy[fn]) !=
+ self.strip_comments(content)):
if v > 1:
print("Content does not match: %s" % fn)
break
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 2f398c1..57bedef 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -140,8 +140,7 @@ class SQLiteConnection(DBAPI):
self._connectionCount += 1
return conn
threadid = thread.get_ident()
- if (self._pool is not None
- and threadid in self._threadPool):
+ if (self._pool is not None and threadid in self._threadPool):
conn = self._threadPool[threadid]
del self._threadPool[threadid]
if conn in self._pool:
@@ -165,8 +164,8 @@ class SQLiteConnection(DBAPI):
return
threadid = self._threadOrigination.get(id(conn))
DBAPI.releaseConnection(self, conn, explicit=explicit)
- if (self._pool is not None and threadid
- and threadid not in self._threadPool):
+ if (self._pool is not None and threadid and
+ threadid not in self._threadPool):
self._threadPool[threadid] = conn
else:
if self._pool and conn in self._pool:
diff --git a/sqlobject/tests/test_declarative.py b/sqlobject/tests/test_declarative.py
index a97ba52..60f6e15 100644
--- a/sqlobject/tests/test_declarative.py
+++ b/sqlobject/tests/test_declarative.py
@@ -41,9 +41,8 @@ class B1(Declarative):
def add_attrs(old_attrs, new_attrs):
old_attrs = old_attrs[:]
for name in new_attrs.keys():
- if (name in old_attrs
- or name.startswith('_')
- or name in ('add_attrs', 'declarative_count', 'attrs')):
+ if (name in old_attrs or name.startswith('_') or
+ name in ('add_attrs', 'declarative_count', 'attrs')):
continue
old_attrs.append(name)
old_attrs.sort()
diff --git a/sqlobject/util/csvimport.py b/sqlobject/util/csvimport.py
index 247a9f2..fc91825 100644
--- a/sqlobject/util/csvimport.py
+++ b/sqlobject/util/csvimport.py
@@ -89,7 +89,7 @@ def create_data(data, class_getter, keyorder=None):
objects = {}
classnames = data.keys()
if (not keyorder and isinstance(class_getter, types.ModuleType)
- and hasattr(class_getter, 'soClasses')):
+ and hasattr(class_getter, 'soClasses')):
keyorder = [c.__name__ for c in class_getter.soClasses]
if not keyorder:
classnames.sort()
-----------------------------------------------------------------------
Summary of changes:
sqlobject/conftest.py | 4 +-
sqlobject/inheritance/tests/test_foreignKey.py | 3 +-
sqlobject/inheritance/tests/test_inheritance.py | 7 +++--
sqlobject/main.py | 8 ++---
sqlobject/manager/command.py | 33 ++++++++++------------
sqlobject/sqlite/sqliteconnection.py | 7 ++---
sqlobject/tests/test_declarative.py | 5 +--
sqlobject/util/csvimport.py | 2 +-
8 files changed, 32 insertions(+), 37 deletions(-)
hooks/post-receive
--
SQLObject development repository
|