Author: ronaldoussoren
Date: Sat Apr 11 04:18:45 2009
New Revision: 2140
Log:
* All tests pass
* All examples tested with PyObjC 2.2
* Add comment to _convenience.py to note that the __getattr__/__setattr__
hooks do not work on Leopard due to implementation changes in CoreData
* Upgrade version to 2.2b1
Modified:
trunk/pyobjc/pyobjc-framework-CoreData/Lib/CoreData/_convenience.py
trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_managedkvo.py
trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_nsmanagedobject.py
trunk/pyobjc/pyobjc-framework-CoreData/setup.py
Modified: trunk/pyobjc/pyobjc-framework-CoreData/Lib/CoreData/_convenience.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-CoreData/Lib/CoreData/_convenience.py (original)
+++ trunk/pyobjc/pyobjc-framework-CoreData/Lib/CoreData/_convenience.py Sat Apr 11 04:18:45 2009
@@ -1,5 +1,10 @@
"""
This adds some usefull conveniences to NSManagedObject and subclasses thereof
+
+These conveniences try to enable KVO by default on NSManagedObject instances,
+this no longer works on Leopard due to the way NSManagedObject is implemented
+there (it generates accessor methods at runtime, which interferes with the
+implementation in this file).
"""
__all__ = ()
from objc import addConvenienceForClass
Modified: trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_managedkvo.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_managedkvo.py (original)
+++ trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_managedkvo.py Sat Apr 11 04:18:45 2009
@@ -70,6 +70,7 @@
def setUp(self):
self.entity = CoreData.NSEntityDescription.new()
self.entity.setName_('TestObject')
+ self.entity.setManagedObjectClassName_('CoreDataTestObject')
self.attribute = CoreData.NSAttributeDescription.new()
self.attribute.setName_('testAttribute')
@@ -95,21 +96,21 @@
managedObject.setValue_forKey_(testValue, u'testAttribute')
self.assertEquals(testValue, managedObject.valueForKey_(u'testAttribute'))
- self.assertEquals(testValue, managedObject.testAttribute)
+ self.assertEquals(testValue, managedObject._.testAttribute)
testValue = u'BobFred'
managedObject.setValue_forKey_(testValue, u'testAttribute')
self.assertEquals(testValue, managedObject.valueForKey_(u'testAttribute'))
- self.assertEquals(testValue, managedObject.testAttribute)
+ self.assertEquals(testValue, managedObject._.testAttribute)
self.assert_('testAttribute' not in managedObject.__dict__)
testValue = u'Zebras have long legs.'
- managedObject.testAttribute = testValue
+ managedObject._.testAttribute = testValue
self.assertEquals(testValue, managedObject.valueForKey_(u'testAttribute'))
- self.assertEquals(testValue, managedObject.testAttribute)
+ self.assertEquals(testValue, managedObject._.testAttribute)
def testPythonicAttribute(self):
managedObject = CoreDataTestObject.alloc().initWithEntity_insertIntoManagedObjectContext_(self.entity, self.managedObjectContext)
Modified: trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_nsmanagedobject.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_nsmanagedobject.py (original)
+++ trunk/pyobjc/pyobjc-framework-CoreData/PyObjCTest/test_nsmanagedobject.py Sat Apr 11 04:18:45 2009
@@ -4,10 +4,11 @@
class TestNSManagedObject (TestCase):
def testMethods(self):
- self.failUnlessResultIsBOOL(NSManagedObject.isInserted)
- self.failUnlessResultIsBOOL(NSManagedObject.isUpdated)
- self.failUnlessResultIsBOOL(NSManagedObject.isDeleted)
- self.failUnlessResultIsBOOL(NSManagedObject.isFault)
+ o = NSManagedObject.alloc().init()
+ self.failUnlessResultIsBOOL(o.isInserted)
+ self.failUnlessResultIsBOOL(o.isUpdated)
+ self.failUnlessResultIsBOOL(o.isDeleted)
+ self.failUnlessResultIsBOOL(o.isFault)
self.failUnlessResultIsBOOL(NSManagedObject.validateValue_forKey_error_)
self.failUnlessArgIsOut(NSManagedObject.validateValue_forKey_error_, 2)
Modified: trunk/pyobjc/pyobjc-framework-CoreData/setup.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-CoreData/setup.py (original)
+++ trunk/pyobjc/pyobjc-framework-CoreData/setup.py Sat Apr 11 04:18:45 2009
@@ -18,7 +18,7 @@
setup(
name='pyobjc-framework-CoreData',
- version='2.2b1',
+ version='2.2b2',
description = "Wrappers for the framework CoreData on Mac OS X",
long_description = __doc__,
author='Ronald Oussoren',
@@ -31,7 +31,7 @@
],
install_requires = [
'pyobjc-core>=2.2b1',
- 'pyobjc-framework-Cocoa>=2.2b1',
+ 'pyobjc-framework-Cocoa>=2.2b2',
],
dependency_links = [],
package_data = {
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.