Author: phd
Date: 2005-08-24 19:47:11 +0000 (Wed, 24 Aug 2005)
New Revision: 942
Modified:
trunk/SQLObject/docs/FAQ.txt
trunk/SQLObject/docs/News.txt
trunk/SQLObject/docs/TODO.txt
trunk/SQLObject/docs/default.css
trunk/SQLObject/docs/interface.py
trunk/SQLObject/scripts/sqlobject-admin
trunk/SQLObject/sqlobject/boundattributes.py
trunk/SQLObject/sqlobject/classregistry.py
trunk/SQLObject/sqlobject/col.py
trunk/SQLObject/sqlobject/index.py
trunk/SQLObject/sqlobject/main.py
trunk/SQLObject/sqlobject/manager/command.py
trunk/SQLObject/sqlobject/postgres/pgconnection.py
trunk/SQLObject/sqlobject/sresults.py
trunk/SQLObject/sqlobject/sybase/sybaseconnection.py
trunk/SQLObject/sqlobject/tests/test_NoneValuedResultItem.py
trunk/SQLObject/sqlobject/tests/test_auto.py
trunk/SQLObject/sqlobject/tests/test_auto_old.py
trunk/SQLObject/sqlobject/tests/test_basic.py
trunk/SQLObject/sqlobject/tests/test_boundattributes.py
trunk/SQLObject/sqlobject/tests/test_constraints.py
trunk/SQLObject/sqlobject/tests/test_create_drop.py
trunk/SQLObject/sqlobject/tests/test_delete.py
trunk/SQLObject/sqlobject/tests/test_joins_old.py
trunk/SQLObject/sqlobject/tests/test_select.py
trunk/SQLObject/sqlobject/tests/test_unicode.py
Log:
Removed trailing spaces.
Modified: trunk/SQLObject/docs/FAQ.txt
===================================================================
--- trunk/SQLObject/docs/FAQ.txt 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/docs/FAQ.txt 2005-08-24 19:47:11 UTC (rev 942)
@@ -15,7 +15,7 @@
contacts. Not all customers have a contact, some have several. The
left join would look like::
- SELECT customer.id, customer.first_name, customer.last_name,
+ SELECT customer.id, customer.first_name, customer.last_name,
contact.id, contact.address
FROM customer
LEFT JOIN contact ON contact.customer_id = customer.id
@@ -335,7 +335,7 @@
data = StringCol()
height = IntCol()
width = IntCol()
-
+
def _set_data(self, value):
self._SO_set_data(value.encode('base64'))
Modified: trunk/SQLObject/docs/News.txt
===================================================================
--- trunk/SQLObject/docs/News.txt 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/docs/News.txt 2005-08-24 19:47:11 UTC (rev 942)
@@ -86,7 +86,7 @@
rows (like class instantiation used to do).
* We're now using a Subversion repository instead of CVS. It is
- located at http://svn.colorstudy.com/trunk/SQLObject
+ located at http://svn.colorstudy.com/trunk/SQLObject
* If you pass ``forceDBName=True`` to the ``*Col`` constructors, then
your column name doesn't have to be restricted to a-z, 0-9, and _.
@@ -297,25 +297,25 @@
* MySQL uses ``localhost`` as the default host, and the empty string
as the default password.
-* Added functions for use with queries: `ISNULL`, `ISNOTNULL`. ``==``
- and ``!=`` can be used with None, and is translated into `ISNULL`,
+* Added functions for use with queries: `ISNULL`, `ISNOTNULL`. ``==``
+ and ``!=`` can be used with None, and is translated into `ISNULL`,
`ISNOTNULL`.
-* Classes can be part of a specific registry. Since classes are
+* Classes can be part of a specific registry. Since classes are
referred to by name in several places, the names have to be unique.
This can be problematic, so you can add a class variable `_registry`,
- the value of which should be a string. Classes references are
+ the value of which should be a string. Classes references are
assumed to be inside that registry, and class names need only be
unique among classes in that registry.
-* ``SomeClass.select()`` selects all, instead of using
+* ``SomeClass.select()`` selects all, instead of using
``SomeClass.select('all')``. You can also use None instead of
``'all'``.
* Trying to fetch non-existent objects raises `SQLObjectNotFound`,
which is a subclass of the builtin exception `LookupError`.
This may not be raised if `_cacheValues` is False and you use
- the ID to fetch an object (but alternateID fetches will raise
+ the ID to fetch an object (but alternateID fetches will raise
the exception in either case).
* Can order by descending order, with the `reversed` option to
@@ -328,7 +328,7 @@
~~~~~~~~~~~~
* `Join` constructors have an argument `orderBy`, which is the name
- of a Python attribute to sort results by. If not given, the
+ of a Python attribute to sort results by. If not given, the
appropriate class's `_defaultOrder` will be used. None implies
no sorting (and ``orderBy=None`` will override `_defaultOrder`).
@@ -369,7 +369,7 @@
* SomeClass.q.colName now does proper translation to database names,
using dbName, etc., instead of being entirely algorithm-driven.
-* Raise `TypeError` if you pass an unknown argument to the `new`
+* Raise `TypeError` if you pass an unknown argument to the `new`
method.
* You can override the _get_* or _set_* version of a property without
@@ -377,7 +377,7 @@
* Python 2.3 compatible.
-* Trying to use ``Col('id')`` or ``id = Col()`` will raise an
+* Trying to use ``Col('id')`` or ``id = Col()`` will raise an
exception, instead of just acting funky.
* ``ForeignKey`` columns return None if the associated column is
Modified: trunk/SQLObject/docs/TODO.txt
===================================================================
--- trunk/SQLObject/docs/TODO.txt 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/docs/TODO.txt 2005-08-24 19:47:11 UTC (rev 942)
@@ -8,7 +8,7 @@
the progress for Oracle, Sybase, and MS-SQL support.
* Better transaction support -- right now you can use transactions
for the database, but the object isn't transaction-aware, so
- non-database persistence won't be able to be rolled back.
+ non-database persistence won't be able to be rolled back.
* Optimistic locking and other techniques to handle concurrency.
* Profile of SQLObject performance, so that I can identify bottlenecks.
* Increase hooks with FormEncode (unreleased) validation and form
Modified: trunk/SQLObject/docs/default.css
===================================================================
--- trunk/SQLObject/docs/default.css 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/docs/default.css 2005-08-24 19:47:11 UTC (rev 942)
@@ -130,7 +130,7 @@
border: medium solid black;
}
-h1 a:link, h2 a:link {
+h1 a:link, h2 a:link {
color: #ffffff;
}
@@ -139,7 +139,7 @@
color: #000000;
}
-h3 a:link, h4 a:link, h5 a:link, h6 a:link {
+h3 a:link, h4 a:link, h5 a:link, h6 a:link {
color: #000000;
}
@@ -286,4 +286,4 @@
.stmlfunction {color: #000077; font-weight: bold}
.stmlattr {color: #000000;}
.stmlstring {color: #006600;}
-.stmlexpr {color: #004444;}
\ No newline at end of file
+.stmlexpr {color: #004444;}
Modified: trunk/SQLObject/docs/interface.py
===================================================================
--- trunk/SQLObject/docs/interface.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/docs/interface.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -66,7 +66,7 @@
Join tables (mapping tables for many-to-many joins) are
created if this class comes alphabetically before the other
join class, and if ``createJoinTables`` is true.
-
+
If ``createIndexes`` is true, indexes are also created.
"""
@@ -254,7 +254,7 @@
Adds the index to the class.
"""
-
+
class ICol(Interface):
def __init__(name=None, **kw):
@@ -307,7 +307,7 @@
"""
constraints = """
- A list of ... @@?
+ A list of ... @@?
"""
notNone = """
Modified: trunk/SQLObject/scripts/sqlobject-admin
===================================================================
--- trunk/SQLObject/scripts/sqlobject-admin 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/scripts/sqlobject-admin 2005-08-24 19:47:11 UTC (rev 942)
@@ -33,4 +33,3 @@
from sqlobject.manager import command
command.the_runner.run(sys.argv)
-
Modified: trunk/SQLObject/sqlobject/boundattributes.py
===================================================================
--- trunk/SQLObject/sqlobject/boundattributes.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/boundattributes.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -88,12 +88,12 @@
def set_object(cls, added_class, attr_name, obj):
setattr(added_class, attr_name, obj)
-
+
set_object = classmethod(set_object)
def make_object(cls, added_class, attr_name, *args, **attrs):
raise NotImplementedError
-
+
make_object = classmethod(make_object)
class BoundFactory(BoundAttribute):
Modified: trunk/SQLObject/sqlobject/classregistry.py
===================================================================
--- trunk/SQLObject/sqlobject/classregistry.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/classregistry.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -21,7 +21,7 @@
... pass
>>> registry.addClass(MyClass)
Class finally exists: MyClass
-
+
"""
class ClassRegistry(object):
@@ -33,7 +33,7 @@
with classes by name, and after each class is created we
try to fix up any references by replacing the names with
actual classes.
-
+
Here we keep a dictionaries of class names to classes -- note
that the classes might be spread among different modules, so
since we pile them together names need to be globally unique,
Modified: trunk/SQLObject/sqlobject/col.py
===================================================================
--- trunk/SQLObject/sqlobject/col.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/col.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -800,7 +800,7 @@
raise "Enum type is not supported"
class EnumValidator(validators.Validator):
-
+
def to_python(self, value, state):
if value in self.enumValues:
return value
Modified: trunk/SQLObject/sqlobject/index.py
===================================================================
--- trunk/SQLObject/sqlobject/index.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/index.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -95,7 +95,7 @@
return 'ALTER TABLE %s ADD %s %s (%s)' % \
(soClass.sqlmeta.table, uniqueOrIndex,
- self.name,
+ self.name,
', '.join(spec))
@@ -122,9 +122,9 @@
The class also take the keyword argument `unique`; if true then
a UNIQUE index is created.
"""
-
+
baseClass = SODatabaseIndex
-
+
def __init__(self, *columns, **kw):
kw['columns'] = columns
self.kw = kw
Modified: trunk/SQLObject/sqlobject/main.py
===================================================================
--- trunk/SQLObject/sqlobject/main.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/main.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -557,7 +557,7 @@
index = indexDef.withClass(cls.soClass)
cls.indexes.append(index)
addIndex = classmethod(addIndex)
-
+
sqlhub = dbconnection.ConnectionHub()
class _sqlmeta_attr(object):
@@ -604,9 +604,9 @@
1) Deprecated in current version (0.7). Will be removed in next
version (0.8)
-
+
2) Planned to deprecate in next version, remove later.
-
+
3) Planned to deprecate sometime, remove sometime much later ;)
As the SQLObject versions progress, the deprecation level of
Modified: trunk/SQLObject/sqlobject/manager/command.py
===================================================================
--- trunk/SQLObject/sqlobject/manager/command.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/manager/command.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -181,7 +181,7 @@
# This abstract base class
return
register(cls)
-
+
def __init__(self, invoked_as, command_name, args, runner):
self.invoked_as = invoked_as
self.command_name = command_name
@@ -419,8 +419,8 @@
if v >= 1:
print '%i tables created (%i already exist)' % (
created, existing)
-
+
class CommandDrop(Command):
name = 'drop'
@@ -526,8 +526,8 @@
if self.options.verbose:
print '%i in sync; %i out of sync; %i not in database' % (
good, bad, missing_tables)
-
+
class CommandHelp(Command):
name = 'help'
@@ -622,7 +622,7 @@
'database is currently at. Use the upgrade command to '
'sync databases with code.'
% SQLObjectVersionTable.sqlmeta.table)
-
+
parser = standard_parser()
parser.add_option('--output-dir',
help="Base directory for recorded definitions",
@@ -665,7 +665,7 @@
if self.options.force_db_version:
self.command_force_db_version()
return
-
+
v = self.options.verbose
sim = self.options.simulate
classes = self.classes()
@@ -801,7 +801,7 @@
def strip_comments(self, sql):
lines = [l for l in sql.splitlines()
if not l.strip().startswith('--')]
- return '\n'.join(lines)
+ return '\n'.join(lines)
def base_dir(self):
base = self.options.output_dir
@@ -812,7 +812,7 @@
def find_output_dir(self):
today = time.strftime('%Y-%m-%d', time.localtime())
if self.options.version_name:
- dir = os.path.join(self.base_dir(), today + '-' +
+ dir = os.path.join(self.base_dir(), today + '-' +
self.options.version_name)
if os.path.exists(dir):
print ("Error, directory already exists: %s"
@@ -828,7 +828,7 @@
extra = 'a'
else:
extra = chr(ord(extra)+1)
-
+
def find_last_version(self):
names = []
for fn in os.listdir(self.base_dir()):
@@ -921,7 +921,6 @@
raise
self.update_db(next_version, conn)
print 'Done.'
-
def current_version(self):
conn = self.connection()
@@ -982,8 +981,8 @@
print 'No upgraders found in %s' % current_dir
return None, None
upgraders.sort()
- return upgraders[-1]
-
+ return upgraders[-1]
+
def update_sys_path(paths, verbose):
if isinstance(paths, (str, unicode)):
paths = [paths]
Modified: trunk/SQLObject/sqlobject/postgres/pgconnection.py
===================================================================
--- trunk/SQLObject/sqlobject/postgres/pgconnection.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/postgres/pgconnection.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -179,7 +179,7 @@
keyData = self.queryAll(keyQuery % self.sqlrepr(tableName))
keyRE = re.compile(r"\((.+)\) REFERENCES (.+)\(")
keymap = {}
-
+
for (condef,) in keyData:
match = keyRE.search(condef)
if match:
Modified: trunk/SQLObject/sqlobject/sresults.py
===================================================================
--- trunk/SQLObject/sqlobject/sresults.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/sresults.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -157,7 +157,7 @@
def count(self):
""" Counting elements of current select results """
- assert not (self.ops.get('distinct') and (self.ops.get('start')
+ assert not (self.ops.get('distinct') and (self.ops.get('start')
or self.ops.get('end'))), \
"distinct-counting of sliced objects is not supported"
if self.ops.get('distinct'):
Modified: trunk/SQLObject/sqlobject/sybase/sybaseconnection.py
===================================================================
--- trunk/SQLObject/sqlobject/sybase/sybaseconnection.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/sybase/sybaseconnection.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -52,7 +52,6 @@
database=self.db, auto_commit=self.autoCommit,
locking=self.locking)
-
HAS_IDENTITY = """
SELECT col.name, col.status, obj.name
FROM syscolumns col
@@ -60,7 +59,6 @@
ON obj.id = col.id
WHERE obj.name = '%s'
AND (col.status & 0x80) = 0x80
-
"""
def _hasIdentity(self, conn, table):
query = self.HAS_IDENTITY % table
@@ -68,7 +66,7 @@
c.execute(query)
r = c.fetchone()
return r is not None
-
+
def _queryInsertID(self, conn, soInstance, id, names, values):
table = soInstance.sqlmeta.table
idName = soInstance.sqlmeta.idName
Modified: trunk/SQLObject/sqlobject/tests/test_NoneValuedResultItem.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_NoneValuedResultItem.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_NoneValuedResultItem.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -1,4 +1,4 @@
-'''Test that selectResults handle NULL values
+'''Test that selectResults handle NULL values
from, for example, outer joins.'''
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -23,6 +23,6 @@
# but don't add any works for Bruckner
# do a left join, a common use case that often involves NULL results
- s = TestWork.select(join=sqlbuilder.LEFTJOINOn(TestComposer, TestWork,
- TestComposer.q.id==TestWork.q.composerID))
+ s = TestWork.select(join=sqlbuilder.LEFTJOINOn(TestComposer, TestWork,
+ TestComposer.q.id==TestWork.q.composerID))
assert tuple(s)==(w, None)
Modified: trunk/SQLObject/sqlobject/tests/test_auto.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_auto.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_auto.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -6,7 +6,7 @@
now = datetime.now
except ImportError:
from mx.DateTime import now
-
+
########################################
## Dynamic column tests
########################################
Modified: trunk/SQLObject/sqlobject/tests/test_auto_old.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_auto_old.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_auto_old.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -6,7 +6,7 @@
now = datetime.now
except ImportError:
from mx.DateTime import now
-
+
deprecated_module()
########################################
Modified: trunk/SQLObject/sqlobject/tests/test_basic.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_basic.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_basic.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -146,7 +146,7 @@
def test_foreignKeyDestroySelfCascade():
setupClass([TestSO7, TestSO6, TestSO5])
-
+
tc5 = TestSO5(name='a')
tc6a = TestSO6(name='1')
tc5.other = tc6a
@@ -275,4 +275,3 @@
assert dep1.other is None
assert dep2.other is None
assert dep3.other is obj2
-
Modified: trunk/SQLObject/sqlobject/tests/test_boundattributes.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_boundattributes.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_boundattributes.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -54,4 +54,3 @@
assert A1.v.attrs == {'arg1': 'nothing', 'arg2': ['something']}
assert A1.inline is v3
assert A1.inline.attrs == {'arg3': 'again', 'arg4': 'so there'}
-
Modified: trunk/SQLObject/sqlobject/tests/test_constraints.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_constraints.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_constraints.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -9,7 +9,7 @@
# @@: Should this really be an error?
raises(BadValue, isString, obj, col, u'test!')
#isString(obj, col, u'test!')
-
+
raises(BadValue, notNull, obj, col, None)
raises(BadValue, isInt, obj, col, 1.1)
isInt(obj, col, 1)
@@ -31,4 +31,3 @@
maxlen(obj, col, '12')
maxlen(obj, col, (1,))
raises(BadValue, maxlen, obj, col, 1)
-
Modified: trunk/SQLObject/sqlobject/tests/test_create_drop.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_create_drop.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_create_drop.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -11,7 +11,6 @@
short = StringCol(length=10)
blobcol = BLOBCol()
-
def test_create_drop():
conn = getConnection()
TestCreateDrop.setConnection(conn)
@@ -25,5 +24,3 @@
assert not conn.tableExists(TestCreateDrop.sqlmeta.table)
TestCreateDrop.dropTable(ifExists=True)
assert not conn.tableExists(TestCreateDrop.sqlmeta.table)
-
-
Modified: trunk/SQLObject/sqlobject/tests/test_delete.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_delete.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_delete.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -26,4 +26,3 @@
value = NoCache(name='test')
value.destroySelf()
NoCache._connection.cache = old
-
Modified: trunk/SQLObject/sqlobject/tests/test_joins_old.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_joins_old.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_joins_old.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -1,6 +1,6 @@
from sqlobject import *
from sqlobject.tests.dbtest import *
-
+
deprecated_module()
########################################
Modified: trunk/SQLObject/sqlobject/tests/test_select.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_select.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_select.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -54,7 +54,6 @@
test = all[i]
count += 1
assert count == len(names)
-
def test_04_indexed_ended_by_exception():
all = IterTest.select()
Modified: trunk/SQLObject/sqlobject/tests/test_unicode.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_unicode.py 2005-08-24 19:18:48 UTC (rev 941)
+++ trunk/SQLObject/sqlobject/tests/test_unicode.py 2005-08-24 19:47:11 UTC (rev 942)
@@ -19,7 +19,7 @@
def test_create():
setupClass(Unicode1)
data = [u'\u00f0', u'test', 'ascii test']
-
+
items = []
for i, n in enumerate(data):
items.append(Unicode1(count=i, col1=n, col2=n))
|