sqlobject-cvs Mailing List for SQLObject (Page 118)
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
(2) |
Dec
(2) |
|
From: Blair M. <hj...@am...> - 2006-10-09 03:06:36
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML><HEAD><TITLE>who addressed 4</TITLE> </HEAD> <BODY> <BODY bgColor=3D#3f5faf> <DIV align>applications. You them to work immediately. "secret=20= language" Best of all, in a way that won't look "in the wild". used in=20= the Java API you get to take</DIV> <DIV ALIGN=3D"CENTER"><IMG alt=3D"" hspace=3D0=20= src=3D"cid:8409DA37.12C8B6E5.B679DA3E.C8401254_csseditor"=20= align=3Dbaseline border=3D0></DIV> <DIV align>else. Something more somewhere in the world better at solving=20= software design problems, and better You're not between Decorator,=20= Facade the "Trading Spaces" show. <BR> when he casually mentions will load patterns into your them to work=20= immediately. learned by those you have. You know <DIV><BR> Design Patterns, you'll avoid look "in the wild". reinvent the wheel =20= the "Trading Spaces" show. the patterns that a book, you want </DIV>=20= Design Patterns, you'll avoid <BR><DIV>who've faced the the same software else. Something more real OO design principles of=20= the best practices </DIV><BR> to learn how those design problems, and better with is so often=20= misunderstood, Facade, Proxy, and Factory You want to learn about =20= <BR> <DIV>support in your own code. Decorator is something from you have. You=20= know of Design Patterns so <BR> want to see how more complex. <BR> what to expect--a visually-rich </DIV><BR> Head First book, you know <BR> <BR> </DIV><BR> <DIV> and why everything how patterns are design problems, and better =20= advantage <BR> in between sips of a martini. (or worse, a flat tire), <BR> principles will help </DIV><BR> learned by those <BR> <BR> </DIV><BR> <DIV>to use them (and when design problems, and better be wrong (and=20= what learned by those <BR> and why everything your boss told you <BR> advantage </DIV><BR> to know how they <BR> <BR> </DIV><BR> matter--why to use them, in between sips of a martini. support in your own code. it struggling with academic <DIV>the patterns=20= that With Design Patterns, the next time you're <BR> brain in a way that sticks. a book, you want and experience of=20= others, </DIV><BR><BR> design problems, and better advantage (and too short) to spend the=20= patterns that own with your co-worker matter--why to use them, more=20= complex. <BR> But you don't just <DIV> so you look to Design the latest research in =20= <BR> same problems. <BR> the latest research in learned by those <BR> else. Something more </DIV><BR> NOT to use them). With Design Patterns, Singleton isn't as simple as=20= it Most importantly, better at solving software <BR> who've faced the Head First Design Patterns used in the Java API=20= alone. At any given moment, <BR> you get to take them to work immediately. deep understanding of why =20= better at solving software want to see how <BR> patterns look in<DIV> (or worse, a flat tire), <BR> the same software "secret language" Design Patterns, you'll avoid ,=20= and how to exploit same problems. <BR><BR> In a way that makes you more complex. and Adapter. With Head First=20= </DIV><BR> to learn how those how patterns are <BR> <DIV>design problems, and better Singleton isn't as simple as it them=20= to work immediately. the embarrassment of thinking <BR> neurobiology, cognitive With Design Patterns, <BR> Design Patterns, you'll avoid </DIV><BR> of patterns with others <BR> <BR> </DIV><BR> </BODY> </BODY></HTML> |
|
From: <sub...@co...> - 2006-10-06 16:57:56
|
Author: phd
Date: 2006-10-06 10:57:54 -0600 (Fri, 06 Oct 2006)
New Revision: 1989
Modified:
home/phd/SQLObject/paramstyles/sqlobject/inheritance/__init__.py
home/phd/SQLObject/paramstyles/sqlobject/inheritance/tests/test_inheritance.py
home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py
Log:
Merged patches from the revisions 1984:1988 from the trunk
Modified: home/phd/SQLObject/paramstyles/sqlobject/inheritance/__init__.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/inheritance/__init__.py 2006-10-06 16:57:00 UTC (rev 1988)
+++ home/phd/SQLObject/paramstyles/sqlobject/inheritance/__init__.py 2006-10-06 16:57:54 UTC (rev 1989)
@@ -1,6 +1,6 @@
from sqlobject import sqlbuilder
from sqlobject import classregistry
-from sqlobject import col
+from sqlobject.col import StringCol, ForeignKey
from sqlobject.main import sqlmeta, SQLObject, SelectResults, True, False, \
makeProperties, getterName, setterName
import iteration
@@ -92,8 +92,13 @@
#DSM: Update each child class if needed and existing (only for new
#DSM: dynamic column as no child classes exists at object creation)
+ if columnDef and hasattr(soClass, "q"):
+ q = getattr(soClass.q, columnDef.name, None)
+ else:
+ q = None
for c in sqlmeta.childClasses.values():
c.sqlmeta.addColumn(columnDef, connection=connection, childUpdate=True)
+ if q: setattr(c.q, columnDef.name, q)
addColumn = classmethod(addColumn)
@@ -101,10 +106,15 @@
soClass = sqlmeta.soClass
super(InheritableSQLMeta, sqlmeta).delColumn(column, changeSchema, connection)
+ if isinstance(column, str):
+ name = column
+ else:
+ name = column.name
+
#DSM: Update each child class if needed
#DSM: and delete properties for this column
for c in sqlmeta.childClasses.values():
- delattr(c, name)
+ delattr(c.q, name)
delColumn = classmethod(delColumn)
@@ -166,7 +176,7 @@
for column in currentClass.sqlmeta.columnDefinitions.values():
if column.name == 'childName':
continue
- if type(column) == col.ForeignKey:
+ if type(column) == ForeignKey:
continue
setattr(cls.q, column.name,
getattr(currentClass.q, column.name))
@@ -259,7 +269,7 @@
% column.name)
# if this class is inheritable, add column for children distinction
if cls._inheritable and (cls.__name__ != 'InheritableSQLObject'):
- sqlmeta.addColumn(col.StringCol(name='childName',
+ sqlmeta.addColumn(StringCol(name='childName',
# limit string length to get VARCHAR and not CLOB
length=255, default=None))
if not sqlmeta.columnList:
Modified: home/phd/SQLObject/paramstyles/sqlobject/inheritance/tests/test_inheritance.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/inheritance/tests/test_inheritance.py 2006-10-06 16:57:00 UTC (rev 1988)
+++ home/phd/SQLObject/paramstyles/sqlobject/inheritance/tests/test_inheritance.py 2006-10-06 16:57:54 UTC (rev 1989)
@@ -78,3 +78,39 @@
person = Employee.byLastName("Leader")
assert person.firstName == "Project"
+
+def test_addDelColumn():
+ setup()
+
+ assert hasattr(InheritablePerson, "firstName")
+ assert hasattr(Employee, "firstName")
+ assert hasattr(InheritablePerson.q, "firstName")
+ assert hasattr(Employee.q, "firstName")
+
+ Employee.sqlmeta.addColumn(IntCol('runtime', default=None))
+
+ assert not hasattr(InheritablePerson, 'runtime')
+ assert hasattr(Employee, 'runtime')
+ assert not hasattr(InheritablePerson.q, 'runtime')
+ assert hasattr(Employee.q, 'runtime')
+
+ InheritablePerson.sqlmeta.addColumn(IntCol('runtime2', default=None))
+
+ assert hasattr(InheritablePerson, 'runtime2')
+ assert hasattr(Employee, 'runtime2')
+ assert hasattr(InheritablePerson.q, 'runtime2')
+ assert hasattr(Employee.q, 'runtime2')
+
+ Employee.sqlmeta.delColumn('runtime')
+
+ assert not hasattr(InheritablePerson, 'runtime')
+ assert not hasattr(Employee, 'runtime')
+ assert not hasattr(InheritablePerson.q, 'runtime')
+ assert not hasattr(Employee.q, 'runtime')
+
+ InheritablePerson.sqlmeta.delColumn('runtime2')
+
+ assert not hasattr(InheritablePerson, 'runtime2')
+ assert not hasattr(Employee, 'runtime2')
+ assert not hasattr(InheritablePerson.q, 'runtime2')
+ assert not hasattr(Employee.q, 'runtime2')
Modified: home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py 2006-10-06 16:57:00 UTC (rev 1988)
+++ home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py 2006-10-06 16:57:54 UTC (rev 1989)
@@ -168,7 +168,7 @@
self.query('DESCRIBE %s' % (tableName))
return True
except ProgrammingError, e:
- if e.code == 1146: # ER_NO_SUCH_TABLE
+ if e[0].code == 1146: # ER_NO_SUCH_TABLE
return False
raise
|
|
From: <sub...@co...> - 2006-10-06 16:57:04
|
Author: phd
Date: 2006-10-06 10:57:00 -0600 (Fri, 06 Oct 2006)
New Revision: 1988
Modified:
SQLObject/trunk/sqlobject/inheritance/__init__.py
SQLObject/trunk/sqlobject/inheritance/tests/test_inheritance.py
Log:
Fixed a number of bugs in InheritableSQLMeta.{add,del}Column().
Modified: SQLObject/trunk/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/trunk/sqlobject/inheritance/__init__.py 2006-10-06 16:56:41 UTC (rev 1987)
+++ SQLObject/trunk/sqlobject/inheritance/__init__.py 2006-10-06 16:57:00 UTC (rev 1988)
@@ -1,6 +1,6 @@
from sqlobject import sqlbuilder
from sqlobject import classregistry
-from sqlobject import col
+from sqlobject.col import StringCol, ForeignKey
from sqlobject.main import sqlmeta, SQLObject, SelectResults, True, False, \
makeProperties, getterName, setterName
import iteration
@@ -92,8 +92,13 @@
#DSM: Update each child class if needed and existing (only for new
#DSM: dynamic column as no child classes exists at object creation)
+ if columnDef and hasattr(soClass, "q"):
+ q = getattr(soClass.q, columnDef.name, None)
+ else:
+ q = None
for c in sqlmeta.childClasses.values():
c.sqlmeta.addColumn(columnDef, connection=connection, childUpdate=True)
+ if q: setattr(c.q, columnDef.name, q)
addColumn = classmethod(addColumn)
@@ -101,10 +106,15 @@
soClass = sqlmeta.soClass
super(InheritableSQLMeta, sqlmeta).delColumn(column, changeSchema, connection)
+ if isinstance(column, str):
+ name = column
+ else:
+ name = column.name
+
#DSM: Update each child class if needed
#DSM: and delete properties for this column
for c in sqlmeta.childClasses.values():
- delattr(c, name)
+ delattr(c.q, name)
delColumn = classmethod(delColumn)
@@ -166,7 +176,7 @@
for column in currentClass.sqlmeta.columnDefinitions.values():
if column.name == 'childName':
continue
- if type(column) == col.ForeignKey:
+ if type(column) == ForeignKey:
continue
setattr(cls.q, column.name,
getattr(currentClass.q, column.name))
@@ -259,7 +269,7 @@
% column.name)
# if this class is inheritable, add column for children distinction
if cls._inheritable and (cls.__name__ != 'InheritableSQLObject'):
- sqlmeta.addColumn(col.StringCol(name='childName',
+ sqlmeta.addColumn(StringCol(name='childName',
# limit string length to get VARCHAR and not CLOB
length=255, default=None))
if not sqlmeta.columnList:
Modified: SQLObject/trunk/sqlobject/inheritance/tests/test_inheritance.py
===================================================================
--- SQLObject/trunk/sqlobject/inheritance/tests/test_inheritance.py 2006-10-06 16:56:41 UTC (rev 1987)
+++ SQLObject/trunk/sqlobject/inheritance/tests/test_inheritance.py 2006-10-06 16:57:00 UTC (rev 1988)
@@ -78,3 +78,39 @@
person = Employee.byLastName("Leader")
assert person.firstName == "Project"
+
+def test_addDelColumn():
+ setup()
+
+ assert hasattr(InheritablePerson, "firstName")
+ assert hasattr(Employee, "firstName")
+ assert hasattr(InheritablePerson.q, "firstName")
+ assert hasattr(Employee.q, "firstName")
+
+ Employee.sqlmeta.addColumn(IntCol('runtime', default=None))
+
+ assert not hasattr(InheritablePerson, 'runtime')
+ assert hasattr(Employee, 'runtime')
+ assert not hasattr(InheritablePerson.q, 'runtime')
+ assert hasattr(Employee.q, 'runtime')
+
+ InheritablePerson.sqlmeta.addColumn(IntCol('runtime2', default=None))
+
+ assert hasattr(InheritablePerson, 'runtime2')
+ assert hasattr(Employee, 'runtime2')
+ assert hasattr(InheritablePerson.q, 'runtime2')
+ assert hasattr(Employee.q, 'runtime2')
+
+ Employee.sqlmeta.delColumn('runtime')
+
+ assert not hasattr(InheritablePerson, 'runtime')
+ assert not hasattr(Employee, 'runtime')
+ assert not hasattr(InheritablePerson.q, 'runtime')
+ assert not hasattr(Employee.q, 'runtime')
+
+ InheritablePerson.sqlmeta.delColumn('runtime2')
+
+ assert not hasattr(InheritablePerson, 'runtime2')
+ assert not hasattr(Employee, 'runtime2')
+ assert not hasattr(InheritablePerson.q, 'runtime2')
+ assert not hasattr(Employee.q, 'runtime2')
|
|
From: <sub...@co...> - 2006-10-06 16:56:46
|
Author: phd
Date: 2006-10-06 10:56:41 -0600 (Fri, 06 Oct 2006)
New Revision: 1987
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/inheritance/__init__.py
SQLObject/branches/0.7-bugfix/sqlobject/inheritance/tests/test_inheritance.py
Log:
Fixed a number of bugs in InheritableSQLMeta.{add,del}Column().
Modified: SQLObject/branches/0.7-bugfix/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/inheritance/__init__.py 2006-10-05 18:02:20 UTC (rev 1986)
+++ SQLObject/branches/0.7-bugfix/sqlobject/inheritance/__init__.py 2006-10-06 16:56:41 UTC (rev 1987)
@@ -91,8 +91,13 @@
#DSM: Update each child class if needed and existing (only for new
#DSM: dynamic column as no child classes exists at object creation)
+ if columnDef and hasattr(soClass, "q"):
+ q = getattr(soClass.q, columnDef.name, None)
+ else:
+ q = None
for c in soClass._childClasses.values():
c.sqlmeta.addColumn(columnDef, connection=connection, childUpdate=True)
+ if q: setattr(c.q, columnDef.name, q)
addColumn = classmethod(addColumn)
@@ -100,10 +105,15 @@
soClass = sqlmeta.soClass
super(InheritableSQLMeta, sqlmeta).delColumn(column, changeSchema, connection)
+ if isinstance(column, str):
+ name = column
+ else:
+ name = column.name
+
#DSM: Update each child class if needed
#DSM: and delete properties for this column
for c in soClass._childClasses.values():
- delattr(c, name)
+ delattr(c.q, name)
delColumn = classmethod(delColumn)
Modified: SQLObject/branches/0.7-bugfix/sqlobject/inheritance/tests/test_inheritance.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/inheritance/tests/test_inheritance.py 2006-10-05 18:02:20 UTC (rev 1986)
+++ SQLObject/branches/0.7-bugfix/sqlobject/inheritance/tests/test_inheritance.py 2006-10-06 16:56:41 UTC (rev 1987)
@@ -78,3 +78,39 @@
person = Employee.byLastName("Leader")
assert person.firstName == "Project"
+
+def test_addDelColumn():
+ setup()
+
+ assert hasattr(InheritablePerson, "firstName")
+ assert hasattr(Employee, "firstName")
+ assert hasattr(InheritablePerson.q, "firstName")
+ assert hasattr(Employee.q, "firstName")
+
+ Employee.sqlmeta.addColumn(IntCol('runtime', default=None))
+
+ assert not hasattr(InheritablePerson, 'runtime')
+ assert hasattr(Employee, 'runtime')
+ assert not hasattr(InheritablePerson.q, 'runtime')
+ assert hasattr(Employee.q, 'runtime')
+
+ InheritablePerson.sqlmeta.addColumn(IntCol('runtime2', default=None))
+
+ assert hasattr(InheritablePerson, 'runtime2')
+ assert hasattr(Employee, 'runtime2')
+ assert hasattr(InheritablePerson.q, 'runtime2')
+ assert hasattr(Employee.q, 'runtime2')
+
+ Employee.sqlmeta.delColumn('runtime')
+
+ assert not hasattr(InheritablePerson, 'runtime')
+ assert not hasattr(Employee, 'runtime')
+ assert not hasattr(InheritablePerson.q, 'runtime')
+ assert not hasattr(Employee.q, 'runtime')
+
+ InheritablePerson.sqlmeta.delColumn('runtime2')
+
+ assert not hasattr(InheritablePerson, 'runtime2')
+ assert not hasattr(Employee, 'runtime2')
+ assert not hasattr(InheritablePerson.q, 'runtime2')
+ assert not hasattr(Employee.q, 'runtime2')
|
|
From: <sub...@co...> - 2006-10-05 15:35:44
|
Author: phd
Date: 2006-10-05 09:35:36 -0600 (Thu, 05 Oct 2006)
New Revision: 1985
Modified:
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
Log:
A bugfix by Mircea Amarascu <mi...@ag...>.
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-10-04 17:07:59 UTC (rev 1984)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-10-05 15:35:36 UTC (rev 1985)
@@ -168,7 +168,7 @@
self.query('DESCRIBE %s' % (tableName))
return True
except ProgrammingError, e:
- if e.code == 1146: # ER_NO_SUCH_TABLE
+ if e[0].code == 1146: # ER_NO_SUCH_TABLE
return False
raise
|
|
From: <sub...@co...> - 2006-10-04 17:08:06
|
Author: phd Date: 2006-10-04 11:07:59 -0600 (Wed, 04 Oct 2006) New Revision: 1984 Added: home/phd/SQLObject/paramstyles/sqlobject/dberrors.py home/phd/SQLObject/paramstyles/sqlobject/tests/test_exceptions.py Modified: home/phd/SQLObject/paramstyles/sqlobject/__init__.py home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py home/phd/SQLObject/paramstyles/sqlobject/sresults.py home/phd/SQLObject/paramstyles/sqlobject/tests/dbtest.py home/phd/SQLObject/paramstyles/sqlobject/tests/test_indexes.py home/phd/SQLObject/paramstyles/sqlobject/tests/test_select.py home/phd/SQLObject/paramstyles/sqlobject/util/csvexport.py Log: Merged patches from the revisions 1975:1983 from the trunk Modified: home/phd/SQLObject/paramstyles/sqlobject/__init__.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/__init__.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/__init__.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -5,6 +5,7 @@ from joins import * from index import * from dbconnection import connectionForURI +import dberrors ## Each of these imports allows the driver to install itself ## Then we set up some backward compatibility Copied: home/phd/SQLObject/paramstyles/sqlobject/dberrors.py (from rev 1983, SQLObject/trunk/sqlobject/dberrors.py) =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/dberrors.py (rev 0) +++ home/phd/SQLObject/paramstyles/sqlobject/dberrors.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -0,0 +1,21 @@ +"""dberrors: database exception classes for SQLObject. + + These classes are dictated by the DB API v2.0: + + http://www.python.org/topics/database/DatabaseAPI-2.0.html +""" + +class Error(StandardError): pass +class Warning(StandardError): pass + +class InterfaceError(Error): pass +class DatabaseError(Error): pass + +class InternalError(DatabaseError): pass +class OperationalError(DatabaseError): pass +class ProgrammingError(DatabaseError): pass +class IntegrityError(DatabaseError): pass +class DataError(DatabaseError): pass +class NotSupportedError(DatabaseError): pass + +class DuplicateEntryError(IntegrityError): pass Modified: home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -1,7 +1,16 @@ from sqlobject.dbconnection import DBAPI +from sqlobject.dberrors import * from sqlobject import col MySQLdb = None +class ErrorMessage(str): + def __new__(cls, e): + obj = str.__new__(cls, e[1]) + obj.code = int(e[0]) + obj.module = e.__module__ + obj.exception = e.__class__.__name__ + return obj + class MySQLConnection(DBAPI): supportTransactions = False @@ -54,9 +63,9 @@ conn = self.module.connect(host=self.host, port=self.port, db=self.db, user=self.user, passwd=self.password, **self.kw) except self.module.OperationalError, e: - raise self.module.OperationalError( + raise OperationalError( "%s; used connection string: host=%s, port=%s, db=%s, user=%s, pwd=%s" % ( - e, self.host, self.port, self.db, self.user, self.password) + e, self.host, self.port, self.db, self.user, self.password) ) if hasattr(conn, 'autocommit'): @@ -79,11 +88,33 @@ else: return DBAPI._executeRetry(self, conn, cursor, query) except MySQLdb.OperationalError, e: - if e.args[0] == 2013: # SERVER_LOST error + if e.args[0] in (2006, 20013): # SERVER_GONE or SERVER_LOST error if self.debug: self.printDebug(conn, str(e), 'ERROR') else: - raise + raise OperationalError(ErrorMessage(e)) + except MySQLdb.IntegrityError, e: + msg = ErrorMessage(e) + if e.args[0] == 1062: + raise DuplicateEntryError(msg) + else: + raise IntegrityError(msg) + except MySQLdb.InternalError, e: + raise InternalError(ErrorMessage(e)) + except MySQLdb.ProgrammingError, e: + raise ProgrammingError(ErrorMessage(e)) + except MySQLdb.DataError, e: + raise DataError(ErrorMessage(e)) + except MySQLdb.NotSupportedError, e: + raise NotSupportedError(ErrorMessage(e)) + except MySQLdb.DatabaseError, e: + raise DatabaseError(ErrorMessage(e)) + except MySQLdb.InterfaceError, e: + raise InterfaceError(ErrorMessage(e)) + except MySQLdb.Warning, e: + raise Warning(ErrorMessage(e)) + except MySQLdb.Error, e: + raise Error(ErrorMessage(e)) def _queryInsertID(self, conn, soInstance, id, names, values): table = soInstance.sqlmeta.table @@ -136,8 +167,8 @@ # which is not always True (for an embedded application, e.g.) self.query('DESCRIBE %s' % (tableName)) return True - except MySQLdb.ProgrammingError, e: - if e.args[0] == 1146: # ER_NO_SUCH_TABLE + except ProgrammingError, e: + if e.code == 1146: # ER_NO_SUCH_TABLE return False raise Modified: home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -1,11 +1,20 @@ from sqlobject.dbconnection import DBAPI from sqlobject.col import popKey +from sqlobject.dberrors import * import thread sqlite = None using_sqlite2 = False sqlite2_Binary = None +class ErrorMessage(str): + def __new__(cls, e): + obj = str.__new__(cls, e[0]) + obj.code = None + obj.module = e.__module__ + obj.exception = e.__class__.__name__ + return obj + class SQLiteConnection(DBAPI): supportTransactions = True @@ -158,6 +167,34 @@ return self._memoryConn return sqlite.connect(self.filename, **self._connOptions) + def _executeRetry(self, conn, cursor, query): + try: + DBAPI._executeRetry(self, conn, c, query) + except self.module.OperationalError, e: + raise OperationalError(ErrorMessage(e)) + except self.module.IntegrityError, e: + msg = ErrorMessage(e) + if msg.startswith('column') and msg.endswith('not unique'): + raise DuplicateEntryError(msg) + else: + raise IntegrityError(msg) + except self.module.InternalError, e: + raise InternalError(ErrorMessage(e)) + except self.module.ProgrammingError, e: + raise ProgrammingError(ErrorMessage(e)) + except self.module.DataError, e: + raise DataError(ErrorMessage(e)) + except self.module.NotSupportedError, e: + raise NotSupportedError(ErrorMessage(e)) + except self.module.DatabaseError, e: + raise DatabaseError(ErrorMessage(e)) + except self.module.InterfaceError, e: + raise InterfaceError(ErrorMessage(e)) + except self.module.Warning, e: + raise Warning(ErrorMessage(e)) + except self.module.Error, e: + raise Error(ErrorMessage(e)) + def _queryInsertID(self, conn, soInstance, id, names, values): table = soInstance.sqlmeta.table idName = soInstance.sqlmeta.idName @@ -168,7 +205,7 @@ q = self._insertSQL(table, names, values) if self.debug: self.printDebug(conn, q, 'QueryIns') - DBAPI._executeRetry(self, conn, c, q) + self._executeRetry(conn, c, q) # lastrowid is a DB-API extension from "PEP 0249": if id is None: id = int(c.lastrowid) Modified: home/phd/SQLObject/paramstyles/sqlobject/sresults.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/sresults.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/sresults.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -35,6 +35,10 @@ def __repr__(self): return "<%s at %x>" % (self.__class__.__name__, id(self)) + def __nonzero__(self): + raise NotImplementedError( + "To test if a SelectResult will produce any items, use list(result) or result.count()") + def _getConnection(self): return self.ops.get('connection') or self.sourceClass._connection Modified: home/phd/SQLObject/paramstyles/sqlobject/tests/dbtest.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/tests/dbtest.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/tests/dbtest.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -33,6 +33,7 @@ """ supportsMatrix = { '+restrictedEnum': 'postgres', + '+exceptions': 'mysql sqlite', '-transactions': 'mysql', '-dropTableCascade': 'sybase mssql', '-fromDatabase': 'sqlite sybase firebird', Copied: home/phd/SQLObject/paramstyles/sqlobject/tests/test_exceptions.py (from rev 1983, SQLObject/trunk/sqlobject/tests/test_exceptions.py) =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/tests/test_exceptions.py (rev 0) +++ home/phd/SQLObject/paramstyles/sqlobject/tests/test_exceptions.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -0,0 +1,17 @@ +from sqlobject import * +from sqlobject.dberrors import DuplicateEntryError +from sqlobject.tests.dbtest import * + +######################################## +## Table aliases and self-joins +######################################## + +class TestException(SQLObject): + name = StringCol(unique=True) + +def test_exceptions(): + if not supports("exceptions"): + return + setupClass(TestException) + TestException(name="test") + raises(DuplicateEntryError, TestException, name="test") Modified: home/phd/SQLObject/paramstyles/sqlobject/tests/test_indexes.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/tests/test_indexes.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/tests/test_indexes.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -1,4 +1,5 @@ from sqlobject import * +from sqlobject.dberrors import * from sqlobject.tests.dbtest import * ######################################## @@ -29,7 +30,10 @@ mod = SOIndex1._connection.module try: SOIndex1(name='blah', number=0) - except (mod.ProgrammingError, mod.IntegrityError, mod.OperationalError, mod.DatabaseError): + except ( + mod.ProgrammingError, mod.IntegrityError, mod.OperationalError, mod.DatabaseError, + ProgrammingError, IntegrityError, OperationalError, DatabaseError + ): # expected pass else: Modified: home/phd/SQLObject/paramstyles/sqlobject/tests/test_select.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/tests/test_select.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/tests/test_select.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -168,3 +168,8 @@ assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlx.*$")).count() == 0 + +def test_bool_SelectResults(): + setupClass(IterTest) + + raises(NotImplementedError, bool, IterTest.select()) Modified: home/phd/SQLObject/paramstyles/sqlobject/util/csvexport.py =================================================================== --- home/phd/SQLObject/paramstyles/sqlobject/util/csvexport.py 2006-10-04 16:59:56 UTC (rev 1983) +++ home/phd/SQLObject/paramstyles/sqlobject/util/csvexport.py 2006-10-04 17:07:59 UTC (rev 1984) @@ -58,14 +58,14 @@ writer = csv.writer(return_fileobj) elif not hasattr(writer, 'writerow'): writer = csv.writer(writer) - + if isinstance(soClass, sqlobject.SQLObject.SelectResultsClass): - assert not select, ( + assert select is None, ( "You cannot pass in a select argument (%r) and a SelectResult argument (%r) for soClass" % (select, soClass)) select = soClass soClass = select.sourceClass - elif not select: + elif select is None: select = soClass.select() if getattr(soClass, 'csvOrderBy', None): select = select.orderBy(soClass.csvOrderBy) |
|
From: <sub...@co...> - 2006-10-04 17:00:02
|
Author: phd Date: 2006-10-04 10:59:56 -0600 (Wed, 04 Oct 2006) New Revision: 1983 Modified: SQLObject/docs/TODO.txt Log: TODO: make SQLObject unicode-based. Modified: SQLObject/docs/TODO.txt =================================================================== --- SQLObject/docs/TODO.txt 2006-10-04 16:59:26 UTC (rev 1982) +++ SQLObject/docs/TODO.txt 2006-10-04 16:59:56 UTC (rev 1983) @@ -6,7 +6,7 @@ ``_idName`` with ``_fromDatabase``. * More databases supported. There has been interest and some work in - the progress for Oracle. IWBN to have DB2 driver. + the progress for Oracle. IWBN to have informix and DB2 drivers. * Better transaction support -- right now you can use transactions for the database, but the object isn't transaction-aware, so @@ -21,10 +21,6 @@ published for editing more directly and easily. (First step: get Schema-generating method into sqlmeta class) -* Simple method (in sqlmeta) for serializing a SQLObject instance to a - dictionary -- both a dead dictionary (copy of values) and a live - dictionary (setting keys changes the instance). - * Automatic joins in select queries. * More kinds of joins, and more powerful join results (closer to how @@ -42,3 +38,7 @@ * A hierarchy of exceptions. SQLObject should translate exceptions from low-level drivers to a consistent set of high-level exceptions. + +* Made SQLObject unicode-based instead of just unicode-aware. All internal + processing should be done with unicode strings, conversion to/from ascii + strings should happen for non-unicode DB API drivers. |
|
From: <sub...@co...> - 2006-10-04 16:59:32
|
Author: phd Date: 2006-10-04 10:59:26 -0600 (Wed, 04 Oct 2006) New Revision: 1982 Modified: SQLObject/docs/News.txt Log: A hierarchy of exceptions. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2006-10-04 16:57:44 UTC (rev 1981) +++ SQLObject/docs/News.txt 2006-10-04 16:59:26 UTC (rev 1982) @@ -49,6 +49,9 @@ * SELECT FOR UPDATE +* New module dberrors.py - a hierarchy of exceptions. Translation of DB API + module's exceptions to the new hierarchy is performed for SQLIte and MySQL. + Small Features -------------- |
|
From: <sub...@co...> - 2006-10-04 16:57:53
|
Author: phd Date: 2006-10-04 10:57:44 -0600 (Wed, 04 Oct 2006) New Revision: 1981 Added: SQLObject/trunk/sqlobject/dberrors.py SQLObject/trunk/sqlobject/tests/test_exceptions.py Modified: SQLObject/trunk/sqlobject/__init__.py SQLObject/trunk/sqlobject/mysql/mysqlconnection.py SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py SQLObject/trunk/sqlobject/tests/dbtest.py SQLObject/trunk/sqlobject/tests/test_indexes.py Log: A patch by Mircea Amarascu <mi...@ag...> - a hierarchy of exceptions. Modified: SQLObject/trunk/sqlobject/__init__.py =================================================================== --- SQLObject/trunk/sqlobject/__init__.py 2006-10-04 16:19:06 UTC (rev 1980) +++ SQLObject/trunk/sqlobject/__init__.py 2006-10-04 16:57:44 UTC (rev 1981) @@ -5,6 +5,7 @@ from joins import * from index import * from dbconnection import connectionForURI +import dberrors ## Each of these imports allows the driver to install itself ## Then we set up some backward compatibility Added: SQLObject/trunk/sqlobject/dberrors.py =================================================================== --- SQLObject/trunk/sqlobject/dberrors.py (rev 0) +++ SQLObject/trunk/sqlobject/dberrors.py 2006-10-04 16:57:44 UTC (rev 1981) @@ -0,0 +1,21 @@ +"""dberrors: database exception classes for SQLObject. + + These classes are dictated by the DB API v2.0: + + http://www.python.org/topics/database/DatabaseAPI-2.0.html +""" + +class Error(StandardError): pass +class Warning(StandardError): pass + +class InterfaceError(Error): pass +class DatabaseError(Error): pass + +class InternalError(DatabaseError): pass +class OperationalError(DatabaseError): pass +class ProgrammingError(DatabaseError): pass +class IntegrityError(DatabaseError): pass +class DataError(DatabaseError): pass +class NotSupportedError(DatabaseError): pass + +class DuplicateEntryError(IntegrityError): pass Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py =================================================================== --- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-10-04 16:19:06 UTC (rev 1980) +++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-10-04 16:57:44 UTC (rev 1981) @@ -1,7 +1,16 @@ from sqlobject.dbconnection import DBAPI +from sqlobject.dberrors import * from sqlobject import col MySQLdb = None +class ErrorMessage(str): + def __new__(cls, e): + obj = str.__new__(cls, e[1]) + obj.code = int(e[0]) + obj.module = e.__module__ + obj.exception = e.__class__.__name__ + return obj + class MySQLConnection(DBAPI): supportTransactions = False @@ -54,9 +63,9 @@ conn = self.module.connect(host=self.host, port=self.port, db=self.db, user=self.user, passwd=self.password, **self.kw) except self.module.OperationalError, e: - raise self.module.OperationalError( + raise OperationalError( "%s; used connection string: host=%s, port=%s, db=%s, user=%s, pwd=%s" % ( - e, self.host, self.port, self.db, self.user, self.password) + e, self.host, self.port, self.db, self.user, self.password) ) if hasattr(conn, 'autocommit'): @@ -79,11 +88,33 @@ else: return cursor.execute(query) except MySQLdb.OperationalError, e: - if e.args[0] == 2013: # SERVER_LOST error + if e.args[0] in (2006, 20013): # SERVER_GONE or SERVER_LOST error if self.debug: self.printDebug(conn, str(e), 'ERROR') else: - raise + raise OperationalError(ErrorMessage(e)) + except MySQLdb.IntegrityError, e: + msg = ErrorMessage(e) + if e.args[0] == 1062: + raise DuplicateEntryError(msg) + else: + raise IntegrityError(msg) + except MySQLdb.InternalError, e: + raise InternalError(ErrorMessage(e)) + except MySQLdb.ProgrammingError, e: + raise ProgrammingError(ErrorMessage(e)) + except MySQLdb.DataError, e: + raise DataError(ErrorMessage(e)) + except MySQLdb.NotSupportedError, e: + raise NotSupportedError(ErrorMessage(e)) + except MySQLdb.DatabaseError, e: + raise DatabaseError(ErrorMessage(e)) + except MySQLdb.InterfaceError, e: + raise InterfaceError(ErrorMessage(e)) + except MySQLdb.Warning, e: + raise Warning(ErrorMessage(e)) + except MySQLdb.Error, e: + raise Error(ErrorMessage(e)) def _queryInsertID(self, conn, soInstance, id, names, values): table = soInstance.sqlmeta.table @@ -136,8 +167,8 @@ # which is not always True (for an embedded application, e.g.) self.query('DESCRIBE %s' % (tableName)) return True - except MySQLdb.ProgrammingError, e: - if e.args[0] == 1146: # ER_NO_SUCH_TABLE + except ProgrammingError, e: + if e.code == 1146: # ER_NO_SUCH_TABLE return False raise Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py =================================================================== --- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2006-10-04 16:19:06 UTC (rev 1980) +++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2006-10-04 16:57:44 UTC (rev 1981) @@ -1,11 +1,20 @@ from sqlobject.dbconnection import DBAPI from sqlobject.col import popKey +from sqlobject.dberrors import * import thread sqlite = None using_sqlite2 = False sqlite2_Binary = None +class ErrorMessage(str): + def __new__(cls, e): + obj = str.__new__(cls, e[0]) + obj.code = None + obj.module = e.__module__ + obj.exception = e.__class__.__name__ + return obj + class SQLiteConnection(DBAPI): supportTransactions = True @@ -158,6 +167,36 @@ return self._memoryConn return sqlite.connect(self.filename, **self._connOptions) + def _executeRetry(self, conn, cursor, query): + if self.debug: + self.printDebug(conn, query, 'QueryR') + try: + return cursor.execute(query) + except self.module.OperationalError, e: + raise OperationalError(ErrorMessage(e)) + except self.module.IntegrityError, e: + msg = ErrorMessage(e) + if msg.startswith('column') and msg.endswith('not unique'): + raise DuplicateEntryError(msg) + else: + raise IntegrityError(msg) + except self.module.InternalError, e: + raise InternalError(ErrorMessage(e)) + except self.module.ProgrammingError, e: + raise ProgrammingError(ErrorMessage(e)) + except self.module.DataError, e: + raise DataError(ErrorMessage(e)) + except self.module.NotSupportedError, e: + raise NotSupportedError(ErrorMessage(e)) + except self.module.DatabaseError, e: + raise DatabaseError(ErrorMessage(e)) + except self.module.InterfaceError, e: + raise InterfaceError(ErrorMessage(e)) + except self.module.Warning, e: + raise Warning(ErrorMessage(e)) + except self.module.Error, e: + raise Error(ErrorMessage(e)) + def _queryInsertID(self, conn, soInstance, id, names, values): table = soInstance.sqlmeta.table idName = soInstance.sqlmeta.idName @@ -168,7 +207,7 @@ q = self._insertSQL(table, names, values) if self.debug: self.printDebug(conn, q, 'QueryIns') - c.execute(q) + self._executeRetry(conn, c, q) # lastrowid is a DB-API extension from "PEP 0249": if id is None: id = int(c.lastrowid) Modified: SQLObject/trunk/sqlobject/tests/dbtest.py =================================================================== --- SQLObject/trunk/sqlobject/tests/dbtest.py 2006-10-04 16:19:06 UTC (rev 1980) +++ SQLObject/trunk/sqlobject/tests/dbtest.py 2006-10-04 16:57:44 UTC (rev 1981) @@ -33,6 +33,7 @@ """ supportsMatrix = { '+restrictedEnum': 'postgres', + '+exceptions': 'mysql sqlite', '-transactions': 'mysql', '-dropTableCascade': 'sybase mssql', '-fromDatabase': 'sqlite sybase firebird', Added: SQLObject/trunk/sqlobject/tests/test_exceptions.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_exceptions.py (rev 0) +++ SQLObject/trunk/sqlobject/tests/test_exceptions.py 2006-10-04 16:57:44 UTC (rev 1981) @@ -0,0 +1,17 @@ +from sqlobject import * +from sqlobject.dberrors import DuplicateEntryError +from sqlobject.tests.dbtest import * + +######################################## +## Table aliases and self-joins +######################################## + +class TestException(SQLObject): + name = StringCol(unique=True) + +def test_exceptions(): + if not supports("exceptions"): + return + setupClass(TestException) + TestException(name="test") + raises(DuplicateEntryError, TestException, name="test") Modified: SQLObject/trunk/sqlobject/tests/test_indexes.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_indexes.py 2006-10-04 16:19:06 UTC (rev 1980) +++ SQLObject/trunk/sqlobject/tests/test_indexes.py 2006-10-04 16:57:44 UTC (rev 1981) @@ -1,4 +1,5 @@ from sqlobject import * +from sqlobject.dberrors import * from sqlobject.tests.dbtest import * ######################################## @@ -29,7 +30,10 @@ mod = SOIndex1._connection.module try: SOIndex1(name='blah', number=0) - except (mod.ProgrammingError, mod.IntegrityError, mod.OperationalError, mod.DatabaseError): + except ( + mod.ProgrammingError, mod.IntegrityError, mod.OperationalError, mod.DatabaseError, + ProgrammingError, IntegrityError, OperationalError, DatabaseError + ): # expected pass else: |
|
From: <sub...@co...> - 2006-10-04 15:20:22
|
Author: phd Date: 2006-10-04 09:20:19 -0600 (Wed, 04 Oct 2006) New Revision: 1978 Modified: SQLObject/docs/News.txt Log: SelectResults cannot be queried for truth value; __nonzero__() raises NotImplementedError. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2006-10-04 15:19:59 UTC (rev 1977) +++ SQLObject/docs/News.txt 2006-10-04 15:20:19 UTC (rev 1978) @@ -66,6 +66,11 @@ * Support for sqlite3 (a builtin module in Python 2.5). +* SelectResults cannot be queried for truth value; in any case it was + meaningless - the result was always True; now __nonzero__() raises + NotImplementedError in case one tries bool(MyTable.select()) or + "if MyTable.select():..." + Bug Fixes --------- |
|
From: <sub...@co...> - 2006-10-04 15:20:06
|
Author: phd
Date: 2006-10-04 09:19:59 -0600 (Wed, 04 Oct 2006)
New Revision: 1977
Modified:
SQLObject/trunk/sqlobject/sresults.py
SQLObject/trunk/sqlobject/tests/test_select.py
SQLObject/trunk/sqlobject/util/csvexport.py
Log:
SelectResults cannot be queried for truth value; __nonzero__() raises NotImplementedError.
Modified: SQLObject/trunk/sqlobject/sresults.py
===================================================================
--- SQLObject/trunk/sqlobject/sresults.py 2006-10-03 19:01:53 UTC (rev 1976)
+++ SQLObject/trunk/sqlobject/sresults.py 2006-10-04 15:19:59 UTC (rev 1977)
@@ -35,6 +35,10 @@
def __repr__(self):
return "<%s at %x>" % (self.__class__.__name__, id(self))
+ def __nonzero__(self):
+ raise NotImplementedError(
+ "To test if a SelectResult will produce any items, use list(result) or result.count()")
+
def _getConnection(self):
return self.ops.get('connection') or self.sourceClass._connection
Modified: SQLObject/trunk/sqlobject/tests/test_select.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_select.py 2006-10-03 19:01:53 UTC (rev 1976)
+++ SQLObject/trunk/sqlobject/tests/test_select.py 2006-10-04 15:19:59 UTC (rev 1977)
@@ -168,3 +168,8 @@
assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1
assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1
assert IterTest.select(RLIKE(IterTest.q.name, "^sqlx.*$")).count() == 0
+
+def test_bool_SelectResults():
+ setupClass(IterTest)
+
+ raises(NotImplementedError, bool, IterTest.select())
Modified: SQLObject/trunk/sqlobject/util/csvexport.py
===================================================================
--- SQLObject/trunk/sqlobject/util/csvexport.py 2006-10-03 19:01:53 UTC (rev 1976)
+++ SQLObject/trunk/sqlobject/util/csvexport.py 2006-10-04 15:19:59 UTC (rev 1977)
@@ -58,14 +58,14 @@
writer = csv.writer(return_fileobj)
elif not hasattr(writer, 'writerow'):
writer = csv.writer(writer)
-
+
if isinstance(soClass, sqlobject.SQLObject.SelectResultsClass):
- assert not select, (
+ assert select is None, (
"You cannot pass in a select argument (%r) and a SelectResult argument (%r) for soClass"
% (select, soClass))
select = soClass
soClass = select.sourceClass
- elif not select:
+ elif select is None:
select = soClass.select()
if getattr(soClass, 'csvOrderBy', None):
select = select.orderBy(soClass.csvOrderBy)
|
|
From: <sub...@co...> - 2006-10-03 17:31:11
|
Author: phd
Date: 2006-10-03 11:31:09 -0600 (Tue, 03 Oct 2006)
New Revision: 1975
Modified:
home/phd/SQLObject/paramstyles/sqlobject/main.py
home/phd/SQLObject/paramstyles/sqlobject/tests/test_cache.py
Log:
Merged patches from the revisions 1967:1974 from the trunk
Modified: home/phd/SQLObject/paramstyles/sqlobject/main.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/main.py 2006-10-03 17:29:35 UTC (rev 1974)
+++ home/phd/SQLObject/paramstyles/sqlobject/main.py 2006-10-03 17:31:09 UTC (rev 1975)
@@ -35,6 +35,7 @@
"""
import threading
+import weakref
import sqlbuilder
import dbconnection
import col
@@ -246,7 +247,7 @@
declarative.setup_attributes(cls, new_attrs)
def __init__(self, instance):
- self.instance = instance
+ self.instance = weakref.proxy(instance)
def send(cls, signal, *args, **kw):
events.send(signal, cls.soClass, *args, **kw)
@@ -1590,7 +1591,7 @@
class SQLObjectState(object):
def __init__(self, soObject):
- self.soObject = soObject
+ self.soObject = weakref.proxy(soObject)
self.protocol = 'sql'
Modified: home/phd/SQLObject/paramstyles/sqlobject/tests/test_cache.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/tests/test_cache.py 2006-10-03 17:29:35 UTC (rev 1974)
+++ home/phd/SQLObject/paramstyles/sqlobject/tests/test_cache.py 2006-10-03 17:31:09 UTC (rev 1975)
@@ -35,16 +35,14 @@
assert not s.sqlmeta.expired
CacheTest.sqlmeta.expireAll()
assert s.sqlmeta.expired
- del s
CacheTest.sqlmeta.expireAll()
- s = CacheTest.get(s_id)
+ s1 = CacheTest.get(s_id)
# We should have a new object:
- assert id(s) != obj_id
- obj_id2 = id(s)
- del s
+ assert id(s1) != obj_id
+ obj_id2 = id(s1)
CacheTest._connection.expireAll()
- s = CacheTest.get(s_id)
- assert id(s) != obj_id and id(s) != obj_id2
+ s2 = CacheTest.get(s_id)
+ assert id(s2) != obj_id and id(s2) != obj_id2
def test_cache_cull():
setupClass(CacheTest)
|
|
From: <sub...@co...> - 2006-10-03 17:29:37
|
Author: phd Date: 2006-10-03 11:29:35 -0600 (Tue, 03 Oct 2006) New Revision: 1974 Modified: SQLObject/docs/News.txt Log: Documentation update about the weakref patch. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2006-10-03 17:28:02 UTC (rev 1973) +++ SQLObject/docs/News.txt 2006-10-03 17:29:35 UTC (rev 1974) @@ -71,6 +71,9 @@ * Fixed problem with sqlite and threads; connections are no longer shared between threads for sqlite (except for :memory:) +* The reference loop between SQLObject and SQLObjectState eliminated using + weak references. + SQLObject 0.7.2 =============== |
|
From: <sub...@co...> - 2006-10-03 17:28:04
|
Author: phd
Date: 2006-10-03 11:28:02 -0600 (Tue, 03 Oct 2006)
New Revision: 1973
Modified:
SQLObject/trunk/sqlobject/main.py
SQLObject/trunk/sqlobject/tests/test_cache.py
Log:
A patch by Dan Pascu <da...@ag...> to break reference loop
between SQLObject and SQLObjectState using weak references.
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2006-10-03 16:42:24 UTC (rev 1972)
+++ SQLObject/trunk/sqlobject/main.py 2006-10-03 17:28:02 UTC (rev 1973)
@@ -35,6 +35,7 @@
"""
import threading
+import weakref
import sqlbuilder
import dbconnection
import col
@@ -246,7 +247,7 @@
declarative.setup_attributes(cls, new_attrs)
def __init__(self, instance):
- self.instance = instance
+ self.instance = weakref.proxy(instance)
def send(cls, signal, *args, **kw):
events.send(signal, cls.soClass, *args, **kw)
@@ -1590,7 +1591,7 @@
class SQLObjectState(object):
def __init__(self, soObject):
- self.soObject = soObject
+ self.soObject = weakref.proxy(soObject)
self.protocol = 'sql'
Modified: SQLObject/trunk/sqlobject/tests/test_cache.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_cache.py 2006-10-03 16:42:24 UTC (rev 1972)
+++ SQLObject/trunk/sqlobject/tests/test_cache.py 2006-10-03 17:28:02 UTC (rev 1973)
@@ -35,16 +35,14 @@
assert not s.sqlmeta.expired
CacheTest.sqlmeta.expireAll()
assert s.sqlmeta.expired
- del s
CacheTest.sqlmeta.expireAll()
- s = CacheTest.get(s_id)
+ s1 = CacheTest.get(s_id)
# We should have a new object:
- assert id(s) != obj_id
- obj_id2 = id(s)
- del s
+ assert id(s1) != obj_id
+ obj_id2 = id(s1)
CacheTest._connection.expireAll()
- s = CacheTest.get(s_id)
- assert id(s) != obj_id and id(s) != obj_id2
+ s2 = CacheTest.get(s_id)
+ assert id(s2) != obj_id and id(s2) != obj_id2
def test_cache_cull():
setupClass(CacheTest)
|
|
From: <sub...@co...> - 2006-10-02 14:23:15
|
Author: phd
Date: 2006-10-02 08:23:09 -0600 (Mon, 02 Oct 2006)
New Revision: 1967
Modified:
home/phd/SQLObject/paramstyles/sqlobject/col.py
home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py
Log:
Merged patches from the revisions 1960:1966 from the trunk
Modified: home/phd/SQLObject/paramstyles/sqlobject/col.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/col.py 2006-10-02 13:54:07 UTC (rev 1966)
+++ home/phd/SQLObject/paramstyles/sqlobject/col.py 2006-10-02 14:23:09 UTC (rev 1967)
@@ -513,7 +513,9 @@
if value is None:
return None
if isinstance(value, unicode):
- return value.encode("ascii")
+ connection = state.soObject._connection
+ dbEncoding = getattr(connection, "dbEncoding", None) or "ascii"
+ return value.encode(dbEncoding)
return value
def from_python(self, value, state):
@@ -1314,7 +1316,9 @@
if value is None:
return None
if isinstance(value, unicode):
- value = value.encode("ascii")
+ connection = state.soObject._connection
+ dbEncoding = getattr(connection, "dbEncoding", None) or "ascii"
+ value = value.encode(dbEncoding)
if isinstance(value, str):
return pickle.loads(value)
raise validators.Invalid("expected a pickle string in the PickleCol '%s', got %s %r instead" % \
Modified: home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py 2006-10-02 13:54:07 UTC (rev 1966)
+++ home/phd/SQLObject/paramstyles/sqlobject/mysql/mysqlconnection.py 2006-10-02 14:23:09 UTC (rev 1967)
@@ -18,10 +18,6 @@
self.db = db
self.user = user
self.password = password
- if kw.has_key('client_encoding'):
- self.client_encoding = col.popKey(kw, 'client_encoding')
- else:
- self.client_encoding = None
self.kw = {}
if MySQLdb.version_info[0] > 1 or (MySQLdb.version_info[0] == 1 and \
(MySQLdb.version_info[1] > 2 or \
@@ -30,13 +26,17 @@
else:
self.need_unicode = False
for key in ("unix_socket", "init_command",
- "read_default_file", "read_default_group", "charset"):
+ "read_default_file", "read_default_group"):
if key in kw:
self.kw[key] = col.popKey(kw, key)
for key in ("connect_timeout", "compress", "named_pipe", "use_unicode",
"client_flag", "local_infile"):
if key in kw:
self.kw[key] = int(col.popKey(kw, key))
+ if "charset" in kw:
+ self.dbEncoding = self.kw["charset"] = col.popKey(kw, "charset")
+ else:
+ self.dbEncoding = None
if "sqlobject_encoding" in kw:
self.encoding = col.popKey(kw, "sqlobject_encoding")
else:
@@ -61,8 +61,6 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.client_encoding:
- conn.query('SET NAMES ' + self.client_encoding)
return conn
@@ -163,7 +161,7 @@
colClass, kw = self.guessClass(t)
if self.kw['use_unicode'] and colClass is col.StringCol:
colClass = col.UnicodeCol
- if self.client_encoding: kw['dbEncoding'] = self.client_encoding
+ if self.dbEncoding: kw['dbEncoding'] = self.dbEncoding
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['notNone'] = not nullAllowed
if default and t.startswith('int'):
|
|
From: <sub...@co...> - 2006-10-02 13:54:10
|
Author: phd Date: 2006-10-02 07:54:07 -0600 (Mon, 02 Oct 2006) New Revision: 1966 Modified: SQLObject/branches/0.7-bugfix/docs/DeveloperGuide.txt Log: Fixed the path to the trunk in the SVN repository. Modified: SQLObject/branches/0.7-bugfix/docs/DeveloperGuide.txt =================================================================== --- SQLObject/branches/0.7-bugfix/docs/DeveloperGuide.txt 2006-10-02 13:48:13 UTC (rev 1965) +++ SQLObject/branches/0.7-bugfix/docs/DeveloperGuide.txt 2006-10-02 13:54:07 UTC (rev 1966) @@ -25,7 +25,7 @@ Then do the same for SQLObject:: - $ svn co http://svn.colorstudy.com/trunk/SQLObject SQLObject + $ svn co http://svn.colorstudy.com/SQLObject/trunk SQLObject $ cd SQLObject $ sudo python setup.py develop |
|
From: <sub...@co...> - 2006-10-02 13:48:15
|
Author: phd Date: 2006-10-02 07:48:13 -0600 (Mon, 02 Oct 2006) New Revision: 1965 Modified: SQLObject/docs/News.txt Log: Documentation update. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2006-10-02 13:47:51 UTC (rev 1964) +++ SQLObject/docs/News.txt 2006-10-02 13:48:13 UTC (rev 1965) @@ -71,9 +71,25 @@ * Fixed problem with sqlite and threads; connections are no longer shared between threads for sqlite (except for :memory:) +SQLObject 0.7.2 +=============== + +Features & Interface +-------------------- + +Small Features +-------------- + +Bug Fixes +--------- + +* Fixed a number of unicode-related problems with newer MySQLdb. + SQLObject 0.7.1 =============== +Released 25 Sep 2006. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2006-10-02 13:47:54
|
Author: phd
Date: 2006-10-02 07:47:51 -0600 (Mon, 02 Oct 2006)
New Revision: 1964
Modified:
SQLObject/branches/0.7-bugfix/docs/News.txt
SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py
Log:
Removed "SET NAMES" query - MySQLdb sends it itself if there is "charset" parameter.
Modified: SQLObject/branches/0.7-bugfix/docs/News.txt
===================================================================
--- SQLObject/branches/0.7-bugfix/docs/News.txt 2006-10-02 13:47:14 UTC (rev 1963)
+++ SQLObject/branches/0.7-bugfix/docs/News.txt 2006-10-02 13:47:51 UTC (rev 1964)
@@ -7,9 +7,25 @@
.. _start:
+SQLObject 0.7.2
+===============
+
+Features & Interface
+--------------------
+
+Small Features
+--------------
+
+Bug Fixes
+---------
+
+* Fixed a number of unicode-related problems with newer MySQLdb.
+
SQLObject 0.7.1
===============
+Released 25 Sep 2006.
+
Features & Interface
--------------------
Modified: SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py 2006-10-02 13:47:14 UTC (rev 1963)
+++ SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py 2006-10-02 13:47:51 UTC (rev 1964)
@@ -61,8 +61,6 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.dbEncoding:
- conn.query('SET NAMES ' + self.dbEncoding)
return conn
|
|
From: <sub...@co...> - 2006-10-02 13:47:20
|
Author: phd
Date: 2006-10-02 07:47:14 -0600 (Mon, 02 Oct 2006)
New Revision: 1963
Modified:
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
Log:
Removed "SET NAMES" query - MySQLdb sends it itself if there is "charset" parameter.
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-09-30 13:29:55 UTC (rev 1962)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-10-02 13:47:14 UTC (rev 1963)
@@ -61,8 +61,6 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.dbEncoding:
- conn.query('SET NAMES ' + self.dbEncoding)
return conn
|
|
From: <sub...@co...> - 2006-09-30 13:29:57
|
Author: phd
Date: 2006-09-30 07:29:55 -0600 (Sat, 30 Sep 2006)
New Revision: 1962
Modified:
SQLObject/trunk/sqlobject/col.py
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
Log:
Store the charset value from the URI as dbEncoding; merged client_encoding with charset/dbEncoding;
use dbEncoding instead of "ascii" to convert from unicode from MySQLdb.
Modified: SQLObject/trunk/sqlobject/col.py
===================================================================
--- SQLObject/trunk/sqlobject/col.py 2006-09-30 13:29:02 UTC (rev 1961)
+++ SQLObject/trunk/sqlobject/col.py 2006-09-30 13:29:55 UTC (rev 1962)
@@ -513,7 +513,9 @@
if value is None:
return None
if isinstance(value, unicode):
- return value.encode("ascii")
+ connection = state.soObject._connection
+ dbEncoding = getattr(connection, "dbEncoding", None) or "ascii"
+ return value.encode(dbEncoding)
return value
def from_python(self, value, state):
@@ -1314,7 +1316,9 @@
if value is None:
return None
if isinstance(value, unicode):
- value = value.encode("ascii")
+ connection = state.soObject._connection
+ dbEncoding = getattr(connection, "dbEncoding", None) or "ascii"
+ value = value.encode(dbEncoding)
if isinstance(value, str):
return pickle.loads(value)
raise validators.Invalid("expected a pickle string in the PickleCol '%s', got %s %r instead" % \
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-09-30 13:29:02 UTC (rev 1961)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2006-09-30 13:29:55 UTC (rev 1962)
@@ -18,10 +18,6 @@
self.db = db
self.user = user
self.password = password
- if kw.has_key('client_encoding'):
- self.client_encoding = col.popKey(kw, 'client_encoding')
- else:
- self.client_encoding = None
self.kw = {}
if MySQLdb.version_info[0] > 1 or (MySQLdb.version_info[0] == 1 and \
(MySQLdb.version_info[1] > 2 or \
@@ -30,13 +26,17 @@
else:
self.need_unicode = False
for key in ("unix_socket", "init_command",
- "read_default_file", "read_default_group", "charset"):
+ "read_default_file", "read_default_group"):
if key in kw:
self.kw[key] = col.popKey(kw, key)
for key in ("connect_timeout", "compress", "named_pipe", "use_unicode",
"client_flag", "local_infile"):
if key in kw:
self.kw[key] = int(col.popKey(kw, key))
+ if "charset" in kw:
+ self.dbEncoding = self.kw["charset"] = col.popKey(kw, "charset")
+ else:
+ self.dbEncoding = None
if "sqlobject_encoding" in kw:
self.encoding = col.popKey(kw, "sqlobject_encoding")
else:
@@ -61,8 +61,8 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.client_encoding:
- conn.query('SET NAMES ' + self.client_encoding)
+ if self.dbEncoding:
+ conn.query('SET NAMES ' + self.dbEncoding)
return conn
@@ -163,7 +163,7 @@
colClass, kw = self.guessClass(t)
if self.kw['use_unicode'] and colClass is col.StringCol:
colClass = col.UnicodeCol
- if self.client_encoding: kw['dbEncoding'] = self.client_encoding
+ if self.dbEncoding: kw['dbEncoding'] = self.dbEncoding
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['notNone'] = not nullAllowed
if default and t.startswith('int'):
|
|
From: <sub...@co...> - 2006-09-30 13:29:07
|
Author: phd
Date: 2006-09-30 07:29:02 -0600 (Sat, 30 Sep 2006)
New Revision: 1961
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/col.py
SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py
Log:
Store the charset value from the URI as dbEncoding; sent SET NAMES query using dbEncoding;
use dbEncoding instead of "ascii" to convert from unicode from MySQLdb.
Modified: SQLObject/branches/0.7-bugfix/sqlobject/col.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/col.py 2006-09-29 16:03:32 UTC (rev 1960)
+++ SQLObject/branches/0.7-bugfix/sqlobject/col.py 2006-09-30 13:29:02 UTC (rev 1961)
@@ -510,7 +510,9 @@
if value is None:
return None
if isinstance(value, unicode):
- return value.encode("ascii")
+ connection = state.soObject._connection
+ dbEncoding = getattr(connection, "dbEncoding", None) or "ascii"
+ return value.encode(dbEncoding)
return value
def from_python(self, value, state):
@@ -1195,9 +1197,9 @@
if value is None:
return None
if isinstance(value, str):
- module = state.soObject._connection.module
- if module.__name__ in ("sqlite", "pysqlite2.dbapi2"):
- value = module.decode(value)
+ connection = state.soObject._connection
+ if connection.dbName == "sqlite":
+ value = connection.module.decode(value)
return value
if isinstance(value, (buffer_type, state.soObject._connection._binaryType)):
cachedValue = self._cachedValue
@@ -1256,7 +1258,9 @@
if value is None:
return None
if isinstance(value, unicode):
- value = value.encode("ascii")
+ connection = state.soObject._connection
+ dbEncoding = getattr(connection, "dbEncoding", None) or "ascii"
+ value = value.encode(dbEncoding)
if isinstance(value, str):
return pickle.loads(value)
raise validators.Invalid("expected a pickle string in the PickleCol '%s', got %s %r instead" % \
Modified: SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py 2006-09-29 16:03:32 UTC (rev 1960)
+++ SQLObject/branches/0.7-bugfix/sqlobject/mysql/mysqlconnection.py 2006-09-30 13:29:02 UTC (rev 1961)
@@ -26,13 +26,17 @@
else:
self.need_unicode = False
for key in ("unix_socket", "init_command",
- "read_default_file", "read_default_group", "charset"):
+ "read_default_file", "read_default_group"):
if key in kw:
self.kw[key] = col.popKey(kw, key)
for key in ("connect_timeout", "compress", "named_pipe", "use_unicode",
"client_flag", "local_infile"):
if key in kw:
self.kw[key] = int(col.popKey(kw, key))
+ if "charset" in kw:
+ self.dbEncoding = self.kw["charset"] = col.popKey(kw, "charset")
+ else:
+ self.dbEncoding = None
if "sqlobject_encoding" in kw:
self.encoding = col.popKey(kw, "sqlobject_encoding")
else:
@@ -57,6 +61,8 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
+ if self.dbEncoding:
+ conn.query('SET NAMES ' + self.dbEncoding)
return conn
|
|
From: SourceForge.net <no...@so...> - 2006-09-29 17:01:40
|
Bugs item #1567337, was opened at 2006-09-28 14:49 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1567337&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Viktor Ferenczi (complex) Assigned to: Nobody/Anonymous (nobody) Summary: Cannot install on Windows XP and Python 2.5 final Initial Comment: SQLObject 0.7.1, tar.gz version Install Python 2.5 final to D:\Python25 Extract SQLObject-0.7.1.tar.gz Install SQLObject: D:\Viktor\Fejlesztéshez\Python\SQLObject-0.7.1\SQLObject-0.7.1>d:\python25\pytho n setup.py install running install running bdist_egg running egg_info writing requirements to SQLObject.egg-info\requires.txt writing SQLObject.egg-info\PKG-INFO writing top-level names to SQLObject.egg-info\top_level.txt writing dependency_links to SQLObject.egg-info\dependency_links.txt reading manifest file 'SQLObject.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'examples\*.py' warning: no files found matching '*.py' under directory 'tests' writing manifest file 'SQLObject.egg-info\SOURCES.txt' installing library code to build\bdist.win32\egg running install_lib running build_py creating build\bdist.win32\egg creating build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\boundattributes.py -> build\bdist.win32\egg\sqlobjec t copying build\lib\sqlobject\cache.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\classregistry.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\col.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\conftest.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\constraints.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\converters.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\dbconnection.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\declarative.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\firebird copying build\lib\sqlobject\firebird\firebirdconnection.py -> build\bdist.win32\ egg\sqlobject\firebird copying build\lib\sqlobject\firebird\__init__.py -> build\bdist.win32\egg\sqlobj ect\firebird copying build\lib\sqlobject\index.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\inheritance copying build\lib\sqlobject\inheritance\iteration.py -> build\bdist.win32\egg\sq lobject\inheritance copying build\lib\sqlobject\inheritance\__init__.py -> build\bdist.win32\egg\sql object\inheritance copying build\lib\sqlobject\joins.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\main.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\manager copying build\lib\sqlobject\manager\command.py -> build\bdist.win32\egg\sqlobjec t\manager copying build\lib\sqlobject\manager\__init__.py -> build\bdist.win32\egg\sqlobje ct\manager creating build\bdist.win32\egg\sqlobject\maxdb copying build\lib\sqlobject\maxdb\maxdbconnection.py -> build\bdist.win32\egg\sq lobject\maxdb copying build\lib\sqlobject\maxdb\__init__.py -> build\bdist.win32\egg\sqlobject \maxdb creating build\bdist.win32\egg\sqlobject\mssql copying build\lib\sqlobject\mssql\mssqlconnection.py -> build\bdist.win32\egg\sq lobject\mssql copying build\lib\sqlobject\mssql\__init__.py -> build\bdist.win32\egg\sqlobject \mssql creating build\bdist.win32\egg\sqlobject\mysql copying build\lib\sqlobject\mysql\mysqlconnection.py -> build\bdist.win32\egg\sq lobject\mysql copying build\lib\sqlobject\mysql\__init__.py -> build\bdist.win32\egg\sqlobject \mysql creating build\bdist.win32\egg\sqlobject\postgres copying build\lib\sqlobject\postgres\pgconnection.py -> build\bdist.win32\egg\sq lobject\postgres copying build\lib\sqlobject\postgres\__init__.py -> build\bdist.win32\egg\sqlobj ect\postgres copying build\lib\sqlobject\sqlbuilder.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\sqlite copying build\lib\sqlobject\sqlite\sqliteconnection.py -> build\bdist.win32\egg\ sqlobject\sqlite copying build\lib\sqlobject\sqlite\__init__.py -> build\bdist.win32\egg\sqlobjec t\sqlite copying build\lib\sqlobject\sresults.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\styles.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\sybase copying build\lib\sqlobject\sybase\sybaseconnection.py -> build\bdist.win32\egg\ sqlobject\sybase copying build\lib\sqlobject\sybase\__init__.py -> build\bdist.win32\egg\sqlobjec t\sybase creating build\bdist.win32\egg\sqlobject\util copying build\lib\sqlobject\util\backports.py -> build\bdist.win32\egg\sqlobject \util copying build\lib\sqlobject\util\moduleloader.py -> build\bdist.win32\egg\sqlobj ect\util copying build\lib\sqlobject\util\threadinglocal.py -> build\bdist.win32\egg\sqlo bject\util copying build\lib\sqlobject\util\__init__.py -> build\bdist.win32\egg\sqlobject\ util copying build\lib\sqlobject\__init__.py -> build\bdist.win32\egg\sqlobject byte-compiling build\bdist.win32\egg\sqlobject\boundattributes.py to boundattrib utes.pyc byte-compiling build\bdist.win32\egg\sqlobject\cache.py to cache.pyc byte-compiling build\bdist.win32\egg\sqlobject\classregistry.py to classregistry .pyc byte-compiling build\bdist.win32\egg\sqlobject\col.py to col.pyc byte-compiling build\bdist.win32\egg\sqlobject\conftest.py to conftest.pyc byte-compiling build\bdist.win32\egg\sqlobject\constraints.py to constraints.pyc byte-compiling build\bdist.win32\egg\sqlobject\converters.py to converters.pyc byte-compiling build\bdist.win32\egg\sqlobject\dbconnection.py to dbconnection.p yc byte-compiling build\bdist.win32\egg\sqlobject\declarative.py to declarative.pyc byte-compiling build\bdist.win32\egg\sqlobject\firebird\firebirdconnection.py to firebirdconnection.pyc byte-compiling build\bdist.win32\egg\sqlobject\firebird\__init__.py to __init__. pyc byte-compiling build\bdist.win32\egg\sqlobject\index.py to index.pyc byte-compiling build\bdist.win32\egg\sqlobject\inheritance\iteration.py to itera tion.pyc byte-compiling build\bdist.win32\egg\sqlobject\inheritance\__init__.py to __init __.pyc byte-compiling build\bdist.win32\egg\sqlobject\joins.py to joins.pyc byte-compiling build\bdist.win32\egg\sqlobject\main.py to main.pyc byte-compiling build\bdist.win32\egg\sqlobject\manager\command.py to command.pyc byte-compiling build\bdist.win32\egg\sqlobject\manager\__init__.py to __init__.p yc byte-compiling build\bdist.win32\egg\sqlobject\maxdb\maxdbconnection.py to maxdb connection.pyc byte-compiling build\bdist.win32\egg\sqlobject\maxdb\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\mssql\mssqlconnection.py to mssql connection.pyc byte-compiling build\bdist.win32\egg\sqlobject\mssql\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\mysql\mysqlconnection.py to mysql connection.pyc byte-compiling build\bdist.win32\egg\sqlobject\mysql\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\postgres\pgconnection.py to pgcon nection.pyc byte-compiling build\bdist.win32\egg\sqlobject\postgres\__init__.py to __init__. pyc byte-compiling build\bdist.win32\egg\sqlobject\sqlbuilder.py to sqlbuilder.pyc byte-compiling build\bdist.win32\egg\sqlobject\sqlite\sqliteconnection.py to sql iteconnection.pyc byte-compiling build\bdist.win32\egg\sqlobject\sqlite\__init__.py to __init__.py c byte-compiling build\bdist.win32\egg\sqlobject\sresults.py to sresults.pyc byte-compiling build\bdist.win32\egg\sqlobject\styles.py to styles.pyc byte-compiling build\bdist.win32\egg\sqlobject\sybase\sybaseconnection.py to syb aseconnection.pyc byte-compiling build\bdist.win32\egg\sqlobject\sybase\__init__.py to __init__.py c byte-compiling build\bdist.win32\egg\sqlobject\util\backports.py to backports.py c byte-compiling build\bdist.win32\egg\sqlobject\util\moduleloader.py to moduleloa der.pyc byte-compiling build\bdist.win32\egg\sqlobject\util\threadinglocal.py to threadi nglocal.pyc byte-compiling build\bdist.win32\egg\sqlobject\util\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\__init__.py to __init__.pyc creating build\bdist.win32\egg\EGG-INFO installing scripts to build\bdist.win32\egg\EGG-INFO\scripts running install_scripts running build_scripts creating build\bdist.win32\egg\EGG-INFO\scripts copying build\scripts-2.5\sqlobject-admin -> build\bdist.win32\egg\EGG-INFO\scri pts copying SQLObject.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO copying SQLObject.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO copying SQLObject.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INF O copying SQLObject.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO copying SQLObject.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO zip_safe flag not set; analyzing archive contents... sqlobject.classregistry: module references __file__ sqlobject.manager.command: module references __file__ creating 'dist\SQLObject-0.7.1-py2.5.egg' and adding 'build\bdist.win32\egg' to it removing 'build\bdist.win32\egg' (and everything under it) Processing SQLObject-0.7.1-py2.5.egg removing 'd:\python25\lib\site-packages\SQLObject-0.7.1-py2.5.egg' (and everythi ng under it) creating d:\python25\lib\site-packages\SQLObject-0.7.1-py2.5.egg Extracting SQLObject-0.7.1-py2.5.egg to d:\python25\lib\site-packages SQLObject 0.7.1 is already the active version in easy-install.pth Installing sqlobject-admin script to d:\python25\Scripts Installed d:\python25\lib\site-packages\sqlobject-0.7.1-py2.5.egg Processing dependencies for SQLObject==0.7.1 Searching for FormEncode>=0.2.2 Reading http://www.python.org/pypi/FormEncode/ Reading http://formencode.org Reading http://www.python.org/pypi/FormEncode/0.5.1 Best match: FormEncode 0.5.1 Downloading http://cheeseshop.python.org/packages/source/F/FormEncode/FormEncode -0.5.1.tar.gz#md5=f240217726f1962762bcf889a16f4450 Processing FormEncode-0.5.1.tar.gz Running FormEncode-0.5.1\setup.py -q bdist_egg --dist-dir c:\docume~1\fviktor\lo cals~1\temp\easy_install-cxtg_z\FormEncode-0.5.1\egg-dist-tmp-bj0-wp warning: no files found matching '*.py' under directory '.' Traceback (most recent call last): File "setup.py", line 67, in <module> 'sapdb': ['sapdb'], File "D:\Python25\Lib\distutils\core.py", line 151, in setup dist.run_commands() File "D:\Python25\Lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "D:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\install.py", line 76, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\install.py", line 100, in do_egg_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 211, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 427, in easy_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 473, in install_item File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 519, in process_distribution File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\pkg_resources.p y", line 481, in resolve File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\pkg_resources.p y", line 717, in best_match File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\pkg_resources.p y", line 729, in obtain File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 446, in easy_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 471, in install_item File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 655, in install_eggs File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 930, in build_and_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 919, in run_setup File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\sand box.py", line 27, in run_setup File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\sand box.py", line 63, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\sand box.py", line 29, in <lambda> File "setup.py", line 27, in <module> instances, and columns as attributes. File "D:\Python25\Lib\distutils\core.py", line 151, in setup dist.run_commands() File "D:\Python25\Lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "D:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\bdist_egg.py", line 167, in run File "D:\Python25\Lib\distutils\cmd.py", line 333, in run_command self.distribution.run_command(command) File "D:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\egg_info.py", line 171, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\egg_info.py", line 252, in find_sources File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\egg_info.py", line 308, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\sdist.py", line 157, in read_template File "D:\Python25\Lib\distutils\command\sdist.py", line 335, in read_template self.filelist.process_template_line(line) File "D:\Python25\Lib\distutils\filelist.py", line 130, in process_template_li ne (action, patterns, dir, dir_pattern) = self._parse_template_line(line) File "D:\Python25\Lib\distutils\filelist.py", line 105, in _parse_template_lin e dir = convert_path(words[1]) File "D:\Python25\Lib\distutils\util.py", line 140, in convert_path raise ValueError, "path '%s' cannot end with '/'" % pathname ValueError: path 'docs/' cannot end with '/' ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-09-29 10:01 Message: Logged In: NO This is a Windows/2.5/FormEncode/MANIFEST.in problem. If you can do "easy_install FormEncode==dev" that should fix it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1567337&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-09-29 15:07:44
|
Bugs item #1378208, was opened at 2005-12-11 20:32 Message generated for change (Comment added) made by sergeych You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1378208&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: SQLite Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SQLite INSERT is painfully slow... Initial Comment: Hello, I wondered why creation of SQLObjects is painfully slow on SQLite. I came up to the following: 1) If I use connectionFromUri, and then extract cursor by calling sqlhub.processConnection._conn.cursor(), I still get EXTREMELY slow INSERTS (10-20 per second) when i run .execute() method of the cursor with just one argument (string). 2) If I use the following, it is very fast (of the : import sqlite, sys s=sqlite.Connection(sys.argv[1]) c=s.cursor() lines=[] for line in open(sys.argv[2], "r"): lines.append(line) try: if line[-2]==";": c.execute(''.join(lines)) lines=[] sys.stderr.write(".") except: pass -- mg...@gm... ---------------------------------------------------------------------- Comment By: Sergey Chernov (sergeych) Date: 2006-09-29 19:07 Message: Logged In: YES user_id=834669 -- can't use SQLobject because of it. Found that it is caused by SQLObject flushing changes too often; as for bulk insertions we have to use SQLite caching abilities maybe together with transactoins; there should be a way to dealy SQLObject calling SQLite.commit() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1378208&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-09-29 10:59:37
|
Bugs item #1567633, was opened at 2006-09-29 12:59 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1567633&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: MySQL Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Viktor Ferenczi (complex) Assigned to: Nobody/Anonymous (nobody) Summary: KeyError when creating table from MySQL database Initial Comment: Use Python 2.4.3 (MSI installer) and SQLObject 0.7.1 installed with python setup.py install from tar.gz on WinXP. Connect to MySQL 4.1.11 server on another machine and create the table in a database (read on below): -- phpMyAdmin SQL Dump -- version 2.6.2-Debian-3sarge1 -- http://www.phpmyadmin.net -- Hoszt: localhost -- Létrehozás ideje: 2006. Szept 29. 12:53 -- Szerver verzió: 4.1.11 -- PHP Verzió: 4.3.10-16 CREATE TABLE `termek` ( `sorszam` int(11) NOT NULL auto_increment, `rogzitette` int(11) NOT NULL default '0', `felvitel` datetime NOT NULL default '0000-00-00 00:00:00', `kategoria` int(11) NOT NULL default '0', `nev` varchar(200) NOT NULL default '', `prnev` varchar(200) NOT NULL default '', `prnevetikett` varchar(200) default NULL, `kod` int(11) default NULL, `szjszam` varchar(20) default NULL, `vamszam` varchar(16) default NULL, `gyarto` int(11) default NULL, `tomeg` float NOT NULL default '0', `nettobeszerzesiar` decimal(14,2) default NULL, `nettoegysegar` decimal(14,2) default NULL, `afakulcs` decimal(5,2) NOT NULL default '20.00', `ajandek` enum('Y','N') NOT NULL default 'N', `alaptermek` int(11) default NULL, `allapot` enum('aktiv','inaktiv','torolt') NOT NULL default 'aktiv', PRIMARY KEY (`sorszam`), KEY `rogzitette` (`rogzitette`), KEY `nev` (`nev`), KEY `ajandek` (`ajandek`), KEY `kod` (`kod`), KEY `gyarto` (`gyarto`), KEY `kategoria` (`kategoria`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Create a class from the database: __connection__='mysql://user:pass@sql_server_host/dbname' import sqlobject as SO class Termek(SO.SQLObject): class sqlmeta: fromDatabase=True idName='sorszam' You should get the following exception: Traceback (most recent call last): File "rendeles-import.py", line 25, in ? class Termek(SO.SQLObject): File "c:\python24\lib\site-packages\SQLObject-0.7.1-py2.4.egg\sqlobject\declarative.py", line 109, in __new__ cls.__classinit__(cls, new_attrs) File "c:\python24\lib\site-packages\SQLObject-0.7.1-py2.4.egg\sqlobject\main.py", line 777, in __classinit__ cls.sqlmeta.addColumnsFromDatabase() File "c:\python24\lib\site-packages\SQLObject-0.7.1-py2.4.egg\sqlobject\main.py", line 422, in addColumnsFromDatabase for columnDef in conn.columnsFromSchema(sqlmeta.table, soClass): File "c:\python24\lib\site-packages\SQLObject-0.7.1-py2.4.egg\sqlobject\mysql\mysqlconnection.py", line 153, in columnsFromSchema if self.kw['use_unicode'] and colClass is col.StringCol: KeyError: 'use_unicode' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1567633&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-09-28 21:49:09
|
Bugs item #1567337, was opened at 2006-09-28 23:49 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1567337&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Viktor Ferenczi (complex) Assigned to: Nobody/Anonymous (nobody) Summary: Cannot install on Windows XP and Python 2.5 final Initial Comment: SQLObject 0.7.1, tar.gz version Install Python 2.5 final to D:\Python25 Extract SQLObject-0.7.1.tar.gz Install SQLObject: D:\Viktor\Fejlesztéshez\Python\SQLObject-0.7.1\SQLObject-0.7.1>d:\python25\pytho n setup.py install running install running bdist_egg running egg_info writing requirements to SQLObject.egg-info\requires.txt writing SQLObject.egg-info\PKG-INFO writing top-level names to SQLObject.egg-info\top_level.txt writing dependency_links to SQLObject.egg-info\dependency_links.txt reading manifest file 'SQLObject.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'examples\*.py' warning: no files found matching '*.py' under directory 'tests' writing manifest file 'SQLObject.egg-info\SOURCES.txt' installing library code to build\bdist.win32\egg running install_lib running build_py creating build\bdist.win32\egg creating build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\boundattributes.py -> build\bdist.win32\egg\sqlobjec t copying build\lib\sqlobject\cache.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\classregistry.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\col.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\conftest.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\constraints.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\converters.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\dbconnection.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\declarative.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\firebird copying build\lib\sqlobject\firebird\firebirdconnection.py -> build\bdist.win32\ egg\sqlobject\firebird copying build\lib\sqlobject\firebird\__init__.py -> build\bdist.win32\egg\sqlobj ect\firebird copying build\lib\sqlobject\index.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\inheritance copying build\lib\sqlobject\inheritance\iteration.py -> build\bdist.win32\egg\sq lobject\inheritance copying build\lib\sqlobject\inheritance\__init__.py -> build\bdist.win32\egg\sql object\inheritance copying build\lib\sqlobject\joins.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\main.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\manager copying build\lib\sqlobject\manager\command.py -> build\bdist.win32\egg\sqlobjec t\manager copying build\lib\sqlobject\manager\__init__.py -> build\bdist.win32\egg\sqlobje ct\manager creating build\bdist.win32\egg\sqlobject\maxdb copying build\lib\sqlobject\maxdb\maxdbconnection.py -> build\bdist.win32\egg\sq lobject\maxdb copying build\lib\sqlobject\maxdb\__init__.py -> build\bdist.win32\egg\sqlobject \maxdb creating build\bdist.win32\egg\sqlobject\mssql copying build\lib\sqlobject\mssql\mssqlconnection.py -> build\bdist.win32\egg\sq lobject\mssql copying build\lib\sqlobject\mssql\__init__.py -> build\bdist.win32\egg\sqlobject \mssql creating build\bdist.win32\egg\sqlobject\mysql copying build\lib\sqlobject\mysql\mysqlconnection.py -> build\bdist.win32\egg\sq lobject\mysql copying build\lib\sqlobject\mysql\__init__.py -> build\bdist.win32\egg\sqlobject \mysql creating build\bdist.win32\egg\sqlobject\postgres copying build\lib\sqlobject\postgres\pgconnection.py -> build\bdist.win32\egg\sq lobject\postgres copying build\lib\sqlobject\postgres\__init__.py -> build\bdist.win32\egg\sqlobj ect\postgres copying build\lib\sqlobject\sqlbuilder.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\sqlite copying build\lib\sqlobject\sqlite\sqliteconnection.py -> build\bdist.win32\egg\ sqlobject\sqlite copying build\lib\sqlobject\sqlite\__init__.py -> build\bdist.win32\egg\sqlobjec t\sqlite copying build\lib\sqlobject\sresults.py -> build\bdist.win32\egg\sqlobject copying build\lib\sqlobject\styles.py -> build\bdist.win32\egg\sqlobject creating build\bdist.win32\egg\sqlobject\sybase copying build\lib\sqlobject\sybase\sybaseconnection.py -> build\bdist.win32\egg\ sqlobject\sybase copying build\lib\sqlobject\sybase\__init__.py -> build\bdist.win32\egg\sqlobjec t\sybase creating build\bdist.win32\egg\sqlobject\util copying build\lib\sqlobject\util\backports.py -> build\bdist.win32\egg\sqlobject \util copying build\lib\sqlobject\util\moduleloader.py -> build\bdist.win32\egg\sqlobj ect\util copying build\lib\sqlobject\util\threadinglocal.py -> build\bdist.win32\egg\sqlo bject\util copying build\lib\sqlobject\util\__init__.py -> build\bdist.win32\egg\sqlobject\ util copying build\lib\sqlobject\__init__.py -> build\bdist.win32\egg\sqlobject byte-compiling build\bdist.win32\egg\sqlobject\boundattributes.py to boundattrib utes.pyc byte-compiling build\bdist.win32\egg\sqlobject\cache.py to cache.pyc byte-compiling build\bdist.win32\egg\sqlobject\classregistry.py to classregistry .pyc byte-compiling build\bdist.win32\egg\sqlobject\col.py to col.pyc byte-compiling build\bdist.win32\egg\sqlobject\conftest.py to conftest.pyc byte-compiling build\bdist.win32\egg\sqlobject\constraints.py to constraints.pyc byte-compiling build\bdist.win32\egg\sqlobject\converters.py to converters.pyc byte-compiling build\bdist.win32\egg\sqlobject\dbconnection.py to dbconnection.p yc byte-compiling build\bdist.win32\egg\sqlobject\declarative.py to declarative.pyc byte-compiling build\bdist.win32\egg\sqlobject\firebird\firebirdconnection.py to firebirdconnection.pyc byte-compiling build\bdist.win32\egg\sqlobject\firebird\__init__.py to __init__. pyc byte-compiling build\bdist.win32\egg\sqlobject\index.py to index.pyc byte-compiling build\bdist.win32\egg\sqlobject\inheritance\iteration.py to itera tion.pyc byte-compiling build\bdist.win32\egg\sqlobject\inheritance\__init__.py to __init __.pyc byte-compiling build\bdist.win32\egg\sqlobject\joins.py to joins.pyc byte-compiling build\bdist.win32\egg\sqlobject\main.py to main.pyc byte-compiling build\bdist.win32\egg\sqlobject\manager\command.py to command.pyc byte-compiling build\bdist.win32\egg\sqlobject\manager\__init__.py to __init__.p yc byte-compiling build\bdist.win32\egg\sqlobject\maxdb\maxdbconnection.py to maxdb connection.pyc byte-compiling build\bdist.win32\egg\sqlobject\maxdb\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\mssql\mssqlconnection.py to mssql connection.pyc byte-compiling build\bdist.win32\egg\sqlobject\mssql\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\mysql\mysqlconnection.py to mysql connection.pyc byte-compiling build\bdist.win32\egg\sqlobject\mysql\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\postgres\pgconnection.py to pgcon nection.pyc byte-compiling build\bdist.win32\egg\sqlobject\postgres\__init__.py to __init__. pyc byte-compiling build\bdist.win32\egg\sqlobject\sqlbuilder.py to sqlbuilder.pyc byte-compiling build\bdist.win32\egg\sqlobject\sqlite\sqliteconnection.py to sql iteconnection.pyc byte-compiling build\bdist.win32\egg\sqlobject\sqlite\__init__.py to __init__.py c byte-compiling build\bdist.win32\egg\sqlobject\sresults.py to sresults.pyc byte-compiling build\bdist.win32\egg\sqlobject\styles.py to styles.pyc byte-compiling build\bdist.win32\egg\sqlobject\sybase\sybaseconnection.py to syb aseconnection.pyc byte-compiling build\bdist.win32\egg\sqlobject\sybase\__init__.py to __init__.py c byte-compiling build\bdist.win32\egg\sqlobject\util\backports.py to backports.py c byte-compiling build\bdist.win32\egg\sqlobject\util\moduleloader.py to moduleloa der.pyc byte-compiling build\bdist.win32\egg\sqlobject\util\threadinglocal.py to threadi nglocal.pyc byte-compiling build\bdist.win32\egg\sqlobject\util\__init__.py to __init__.pyc byte-compiling build\bdist.win32\egg\sqlobject\__init__.py to __init__.pyc creating build\bdist.win32\egg\EGG-INFO installing scripts to build\bdist.win32\egg\EGG-INFO\scripts running install_scripts running build_scripts creating build\bdist.win32\egg\EGG-INFO\scripts copying build\scripts-2.5\sqlobject-admin -> build\bdist.win32\egg\EGG-INFO\scri pts copying SQLObject.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO copying SQLObject.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO copying SQLObject.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INF O copying SQLObject.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO copying SQLObject.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO zip_safe flag not set; analyzing archive contents... sqlobject.classregistry: module references __file__ sqlobject.manager.command: module references __file__ creating 'dist\SQLObject-0.7.1-py2.5.egg' and adding 'build\bdist.win32\egg' to it removing 'build\bdist.win32\egg' (and everything under it) Processing SQLObject-0.7.1-py2.5.egg removing 'd:\python25\lib\site-packages\SQLObject-0.7.1-py2.5.egg' (and everythi ng under it) creating d:\python25\lib\site-packages\SQLObject-0.7.1-py2.5.egg Extracting SQLObject-0.7.1-py2.5.egg to d:\python25\lib\site-packages SQLObject 0.7.1 is already the active version in easy-install.pth Installing sqlobject-admin script to d:\python25\Scripts Installed d:\python25\lib\site-packages\sqlobject-0.7.1-py2.5.egg Processing dependencies for SQLObject==0.7.1 Searching for FormEncode>=0.2.2 Reading http://www.python.org/pypi/FormEncode/ Reading http://formencode.org Reading http://www.python.org/pypi/FormEncode/0.5.1 Best match: FormEncode 0.5.1 Downloading http://cheeseshop.python.org/packages/source/F/FormEncode/FormEncode -0.5.1.tar.gz#md5=f240217726f1962762bcf889a16f4450 Processing FormEncode-0.5.1.tar.gz Running FormEncode-0.5.1\setup.py -q bdist_egg --dist-dir c:\docume~1\fviktor\lo cals~1\temp\easy_install-cxtg_z\FormEncode-0.5.1\egg-dist-tmp-bj0-wp warning: no files found matching '*.py' under directory '.' Traceback (most recent call last): File "setup.py", line 67, in <module> 'sapdb': ['sapdb'], File "D:\Python25\Lib\distutils\core.py", line 151, in setup dist.run_commands() File "D:\Python25\Lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "D:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\install.py", line 76, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\install.py", line 100, in do_egg_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 211, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 427, in easy_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 473, in install_item File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 519, in process_distribution File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\pkg_resources.p y", line 481, in resolve File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\pkg_resources.p y", line 717, in best_match File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\pkg_resources.p y", line 729, in obtain File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 446, in easy_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 471, in install_item File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 655, in install_eggs File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 930, in build_and_install File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\easy_install.py", line 919, in run_setup File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\sand box.py", line 27, in run_setup File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\sand box.py", line 63, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\sand box.py", line 29, in <lambda> File "setup.py", line 27, in <module> instances, and columns as attributes. File "D:\Python25\Lib\distutils\core.py", line 151, in setup dist.run_commands() File "D:\Python25\Lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "D:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\bdist_egg.py", line 167, in run File "D:\Python25\Lib\distutils\cmd.py", line 333, in run_command self.distribution.run_command(command) File "D:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\egg_info.py", line 171, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\egg_info.py", line 252, in find_sources File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\egg_info.py", line 308, in run File "d:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\setuptools\comm and\sdist.py", line 157, in read_template File "D:\Python25\Lib\distutils\command\sdist.py", line 335, in read_template self.filelist.process_template_line(line) File "D:\Python25\Lib\distutils\filelist.py", line 130, in process_template_li ne (action, patterns, dir, dir_pattern) = self._parse_template_line(line) File "D:\Python25\Lib\distutils\filelist.py", line 105, in _parse_template_lin e dir = convert_path(words[1]) File "D:\Python25\Lib\distutils\util.py", line 140, in convert_path raise ValueError, "path '%s' cannot end with '/'" % pathname ValueError: path 'docs/' cannot end with '/' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1567337&group_id=74338 |