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 f89bd3cd9d20ac07d36c966b396a7ca1c8025cff (commit)
via 92c9ee59fc92b747004a4cbd1be568430249faaa (commit)
from 2f5512c24a7aa83ccff9c43ff890d1ee16d1bf11 (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/f89bd3cd9d20ac07d36c966b396a7ca1c8025cff
commit f89bd3cd9d20ac07d36c966b396a7ca1c8025cff
Author: Oleg Broytman <ph...@ph...>
Date: Sat Feb 14 23:59:01 2015 +0300
Fix flake8 E226 missing whitespace around arithmetic operator
diff --git a/sqlobject/col.py b/sqlobject/col.py
index d974f41..3cdf9a1 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1187,7 +1187,7 @@ class DateTimeValidator(validators.DateValidator):
microseconds = _value[-1]
_l = len(microseconds)
if _l < 6:
- _value[-1] = microseconds + '0'*(6 - _l)
+ _value[-1] = microseconds + '0' * (6 - _l)
elif _l > 6:
_value[-1] = microseconds[:6]
if _l != 6:
@@ -1238,7 +1238,7 @@ if mxdatetime_available:
microseconds = _value[-1]
_l = len(microseconds)
if _l < 6:
- _value[-1] = microseconds + '0'*(6 - _l)
+ _value[-1] = microseconds + '0' * (6 - _l)
elif _l > 6:
_value[-1] = microseconds[:6]
if _l != 6:
@@ -1704,11 +1704,11 @@ class SOBLOBCol(SOStringCol):
def _mysqlType(self):
length = self.length
varchar = self.varchar
- if length >= 2**24:
+ if length >= 2 ** 24:
return varchar and "LONGTEXT" or "LONGBLOB"
- if length >= 2**16:
+ if length >= 2 ** 16:
return varchar and "MEDIUMTEXT" or "MEDIUMBLOB"
- if length >= 2**8:
+ if length >= 2 ** 8:
return varchar and "TEXT" or "BLOB"
return varchar and "TINYTEXT" or "TINYBLOB"
@@ -1768,9 +1768,9 @@ class SOPickleCol(SOBLOBCol):
def _mysqlType(self):
length = self.length
- if length >= 2**24:
+ if length >= 2 ** 24:
return "LONGBLOB"
- if length >= 2**16:
+ if length >= 2 ** 16:
return "MEDIUMBLOB"
return "BLOB"
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 4dc9c8f..54b9ac2 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -415,10 +415,10 @@ class DBAPI(DBConnection):
sep = '->'
s = repr(s)
n = self._connectionNumbers[id(conn)]
- spaces = ' '*(8-len(name))
+ spaces = ' ' * (8 - len(name))
if self.debugThreading:
threadName = threading.currentThread().getName()
- threadName = (':' + threadName + ' '*(8-len(threadName)))
+ threadName = (':' + threadName + ' ' * (8 - len(threadName)))
else:
threadName = ''
msg = '%(n)2i%(threadName)s/%(name)s%(spaces)s%(sep)s %(s)s' % locals()
diff --git a/sqlobject/events.py b/sqlobject/events.py
index 1b2b5f5..6f66cb9 100644
--- a/sqlobject/events.py
+++ b/sqlobject/events.py
@@ -236,7 +236,7 @@ def summarize_events_by_sender(sender=None, output=None, indent=0):
print(leader + header, file=output)
print(leader + ('=' * len(header)), file=output)
summarize_events_by_sender(real_sender, output=output,
- indent=indent+2)
+ indent=indent + 2)
else:
for signal, receivers in \
sorted_items(dispatcher.connections.get(id(sender), [])):
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index 284330c..7b74d3d 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -127,7 +127,7 @@ class FirebirdConnection(DBAPI):
if not end:
limit_str = "SELECT SKIP %i" % start
else:
- limit_str = "SELECT FIRST %i SKIP %i" % (end-start, start)
+ limit_str = "SELECT FIRST %i SKIP %i" % (end - start, start)
match = cls.limit_re.match(query)
if match and len(match.groups()) == 2:
diff --git a/sqlobject/index.py b/sqlobject/index.py
index c1ec148..ca0fd50 100644
--- a/sqlobject/index.py
+++ b/sqlobject/index.py
@@ -34,7 +34,7 @@ class SODatabaseIndex(object):
raise TypeError(
"get() takes exactly %d argument and an optional "
"named argument 'connection' (%d given)" % (
- len(columns), len(args)+len(kw)))
+ len(columns), len(args) + len(kw)))
if args:
kw = {}
for i in range(len(args)):
diff --git a/sqlobject/inheritance/iteration.py b/sqlobject/inheritance/iteration.py
index 25f97a9..fd7b78f 100644
--- a/sqlobject/inheritance/iteration.py
+++ b/sqlobject/inheritance/iteration.py
@@ -60,7 +60,7 @@ class InheritableIteration(Iteration):
childIdsNames = {}
childNameIdx = self._childNameIdx
for result in self._results:
- childName = result[childNameIdx+1]
+ childName = result[childNameIdx + 1]
if childName:
ids = childIdsNames.get(childName)
if ids is None:
diff --git a/sqlobject/main.py b/sqlobject/main.py
index 5812b29..7d56464 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -489,8 +489,8 @@ class sqlmeta(object):
if isinstance(column, str):
if column in sqlmeta.columns:
column = sqlmeta.columns[column]
- elif column+'ID' in sqlmeta.columns:
- column = sqlmeta.columns[column+'ID']
+ elif column + 'ID' in sqlmeta.columns:
+ column = sqlmeta.columns[column + 'ID']
else:
raise ValueError('Unknown column ' + column)
if isinstance(column, col.Col):
@@ -554,7 +554,7 @@ class sqlmeta(object):
meth = join.joinMethodName
sqlmeta.joins.append(join)
- index = len(sqlmeta.joins)-1
+ index = len(sqlmeta.joins) - 1
if joinDef not in sqlmeta.joinDefinitions:
sqlmeta.joinDefinitions.append(joinDef)
diff --git a/sqlobject/manager/command.py b/sqlobject/manager/command.py
index 214c72d..7e20839 100755
--- a/sqlobject/manager/command.py
+++ b/sqlobject/manager/command.py
@@ -286,7 +286,7 @@ class Command(object):
self.parser.usage = "%%prog [options]\n%s" % self.summary
if self.help:
help = textwrap.fill(
- self.help, int(os.environ.get('COLUMNS', 80))-4)
+ self.help, int(os.environ.get('COLUMNS', 80)) - 4)
self.parser.usage += '\n' + help
self.parser.prog = '%s %s' % (
os.path.basename(self.invoked_as),
@@ -561,7 +561,7 @@ class Command(object):
directory (if it can). For display purposes.
"""
if fn.startswith(os.getcwd() + '/'):
- fn = fn[len(os.getcwd())+1:]
+ fn = fn[len(os.getcwd()) + 1:]
return fn
def open_editor(self, pretext, breaker=None, extension='.txt'):
@@ -830,11 +830,11 @@ class CommandHelp(Command):
max_len = max([len(cn) for cn, c in items])
for command_name, command in items:
print('%s:%s %s' % (command_name,
- ' '*(max_len-len(command_name)),
+ ' ' * (max_len - len(command_name)),
command.summary))
if command.aliases:
print('%s (Aliases: %s)' % (
- ' '*max_len, ', '.join(command.aliases)))
+ ' ' * max_len, ', '.join(command.aliases)))
class CommandExecute(Command):
@@ -1059,8 +1059,8 @@ class CommandRecord(Command):
print("Cannot edit upgrader because there is no "
"previous version")
else:
- breaker = ('-'*20 + ' lines below this will be ignored '
- + '-'*20)
+ breaker = ('-' * 20 + ' lines below this will be ignored '
+ + '-' * 20)
pre_text = breaker + '\n' + '\n'.join(all_diffs)
text = self.open_editor('\n\n' + pre_text, breaker=breaker,
extension='.sql')
@@ -1124,7 +1124,7 @@ class CommandRecord(Command):
if not extra:
extra = 'a'
else:
- extra = chr(ord(extra)+1)
+ extra = chr(ord(extra) + 1)
def find_last_version(self):
names = []
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index ea83c56..e09f1ad 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -180,7 +180,7 @@ class MySQLConnection(DBAPI):
return "%s LIMIT %i" % (query, end)
if not end:
return "%s LIMIT %i, -1" % (query, start)
- return "%s LIMIT %i, %i" % (query, start, end-start)
+ return "%s LIMIT %i, %i" % (query, start, end - start)
def createReferenceConstraint(self, soClass, col):
return col.mysqlCreateReferenceConstraint()
@@ -292,21 +292,21 @@ class MySQLConnection(DBAPI):
elif t.startswith('bool'):
return col.BoolCol, {}
elif t.startswith('tinyblob'):
- return col.BLOBCol, {"length": 2**8-1}
+ return col.BLOBCol, {"length": 2 ** 8 - 1}
elif t.startswith('tinytext'):
- return col.StringCol, {"length": 2**8-1, "varchar": True}
+ return col.StringCol, {"length": 2 ** 8 - 1, "varchar": True}
elif t.startswith('blob'):
- return col.BLOBCol, {"length": 2**16-1}
+ return col.BLOBCol, {"length": 2 ** 16 - 1}
elif t.startswith('text'):
- return col.StringCol, {"length": 2**16-1, "varchar": True}
+ return col.StringCol, {"length": 2 ** 16 - 1, "varchar": True}
elif t.startswith('mediumblob'):
- return col.BLOBCol, {"length": 2**24-1}
+ return col.BLOBCol, {"length": 2 ** 24 - 1}
elif t.startswith('mediumtext'):
- return col.StringCol, {"length": 2**24-1, "varchar": True}
+ return col.StringCol, {"length": 2 ** 24 - 1, "varchar": True}
elif t.startswith('longblob'):
- return col.BLOBCol, {"length": 2**32}
+ return col.BLOBCol, {"length": 2 ** 32}
elif t.startswith('longtext'):
- return col.StringCol, {"length": 2**32, "varchar": True}
+ return col.StringCol, {"length": 2 ** 32, "varchar": True}
else:
return col.Col, {}
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index d7fe8cb..c4f414d 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -224,7 +224,7 @@ class PostgresConnection(DBAPI):
return "%s LIMIT %i" % (query, end)
if not end:
return "%s OFFSET %i" % (query, start)
- return "%s LIMIT %i OFFSET %i" % (query, end-start, start)
+ return "%s LIMIT %i OFFSET %i" % (query, end - start, start)
def createColumn(self, soClass, col):
return col.postgresCreateSQL()
@@ -379,11 +379,11 @@ class PostgresConnection(DBAPI):
return col.IntCol, {}
elif t.count('varying') or t.count('varchar'):
if '(' in t:
- return col.StringCol, {'length': int(t[t.index('(')+1:-1])}
+ return col.StringCol, {'length': int(t[t.index('(') + 1:-1])}
else: # varchar without length in Postgres means any length
return col.StringCol, {}
elif t.startswith('character('):
- return col.StringCol, {'length': int(t[t.index('(')+1:-1]),
+ return col.StringCol, {'length': int(t[t.index('(') + 1:-1]),
'varchar': False}
elif t.count('float') or t.count('real') or t.count('double'):
return col.FloatCol, {}
diff --git a/sqlobject/sqlbuilder.py b/sqlobject/sqlbuilder.py
index 44b33ab..aaec8bd 100644
--- a/sqlobject/sqlbuilder.py
+++ b/sqlobject/sqlbuilder.py
@@ -493,7 +493,7 @@ class SQLObjectTable(Table):
elif attr in self.soClass.sqlmeta.columns:
column = self.soClass.sqlmeta.columns[attr]
return self._getattrFromColumn(column, attr)
- elif attr+'ID' in \
+ elif attr + 'ID' in \
[k for (k, v) in self.soClass.sqlmeta.columns.items()
if v.foreignKey]:
attr += 'ID'
@@ -516,10 +516,10 @@ class SQLObjectTable(Table):
class SQLObjectTableWithJoins(SQLObjectTable):
def __getattr__(self, attr):
- if attr+'ID' in \
+ if attr + 'ID' in \
[k for (k, v) in self.soClass.sqlmeta.columns.items()
if v.foreignKey]:
- column = self.soClass.sqlmeta.columns[attr+'ID']
+ column = self.soClass.sqlmeta.columns[attr + 'ID']
return self._getattrFromForeignKey(column, attr)
elif attr in [x.joinMethodName for x in self.soClass.sqlmeta.joins]:
join = [x for x in self.soClass.sqlmeta.joins
@@ -530,7 +530,7 @@ class SQLObjectTableWithJoins(SQLObjectTable):
def _getattrFromForeignKey(self, column, attr):
ret = getattr(self, column.name) == \
- getattr(self.soClass, '_SO_class_'+column.foreignKey).q.id
+ getattr(self.soClass, '_SO_class_' + column.foreignKey).q.id
return ret
def _getattrFromJoin(self, join, attr):
@@ -1082,8 +1082,8 @@ def _quote_like_special(s, db):
else:
escape = '\\'
s = s.replace('\\', r'\\').\
- replace('%', escape+'%').\
- replace('_', escape+'_')
+ replace('%', escape + '%').\
+ replace('_', escape + '_')
return s
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 78d200e..f245fa2 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -277,7 +277,7 @@ class SQLiteConnection(DBAPI):
return "%s LIMIT %i" % (query, end)
if not end:
return "%s LIMIT 0 OFFSET %i" % (query, start)
- return "%s LIMIT %i OFFSET %i" % (query, end-start, start)
+ return "%s LIMIT %i OFFSET %i" % (query, end - start, start)
def createColumn(self, soClass, col):
return col.sqliteCreateSQL()
@@ -370,7 +370,7 @@ class SQLiteConnection(DBAPI):
end = colData.find(')', start)
if end == -1:
break
- colData = colData[:start] + colData[end+1:]
+ colData = colData[:start] + colData[end + 1:]
results = []
for colDesc in colData.split(','):
parts = colDesc.strip().split(' ', 2)
@@ -407,9 +407,9 @@ class SQLiteConnection(DBAPI):
if t.find('INT') >= 0:
return col.IntCol, {}
elif t.find('TEXT') >= 0 or t.find('CHAR') >= 0 or t.find('CLOB') >= 0:
- return col.StringCol, {'length': 2**32-1}
+ return col.StringCol, {'length': 2 ** 32 - 1}
elif t.find('BLOB') >= 0:
- return col.BLOBCol, {"length": 2**32-1}
+ return col.BLOBCol, {"length": 2 ** 32 - 1}
elif t.find('REAL') >= 0 or t.find('FLOAT') >= 0:
return col.FloatCol, {}
elif t.find('DECIMAL') >= 0:
diff --git a/sqlobject/sresults.py b/sqlobject/sresults.py
index ce02f93..ae8e46c 100644
--- a/sqlobject/sresults.py
+++ b/sqlobject/sresults.py
@@ -179,7 +179,7 @@ class SelectResults(object):
return list(iter(self))[value]
else:
start = self.ops.get('start', 0) + value
- return list(self.clone(start=start, end=start+1))[0]
+ return list(self.clone(start=start, end=start + 1))[0]
def __iter__(self):
# @@: This could be optimized, using a simpler algorithm
@@ -312,7 +312,7 @@ class SelectResults(object):
orderBy = sqlbuilder.NoDefault
ref = self.sourceClass.sqlmeta.columns.get(
- attr.endswith('ID') and attr or attr+'ID', None)
+ attr.endswith('ID') and attr or attr + 'ID', None)
if ref and ref.foreignKey:
otherClass, clause = self._throughToFK(ref)
else:
@@ -337,7 +337,7 @@ class SelectResults(object):
connection=self._getConnection())
def _throughToFK(self, col):
- otherClass = getattr(self.sourceClass, "_SO_class_"+col.foreignKey)
+ otherClass = getattr(self.sourceClass, "_SO_class_" + col.foreignKey)
colName = col.name
query = self.queryForSelect().newItems([
sqlbuilder.ColumnAS(getattr(self.sourceClass.q, colName), colName)
diff --git a/sqlobject/tests/test_aggregates.py b/sqlobject/tests/test_aggregates.py
index 925ea1d..d940aa6 100644
--- a/sqlobject/tests/test_aggregates.py
+++ b/sqlobject/tests/test_aggregates.py
@@ -31,7 +31,7 @@ def test_integer():
def floatcmp(f1, f2):
- if abs(f1-f2) < 0.1:
+ if abs(f1 - f2) < 0.1:
return 0
if f1 < f2:
return 1
diff --git a/sqlobject/tests/test_auto.py b/sqlobject/tests/test_auto.py
index 9d6ff63..3b9c8ac 100644
--- a/sqlobject/tests/test_auto.py
+++ b/sqlobject/tests/test_auto.py
@@ -202,17 +202,17 @@ class TestAuto:
age=10,
created=now(),
wannahavefun=False,
- longField='x'*1000)
+ longField='x' * 1000)
jane = AutoTest(firstName='jane',
lastName='doe',
happy='N',
created=now(),
wannahavefun=True,
- longField='x'*1000)
+ longField='x' * 1000)
assert not john.wannahavefun
assert jane.wannahavefun
- assert john.longField == 'x'*1000
- assert jane.longField == 'x'*1000
+ assert john.longField == 'x' * 1000
+ assert jane.longField == 'x' * 1000
del classregistry.registry(
AutoTest.sqlmeta.registry).classes['AutoTest']
diff --git a/sqlobject/tests/test_converters.py b/sqlobject/tests/test_converters.py
index 0146d70..ba6011c 100644
--- a/sqlobject/tests/test_converters.py
+++ b/sqlobject/tests/test_converters.py
@@ -243,7 +243,7 @@ def test_sets():
def test_timedelta():
- assert sqlrepr(timedelta(seconds=30*60)) == \
+ assert sqlrepr(timedelta(seconds=30 * 60)) == \
"INTERVAL '0 days 1800 seconds'"
diff --git a/sqlobject/tests/test_distinct.py b/sqlobject/tests/test_distinct.py
index 31d09be..aeeefd8 100644
--- a/sqlobject/tests/test_distinct.py
+++ b/sqlobject/tests/test_distinct.py
@@ -18,7 +18,7 @@ class Distinct2(SQLObject):
def count(select):
result = {}
for ob in select:
- result[int(ob.n)] = result.get(int(ob.n), 0)+1
+ result[int(ob.n)] = result.get(int(ob.n), 0) + 1
return result
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index f47d9fe..74a04ba 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -67,7 +67,7 @@ def test_04_indexed_ended_by_exception():
try:
while 1:
all[count]
- count = count+1
+ count = count + 1
# Stop the test if it's gone on too long
if count > len(names):
break
diff --git a/sqlobject/tests/test_sqlbuilder_importproxy.py b/sqlobject/tests/test_sqlbuilder_importproxy.py
index 4ce4497..4a9bcff 100644
--- a/sqlobject/tests/test_sqlbuilder_importproxy.py
+++ b/sqlobject/tests/test_sqlbuilder_importproxy.py
@@ -19,7 +19,7 @@ def testSimple():
def testAddition():
nyi = ImportProxy('NotYetImported2')
- x = nyi.q.name+nyi.q.name
+ x = nyi.q.name + nyi.q.name
class NotYetImported2(SQLObject):
name = StringCol(dbName='a_name')
diff --git a/sqlobject/tests/test_style.py b/sqlobject/tests/test_style.py
index aa2d86e..804e213 100644
--- a/sqlobject/tests/test_style.py
+++ b/sqlobject/tests/test_style.py
@@ -6,7 +6,7 @@ from sqlobject import styles
class AnotherStyle(styles.MixedCaseUnderscoreStyle):
def pythonAttrToDBColumn(self, attr):
if attr.lower().endswith('id'):
- return 'id'+styles.MixedCaseUnderscoreStyle.\
+ return 'id' + styles.MixedCaseUnderscoreStyle.\
pythonAttrToDBColumn(self, attr[:-2])
else:
return styles.MixedCaseUnderscoreStyle.\
... 134 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|