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 e2045eab8a1620ea3896b46a0011f7a1b81a7d96 (commit)
from 8645913850e76d4ce31774ad0f871fd1a1e169e9 (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/e2045eab8a1620ea3896b46a0011f7a1b81a7d96
commit e2045eab8a1620ea3896b46a0011f7a1b81a7d96
Author: Oleg Broytman <ph...@ph...>
Date: Mon Feb 9 21:36:01 2015 +0300
Fix #33 flake8 F402 import 'name' shadowed by loop variable
diff --git a/setup.cfg b/setup.cfg
index 4bae483..8ccf93b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -15,13 +15,12 @@ exclude = .git,docs/europython/*.py,ez_setup.py
; E124 closing bracket does not match visual indentation
; E226 missing whitespace around arithmetic operator
; E401 multiple imports on one line
-; 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
; F822 undefined name in __all__
; W391 blank line at end of file
; W603 '<>' is deprecated, use '!='
-ignore = E123,E124,E226,E401,F402,F403,F812,F822,W391,W603
+ignore = E123,E124,E226,E401,F403,F812,F822,W391,W603
[pudge]
theme = pythonpaste.org
diff --git a/sqlobject/main.py b/sqlobject/main.py
index f09aff0..4aa2f71 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -151,9 +151,9 @@ def findDependencies(name, registry=None):
def findDependantColumns(name, klass):
depends = []
- for col in klass.sqlmeta.columnList:
- if col.foreignKey == name and col.cascade is not None:
- depends.append(col)
+ for _col in klass.sqlmeta.columnList:
+ if _col.foreignKey == name and _col.cascade is not None:
+ depends.append(_col)
return depends
@@ -1221,10 +1221,10 @@ class SQLObject(object):
func(self)
def _SO_selectInit(self, row):
- for col, colValue in zip(self.sqlmeta.columnList, row):
- if col.to_python:
- colValue = col.to_python(colValue, self._SO_validatorState)
- setattr(self, instanceName(col.name), colValue)
+ for _col, colValue in zip(self.sqlmeta.columnList, row):
+ if _col.to_python:
+ colValue = _col.to_python(colValue, self._SO_validatorState)
+ setattr(self, instanceName(_col.name), colValue)
def _SO_getValue(self, name):
# Retrieves a single value from the database. Simple.
@@ -1550,19 +1550,19 @@ class SQLObject(object):
@classmethod
def createIndexes(cls, ifNotExists=False, connection=None):
conn = connection or cls._connection
- for index in cls.sqlmeta.indexes:
- if not index:
+ for _index in cls.sqlmeta.indexes:
+ if not _index:
continue
- conn._SO_createIndex(cls, index)
+ conn._SO_createIndex(cls, _index)
@classmethod
def createIndexesSQL(cls, connection=None):
conn = connection or cls._connection
sql = []
- for index in cls.sqlmeta.indexes:
- if not index:
+ for _index in cls.sqlmeta.indexes:
+ if not _index:
continue
- sql.append(conn.createIndexSQL(cls, index))
+ sql.append(conn.createIndexSQL(cls, _index))
return ';\n'.join(sql)
@classmethod
@@ -1639,14 +1639,14 @@ class SQLObject(object):
query = []
delete = setnull = restrict = False
- for col in cols:
- if col.cascade == False:
+ for _col in cols:
+ if _col.cascade == False:
# Found a restriction
restrict = True
- query.append(getattr(k.q, col.name) == self.id)
- if col.cascade == 'null':
- setnull = col.name
- elif col.cascade:
+ query.append(getattr(k.q, _col.name) == self.id)
+ if _col.cascade == 'null':
+ setnull = _col.name
+ elif _col.cascade:
delete = True
assert delete or setnull or restrict, (
"Class %s depends on %s accoriding to "
@@ -1724,12 +1724,12 @@ class SQLObject(object):
def _reprItems(self):
items = []
- for col in self.sqlmeta.columnList:
- value = getattr(self, col.name)
+ for _col in self.sqlmeta.columnList:
+ value = getattr(self, _col.name)
r = repr(value)
if len(r) > 20:
value = r[:17] + "..." + r[-1]
- items.append((col.name, value))
+ items.append((_col.name, value))
return items
@classmethod
diff --git a/sqlobject/manager/command.py b/sqlobject/manager/command.py
index 9cc1af6..badf41d 100755
--- a/sqlobject/manager/command.py
+++ b/sqlobject/manager/command.py
@@ -64,20 +64,19 @@ def db_differences(soClass, conn):
pass
else:
existing = {}
- for col in columns:
- col = col.withClass(soClass)
- existing[col.dbName] = col
+ for _col in columns:
+ _col = _col.withClass(soClass)
+ existing[_col.dbName] = _col
missing = {}
- for col in soClass.sqlmeta.columnList:
- if col.dbName in existing:
- del existing[col.dbName]
+ for _col in soClass.sqlmeta.columnList:
+ if _col.dbName in existing:
+ del existing[_col.dbName]
else:
- missing[col.dbName] = col
- for col in existing.values():
- diffs.append('Database has extra column: %s'
- % col.dbName)
- for col in missing.values():
- diffs.append('Database missing column: %s' % col.dbName)
+ missing[_col.dbName] = _col
+ for _col in existing.values():
+ diffs.append('Database has extra column: %s' % _col.dbName)
+ for _col in missing.values():
+ diffs.append('Database missing column: %s' % _col.dbName)
return diffs
@@ -215,10 +214,10 @@ class Command(object):
"depends on" here mean "has a foreign key pointing to".
"""
depended = []
- for col in cls.sqlmeta.columnList:
- if col.foreignKey:
- other = findClass(col.foreignKey,
- col.soClass.sqlmeta.registry)
+ for _col in cls.sqlmeta.columnList:
+ if _col.foreignKey:
+ other = findClass(_col.foreignKey,
+ _col.soClass.sqlmeta.registry)
if (other is not cls) and (other not in depended):
depended.append(other)
return depended
@@ -783,23 +782,23 @@ class CommandStatus(Command):
soClass.sqlmeta.table, e))
continue
existing = {}
- for col in columns:
- col = col.withClass(soClass)
- existing[col.dbName] = col
+ for _col in columns:
+ _col = _col.withClass(soClass)
+ existing[_col.dbName] = _col
missing = {}
- for col in soClass.sqlmeta.columnList:
- if col.dbName in existing:
- del existing[col.dbName]
+ for _col in soClass.sqlmeta.columnList:
+ if _col.dbName in existing:
+ del existing[_col.dbName]
else:
- missing[col.dbName] = col
+ missing[_col.dbName] = _col
if existing:
self.print_class(soClass)
- for col in existing.values():
- print(' Database has extra column: %s' % col.dbName)
+ for _col in existing.values():
+ print(' Database has extra column: %s' % _col.dbName)
if missing:
self.print_class(soClass)
- for col in missing.values():
- print(' Database missing column: %s' % col.dbName)
+ for _col in missing.values():
+ print(' Database missing column: %s' % _col.dbName)
if existing or missing:
bad += 1
else:
@@ -891,8 +890,8 @@ class CommandExecute(Command):
sys.stdout.write("%s\t" % name)
sys.stdout.write("\n")
for row in rows:
- for col in row:
- sys.stdout.write("%r\t" % col)
+ for _col in row:
+ sys.stdout.write("%r\t" % _col)
sys.stdout.write("\n")
print()
diff --git a/sqlobject/maxdb/maxdbconnection.py b/sqlobject/maxdb/maxdbconnection.py
index b388b1c..c46c3ea 100644
--- a/sqlobject/maxdb/maxdbconnection.py
+++ b/sqlobject/maxdb/maxdbconnection.py
@@ -251,8 +251,8 @@ class MaxdbConnection(DBAPI):
keymap = {}
pkmap = {}
fkData = self.queryAll(self.GET_PK_AND_FK % tableName)
- for col, cons_type, refcol, reftable in fkData:
- col_name = col.lower()
+ for _col, cons_type, refcol, reftable in fkData:
+ col_name = _col.lower()
pkmap[col_name] = False
if cons_type == 'R':
keymap[col_name] = reftable.lower()
-----------------------------------------------------------------------
Summary of changes:
setup.cfg | 3 +-
sqlobject/main.py | 44 ++++++++++++++--------------
sqlobject/manager/command.py | 57 +++++++++++++++++------------------
sqlobject/maxdb/maxdbconnection.py | 4 +-
4 files changed, 53 insertions(+), 55 deletions(-)
hooks/post-receive
--
SQLObject development repository
|