[Commits] (vajda) - rewrote UUID as a python type extension, 100% C code

commits at osafoundation.org commits at osafoundation.org
Fri Mar 18 13:41:57 PST 2005


Commit by: vajda
Modified files:
chandler/Makefile 1.89 1.90
chandler/application/Application.py 1.310 1.311
chandler/parcels/osaf/contentmodel/ItemCollection.py 1.40 1.41
chandler/parcels/osaf/contentmodel/contacts/Contacts.py 1.16 1.17
chandler/parcels/osaf/contentmodel/mail/Mail.py 1.59 1.60
chandler/parcels/osaf/framework/blocks/Block.py 1.102 1.103
chandler/parcels/osaf/framework/blocks/ContainerBlocks.py 1.151 1.152
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.191 1.192
chandler/parcels/osaf/framework/sharing/ICalendar.py 1.15 1.16
chandler/parcels/osaf/framework/sharing/Sharing.py 1.85 1.86
chandler/parcels/osaf/framework/sharing/WebDAV.py 1.15 1.16
chandler/parcels/osaf/framework/wakeup/WakeupCaller.py 1.14 1.15
chandler/parcels/osaf/mail/imap.py 1.45 1.46
chandler/parcels/osaf/mail/message.py 1.48 1.49
chandler/parcels/osaf/mail/sharing.py 1.24 1.25
chandler/parcels/osaf/mail/smtp.py 1.33 1.34
chandler/repository/__hardhat__.py 1.7 1.8
chandler/repository/item/Indexes.py 1.10 1.11
chandler/repository/item/Item.py 1.200 1.201
chandler/repository/item/ItemHandler.py 1.64 1.65
chandler/repository/item/PersistentCollections.py 1.24 1.25
chandler/repository/item/Query.py 1.12 1.13
chandler/repository/item/RefCollections.py 1.13 1.14
chandler/repository/item/Values.py 1.41 1.42
chandler/repository/item/ItemError.py 1.8 None
chandler/repository/packs/schema/model/Query.kind 1.3 1.4
chandler/repository/packs/schema/model/UUID.type 1.5 1.6
chandler/repository/persistence/DBContainer.py 1.36 1.37
chandler/repository/persistence/DBItemIO.py 1.6 1.7
chandler/repository/persistence/DBLob.py 1.3 1.4
chandler/repository/persistence/DBRefs.py 1.3 1.4
chandler/repository/persistence/DBRepository.py 1.7 1.8
chandler/repository/persistence/DBRepositoryView.py 1.10 1.11
chandler/repository/persistence/FileContainer.py 1.18 1.19
chandler/repository/persistence/PackHandler.py 1.21 1.22
chandler/repository/persistence/Repository.py 1.96 1.97
chandler/repository/persistence/RepositoryError.py 1.15 1.16
chandler/repository/persistence/RepositoryView.py 1.35 1.36
chandler/repository/query/Query.py 1.38 1.39
chandler/repository/query/tests/TestNotification.py 1.22 1.23
chandler/repository/remote/CloudFilter.py 1.7 1.8
chandler/repository/remote/ItemFilter.py 1.6 1.7
chandler/repository/remote/RemoteFilter.py 1.12 1.13
chandler/repository/remote/RemoteRepository.py 1.11 1.12
chandler/repository/remote/RepositoryServer.py 1.4 1.5
chandler/repository/remote/Transport.py 1.7 1.8
chandler/repository/schema/Alias.py 1.11 1.12
chandler/repository/schema/Attribute.py 1.18 1.19
chandler/repository/schema/Cloud.py 1.23 1.24
chandler/repository/schema/Kind.py 1.104 1.105
chandler/repository/schema/TypeHandler.py 1.1 1.2
chandler/repository/schema/Types.py 1.78 1.79
chandler/repository/tests/TestIndexes.py 1.3 1.4
chandler/repository/tests/TestMixins.py 1.6 1.7
chandler/repository/tests/TestRedirectToOrdering.py 1.3 1.4
chandler/repository/tests/TestText.py 1.21 1.22
chandler/repository/tests/TestTypes.py 1.8 1.9
chandler/repository/util/LinkedMap.py 1.26 1.27
chandler/repository/util/Path.py 1.13 1.14
chandler/repository/util/SingleRef.py 1.8 1.9
chandler/repository/util/SkipList.py 1.4 1.5

Log message:
   - rewrote UUID as a python type extension, 100% C code
   - import for uuid now is from chandlerdb.util.uuid import UUID
   - improved Kind.getAttribute() to use descriptor cache
   - fixed bug with None type names in ItemHandler.py
   - Monitors singleton now pinned
   - LinkedMap.link, SkipList.node/point now use __slots__
   - indexing now creates plain text reader with replace=True
   - mapChanges now checks view's FDIRTY flag when freshOnly is True
   - implemented C Descriptor type with __get__
   - added CItem, C type parent of Item, moved access counting to C
   - moved status, flags and test methods to CItem
   - fixed fix for bug 2625
   - moved ItemError.py to chandlerdb.item
   - speeded up getOtherName(), _getRef()


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/Makefile.diff?r1=text&tr1=1.89&r2=text&tr2=1.90
http://cvs.osafoundation.org/index.cgi/chandler/application/Application.py.diff?r1=text&tr1=1.310&r2=text&tr2=1.311
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/ItemCollection.py.diff?r1=text&tr1=1.40&r2=text&tr2=1.41
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/contacts/Contacts.py.diff?r1=text&tr1=1.16&r2=text&tr2=1.17
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/mail/Mail.py.diff?r1=text&tr1=1.59&r2=text&tr2=1.60
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/Block.py.diff?r1=text&tr1=1.102&r2=text&tr2=1.103
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ContainerBlocks.py.diff?r1=text&tr1=1.151&r2=text&tr2=1.152
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.191&r2=text&tr2=1.192
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/ICalendar.py.diff?r1=text&tr1=1.15&r2=text&tr2=1.16
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/Sharing.py.diff?r1=text&tr1=1.85&r2=text&tr2=1.86
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/WebDAV.py.diff?r1=text&tr1=1.15&r2=text&tr2=1.16
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/wakeup/WakeupCaller.py.diff?r1=text&tr1=1.14&r2=text&tr2=1.15
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/mail/imap.py.diff?r1=text&tr1=1.45&r2=text&tr2=1.46
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/mail/message.py.diff?r1=text&tr1=1.48&r2=text&tr2=1.49
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/mail/sharing.py.diff?r1=text&tr1=1.24&r2=text&tr2=1.25
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/mail/smtp.py.diff?r1=text&tr1=1.33&r2=text&tr2=1.34
http://cvs.osafoundation.org/index.cgi/chandler/repository/__hardhat__.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/Indexes.py.diff?r1=text&tr1=1.10&r2=text&tr2=1.11
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/Item.py.diff?r1=text&tr1=1.200&r2=text&tr2=1.201
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/ItemHandler.py.diff?r1=text&tr1=1.64&r2=text&tr2=1.65
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/PersistentCollections.py.diff?r1=text&tr1=1.24&r2=text&tr2=1.25
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/Query.py.diff?r1=text&tr1=1.12&r2=text&tr2=1.13
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/RefCollections.py.diff?r1=text&tr1=1.13&r2=text&tr2=1.14
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/Values.py.diff?r1=text&tr1=1.41&r2=text&tr2=1.42
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/ItemError.py.diff?r1=text&tr1=1.8&r2=text&tr2=None
http://cvs.osafoundation.org/index.cgi/chandler/repository/packs/schema/model/Query.kind.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/chandler/repository/packs/schema/model/UUID.type.diff?r1=text&tr1=1.5&r2=text&tr2=1.6
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/DBContainer.py.diff?r1=text&tr1=1.36&r2=text&tr2=1.37
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/DBItemIO.py.diff?r1=text&tr1=1.6&r2=text&tr2=1.7
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/DBLob.py.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/DBRefs.py.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/DBRepository.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/DBRepositoryView.py.diff?r1=text&tr1=1.10&r2=text&tr2=1.11
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/FileContainer.py.diff?r1=text&tr1=1.18&r2=text&tr2=1.19
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/PackHandler.py.diff?r1=text&tr1=1.21&r2=text&tr2=1.22
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/Repository.py.diff?r1=text&tr1=1.96&r2=text&tr2=1.97
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/RepositoryError.py.diff?r1=text&tr1=1.15&r2=text&tr2=1.16
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/RepositoryView.py.diff?r1=text&tr1=1.35&r2=text&tr2=1.36
http://cvs.osafoundation.org/index.cgi/chandler/repository/query/Query.py.diff?r1=text&tr1=1.38&r2=text&tr2=1.39
http://cvs.osafoundation.org/index.cgi/chandler/repository/query/tests/TestNotification.py.diff?r1=text&tr1=1.22&r2=text&tr2=1.23
http://cvs.osafoundation.org/index.cgi/chandler/repository/remote/CloudFilter.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8
http://cvs.osafoundation.org/index.cgi/chandler/repository/remote/ItemFilter.py.diff?r1=text&tr1=1.6&r2=text&tr2=1.7
http://cvs.osafoundation.org/index.cgi/chandler/repository/remote/RemoteFilter.py.diff?r1=text&tr1=1.12&r2=text&tr2=1.13
http://cvs.osafoundation.org/index.cgi/chandler/repository/remote/RemoteRepository.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.12
http://cvs.osafoundation.org/index.cgi/chandler/repository/remote/RepositoryServer.py.diff?r1=text&tr1=1.4&r2=text&tr2=1.5
http://cvs.osafoundation.org/index.cgi/chandler/repository/remote/Transport.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8
http://cvs.osafoundation.org/index.cgi/chandler/repository/schema/Alias.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.12
http://cvs.osafoundation.org/index.cgi/chandler/repository/schema/Attribute.py.diff?r1=text&tr1=1.18&r2=text&tr2=1.19
http://cvs.osafoundation.org/index.cgi/chandler/repository/schema/Cloud.py.diff?r1=text&tr1=1.23&r2=text&tr2=1.24
http://cvs.osafoundation.org/index.cgi/chandler/repository/schema/Kind.py.diff?r1=text&tr1=1.104&r2=text&tr2=1.105
http://cvs.osafoundation.org/index.cgi/chandler/repository/schema/TypeHandler.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.2
http://cvs.osafoundation.org/index.cgi/chandler/repository/schema/Types.py.diff?r1=text&tr1=1.78&r2=text&tr2=1.79
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestIndexes.py.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestMixins.py.diff?r1=text&tr1=1.6&r2=text&tr2=1.7
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestRedirectToOrdering.py.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestText.py.diff?r1=text&tr1=1.21&r2=text&tr2=1.22
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestTypes.py.diff?r1=text&tr1=1.8&r2=text&tr2=1.9
http://cvs.osafoundation.org/index.cgi/chandler/repository/util/LinkedMap.py.diff?r1=text&tr1=1.26&r2=text&tr2=1.27
http://cvs.osafoundation.org/index.cgi/chandler/repository/util/Path.py.diff?r1=text&tr1=1.13&r2=text&tr2=1.14
http://cvs.osafoundation.org/index.cgi/chandler/repository/util/SingleRef.py.diff?r1=text&tr1=1.8&r2=text&tr2=1.9
http://cvs.osafoundation.org/index.cgi/chandler/repository/util/SkipList.py.diff?r1=text&tr1=1.4&r2=text&tr2=1.5

Index: chandler/repository/persistence/DBRepositoryView.py
diff -u chandler/repository/persistence/DBRepositoryView.py:1.10 chandler/repository/persistence/DBRepositoryView.py:1.11
--- chandler/repository/persistence/DBRepositoryView.py:1.10	Tue Mar 15 15:03:17 2005
+++ chandler/repository/persistence/DBRepositoryView.py	Fri Mar 18 13:41:48 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.10 $"
-__date__      = "$Date: 2005/03/15 23:03:17 $"
+__revision__  = "$Revision: 1.11 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -11,12 +11,12 @@
 
 from repository.item.Item import Item
 from repository.item.RefCollections import TransientRefList
-from repository.persistence.RepositoryError import RepositoryError, MergeError
-from repository.persistence.RepositoryError import VersionConflictError
-from repository.persistence.RepositoryView import RepositoryView
-from repository.persistence.RepositoryView import OnDemandRepositoryView
-from repository.persistence.Repository import Repository
-from repository.persistence.Repository import RepositoryNotifications
+from repository.persistence.RepositoryError \
+     import RepositoryError, MergeError, VersionConflictError
+from repository.persistence.RepositoryView \
+     import RepositoryView, OnDemandRepositoryView
+from repository.persistence.Repository \
+     import Repository, RepositoryNotifications
 from repository.persistence.DBLob import DBLob
 from repository.persistence.DBRefs import DBRefList, DBChildren
 from repository.persistence.DBContainer import HashTuple
@@ -43,12 +43,6 @@
         
         return False
 
-    def _newItems(self):
-
-        for item in self._log:
-            if item.isNew():
-                yield item
-
     def dirlog(self):
 
         for item in self._log:
@@ -335,6 +329,12 @@
 
     def mapChanges(self, callable, freshOnly=False):
 
+        if freshOnly:
+            if self._status & RepositoryView.FDIRTY:
+                self._status &= ~RepositoryView.FDIRTY
+            else:
+                return
+
         for item in self._log:
             status = item._status
             if not freshOnly or freshOnly and status & Item.FDIRTY:

Index: chandler/repository/tests/TestTypes.py
diff -u chandler/repository/tests/TestTypes.py:1.8 chandler/repository/tests/TestTypes.py:1.9
--- chandler/repository/tests/TestTypes.py:1.8	Thu Jan 13 17:13:39 2005
+++ chandler/repository/tests/TestTypes.py	Fri Mar 18 13:41:52 2005
@@ -2,8 +2,8 @@
 Unit tests for Types
 """
 
-__revision__  = "$Revision: 1.8 $"
-__date__      = "$Date: 2005/01/14 01:13:39 $"
+__revision__  = "$Revision: 1.9 $"
+__date__      = "$Date: 2005/03/18 21:41:52 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -15,7 +15,7 @@
 
 from repository.schema.Attribute import Attribute
 from repository.util.Path import Path
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.SingleRef import SingleRef
 from mx.DateTime import DateTime, DateTimeDelta, ISO, RelativeDateTime
 

Index: chandler/repository/tests/TestMixins.py
diff -u chandler/repository/tests/TestMixins.py:1.6 chandler/repository/tests/TestMixins.py:1.7
--- chandler/repository/tests/TestMixins.py:1.6	Mon Feb 28 12:28:12 2005
+++ chandler/repository/tests/TestMixins.py	Fri Mar 18 13:41:52 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.6 $"
-__date__      = "$Date: 2005/02/28 20:28:12 $"
+__revision__  = "$Revision: 1.7 $"
+__date__      = "$Date: 2005/03/18 21:41:52 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -66,11 +66,11 @@
         attribute = actor.getAttribute('movies').itsKind
         self.assert_(kh.isItemOf(actor))
 
-        Monitors.attach(m1, 'kindChanged', 'kind', 'schema')
+        Monitors.attach(m1, 'kindChanged', 'schema', 'kind')
         m1.monitorAttribute = None
         mixin = kh.mixinKinds(('add', movie), ('add', attribute))
 
-        self.assert_(m1.monitorAttribute == 'schema')
+        self.assert_(m1.monitorAttribute == 'kind')
 
 
 if __name__ == "__main__":

Index: chandler/Makefile
diff -u chandler/Makefile:1.89 chandler/Makefile:1.90
--- chandler/Makefile:1.89	Thu Mar 17 15:27:11 2005
+++ chandler/Makefile	Fri Mar 18 13:41:41 2005
@@ -1,5 +1,5 @@
 
-# Copyright (c) 2004 Open Source Applications Foundation
+# Copyright (c) 2005 Open Source Applications Foundation
 # License: http://osafoundation.org/Chandler_0.1_license_terms.htm
 #
 # This Makefile requires cygwin on Windows
@@ -19,7 +19,7 @@
 
 # these get installed into release or debug
 BIN_ARCHIVES=../Launchers-$(SNAP)-0.4-9.tar.gz \
-             ../chandlerdb-$(SNAP)-0.4-3.tar.gz \
+             ../chandlerdb-$(SNAP)-0.5-1.tar.gz \
              ../db-$(SNAP)-4.3.27-1.tar.gz \
              ../egenix-mx-base-$(SNAP)-2.1.0-3.tar.gz \
              ../epydoc-$(SNAP)-2.1-2.tar.gz \

Index: chandler/repository/remote/RemoteFilter.py
diff -u chandler/repository/remote/RemoteFilter.py:1.12 chandler/repository/remote/RemoteFilter.py:1.13
--- chandler/repository/remote/RemoteFilter.py:1.12	Thu Jan 13 17:13:38 2005
+++ chandler/repository/remote/RemoteFilter.py	Fri Mar 18 13:41:50 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.12 $"
-__date__      = "$Date: 2005/01/14 01:13:38 $"
+__revision__  = "$Revision: 1.13 $"
+__date__      = "$Date: 2005/03/18 21:41:50 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import cStringIO
 
 from repository.util.SAX import XMLFilter, XMLGenerator
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.Streams import StringReader
 from repository.util.Streams import BZ2OutputStream, ZlibOutputStream
 

Index: chandler/repository/query/Query.py
diff -u chandler/repository/query/Query.py:1.38 chandler/repository/query/Query.py:1.39
--- chandler/repository/query/Query.py:1.38	Tue Mar 15 09:20:14 2005
+++ chandler/repository/query/Query.py	Fri Mar 18 13:41:49 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.38 $"
-__date__      = "$Date: 2005/03/15 17:20:14 $"
+__revision__  = "$Revision: 1.39 $"
+__date__      = "$Date: 2005/03/18 21:41:49 $"
 __copyright__ = "Copyright (c) 2004, 2005 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -9,7 +9,7 @@
 import tools.timing
 import sets
 import mx.DateTime.ISO
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 import repository.item.Monitors as Monitors
 
 import logging
@@ -548,7 +548,7 @@
             
         self.plan = (self.collection, compile(self.closure,'<string>','eval'))
         if len(self.__item._sameViewSubscribeCallbacks) > 0:
-            Monitors.Monitors.attach(self.__item, 'monitorCallback', 'kind', 'schema')
+            Monitors.Monitors.attach(self.__item, 'monitorCallback', 'schema', 'kind')
             for a in self.affectedAttributes:
                 Monitors.Monitors.attach(self.__item, 'monitorCallback', 'set', a)
 

Index: chandler/parcels/osaf/framework/sharing/Sharing.py
diff -u chandler/parcels/osaf/framework/sharing/Sharing.py:1.85 chandler/parcels/osaf/framework/sharing/Sharing.py:1.86
--- chandler/parcels/osaf/framework/sharing/Sharing.py:1.85	Thu Mar 10 10:12:58 2005
+++ chandler/parcels/osaf/framework/sharing/Sharing.py	Fri Mar 18 13:41:43 2005
@@ -1,5 +1,5 @@
-Allowed = "$Revision: 1.85 $"
-__date__ = "$Date: 2005/03/10 18:12:58 $"
+Allowed = "$Revision: 1.86 $"
+__date__ = "$Date: 2005/03/18 21:41:43 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -12,7 +12,7 @@
 import osaf.contentmodel.calendar.Calendar as Calendar
 import osaf.contentmodel.ItemCollection as ItemCollection
 import osaf.current.Current as Current
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 import application.dialogs.PublishCollection
 from repository.item.Query import KindQuery
 from repository.util.Lob import Lob

Index: chandler/repository/remote/ItemFilter.py
diff -u chandler/repository/remote/ItemFilter.py:1.6 chandler/repository/remote/ItemFilter.py:1.7
--- chandler/repository/remote/ItemFilter.py:1.6	Thu Jan 13 17:13:38 2005
+++ chandler/repository/remote/ItemFilter.py	Fri Mar 18 13:41:50 2005
@@ -1,10 +1,9 @@
 
-__revision__  = "$Revision: 1.6 $"
-__date__      = "$Date: 2005/01/14 01:13:38 $"
+__revision__  = "$Revision: 1.7 $"
+__date__      = "$Date: 2005/03/18 21:41:50 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
-from chandlerdb.util.UUID import UUID
 from repository.util.SAX import XMLOffFilter
 
 

Index: chandler/repository/util/Path.py
diff -u chandler/repository/util/Path.py:1.13 chandler/repository/util/Path.py:1.14
--- chandler/repository/util/Path.py:1.13	Mon Oct 18 13:05:12 2004
+++ chandler/repository/util/Path.py	Fri Mar 18 13:41:53 2005
@@ -1,10 +1,10 @@
 
-__revision__  = "$Revision: 1.13 $"
-__date__      = "$Date: 2004/10/18 20:05:12 $"
+__revision__  = "$Revision: 1.14 $"
+__date__      = "$Date: 2005/03/18 21:41:53 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 
 
 class Path(object):

Index: chandler/repository/item/Values.py
diff -u chandler/repository/item/Values.py:1.41 chandler/repository/item/Values.py:1.42
--- chandler/repository/item/Values.py:1.41	Fri Jan 28 15:45:11 2005
+++ chandler/repository/item/Values.py	Fri Mar 18 13:41:46 2005
@@ -1,14 +1,14 @@
 
-__revision__  = "$Revision: 1.41 $"
-__date__      = "$Date: 2005/01/28 23:45:11 $"
+__revision__  = "$Revision: 1.42 $"
+__date__      = "$Date: 2005/03/18 21:41:46 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
+from chandlerdb.item.ItemError import *
 from repository.util.Path import Path
 from repository.item.PersistentCollections import PersistentCollection
 from repository.item.RefCollections import RefList
-from repository.item.ItemError import *
 from repository.util.SingleRef import SingleRef
 
 
@@ -197,7 +197,7 @@
                 continue
             
             if kind is not None:
-                attribute = kind.getAttribute(name)
+                attribute = kind.getAttribute(name, False, item)
                 persist = attribute.getAspect('persist', default=True)
             else:
                 attribute = None
@@ -227,7 +227,7 @@
 
         for key, value in self.iteritems():
             if kind is not None:
-                attribute = kind.getAttribute(key)
+                attribute = kind.getAttribute(key, False, item)
             else:
                 attribute = None
 
@@ -310,7 +310,7 @@
 
         for key, value in self.iteritems():
             try:
-                attribute = item._kind.getAttribute(key)
+                attribute = item._kind.getAttribute(key, False, item)
             except AttributeError:
                 logger.error('Item %s has a value for attribute %s but its kind %s has no definition for this attribute', item.itsPath, key, item._kind.itsPath)
                 result = False
@@ -398,39 +398,39 @@
                 item.setDirty(item.VDIRTY, name, self,
                               kwds.get('noMonitors', False))
 
-    def _getRef(self, name, other=None):
+    def _getRef(self, name, other=None, attrID=None):
 
         value = self.get(name, self)
+        item = self._item
 
         if other is None:
             if value is self:
                 raise KeyError, name
-            if value is None:
+            if value is None or value._isItem() or value._isRefList():
                 return value
             if value._isUUID():
-                other = self._item.find(value)
+                other = item.find(value)
                 if other is None:
-                    raise DanglingRefError, (self._item, name, value)
+                    raise DanglingRefError, (item, name, value)
                 self[name] = other
-                if self._item.itsKind is None:
-                    raise AssertionError, '%s: no kind' %(self._item.itsPath)
-                other._references._getRef(self._item.itsKind.getOtherName(name),
-                                          self._item)
+                kind = item.itsKind
+                if kind is not None:  # kind may be None during bootstrap
+                    other._references._getRef(kind.getOtherName(name, attrID,
+                                                                item), item)
                 return other
-            if value._isRefList() or value._isItem():
-                return value
+
             raise TypeError, '%s, type: %s' %(value, type(value))
 
         if value is other:
             if value._isUUID():
-                other = self._item.find(value)
+                other = item.find(value)
                 if other is None:
-                    raise DanglingRefError, (self._item, name, value)
-            self[name] = other
+                    raise DanglingRefError, (item, name, value)
+                self[name] = other
             return other
 
         if value is self or value is None:
-            raise BadRefError, (self._item, name, value, other)
+            raise BadRefError, (item, name, value, other)
 
         if value == other._uuid:
             self[name] = other
@@ -439,7 +439,7 @@
         if value._isRefList() and other in value:
             return other
 
-        raise BadRefError, (self._item, name, value, other)
+        raise BadRefError, (item, name, value, other)
     
     def _removeValue(self, name, other, otherName):
 
@@ -624,7 +624,7 @@
                 continue
             
             if kind is not None:
-                attribute = kind.getAttribute(name)
+                attribute = kind.getAttribute(name, False, item)
                 persist = attribute.getAspect('persist', default=True)
             else:
                 attribute = None
@@ -653,7 +653,7 @@
         kind = item._kind
 
         for name, value in self.iteritems():
-            attribute = kind.getAttribute(name)
+            attribute = kind.getAttribute(name, False, item)
             if attribute.getAspect('persist', default=True):
                 flags = self._getFlags(name) & Values.SAVEMASK
                 attrs = { 'id': attribute.itsUUID.str64() }
@@ -698,15 +698,14 @@
             dirties = None
 
         for key, value in self.iteritems():
-            if dirties is not None and key in dirties:
-                if value is not None and value._isRefList():
+            if value is not None and value._isRefList():
+                if dirties is not None and key in dirties:
                     value._clear_()
-            else:
-                try:
-                    if value is not None and value._isRefList():
+                else:
+                    try:
                         del value._original
-                except AttributeError:
-                    pass
+                    except AttributeError:
+                        pass
 
     def _revertMerge(self):
 

Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.191 chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.192
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.191	Thu Mar 17 15:01:28 2005
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py	Fri Mar 18 13:41:43 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.191 $"
-__date__ = "$Date: 2005/03/17 23:01:28 $"
+__version__ = "$Revision: 1.192 $"
+__date__ = "$Date: 2005/03/18 21:41:43 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -9,7 +9,7 @@
 from ContainerBlocks import *
 from DragAndDrop import DraggableWidget as DraggableWidget
 from Styles import Font
-from repository.item.ItemError import NoSuchAttributeError
+from chandlerdb.item.ItemError import NoSuchAttributeError
 import wx
 import wx.html
 import wx.gizmos

Index: chandler/repository/schema/Attribute.py
diff -u chandler/repository/schema/Attribute.py:1.18 chandler/repository/schema/Attribute.py:1.19
--- chandler/repository/schema/Attribute.py:1.18	Fri Feb  4 13:39:38 2005
+++ chandler/repository/schema/Attribute.py	Fri Mar 18 13:41:51 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.18 $"
-__date__      = "$Date: 2005/02/04 21:39:38 $"
+__revision__  = "$Revision: 1.19 $"
+__date__      = "$Date: 2005/03/18 21:41:51 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -19,8 +19,7 @@
 
         super(Attribute, self)._fillItem(name, parent, kind, **kwds)
         
-        refList = self._refList('inheritingKinds',
-                                'inheritedAttributes', False)
+        refList = self._refList('inheritingKinds', 'inheritedAttributes', False)
         self._references['inheritingKinds'] = refList
 
         self._status |= Item.SCHEMA | Item.PINNED
@@ -37,14 +36,13 @@
             return self._references._getRef(name)
 
         if 'superAttribute' in self._references:
-            superAttribute = self.getAttributeValue('superAttribute')
-            return superAttribute.getAspect(name, **kwds)
+            return self.superAttribute.getAspect(name, **kwds)
 
         if 'default' in kwds:
             return kwds['default']
 
         if self._kind is not None:
-            aspectAttr = self._kind.getAttribute(name)
+            aspectAttr = self._kind.getAttribute(name, False, self)
             return aspectAttr.getAttributeValue('defaultValue', default=None)
         
         return None

Index: chandler/parcels/osaf/contentmodel/ItemCollection.py
diff -u chandler/parcels/osaf/contentmodel/ItemCollection.py:1.40 chandler/parcels/osaf/contentmodel/ItemCollection.py:1.41
--- chandler/parcels/osaf/contentmodel/ItemCollection.py:1.40	Sun Mar 13 18:54:12 2005
+++ chandler/parcels/osaf/contentmodel/ItemCollection.py	Fri Mar 18 13:41:41 2005
@@ -1,11 +1,11 @@
-__date__ = "$Date: 2005/03/14 02:54:12 $"
+__date__ = "$Date: 2005/03/18 21:41:41 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import application.Globals as Globals
 import osaf.contentmodel.ContentModel as ContentModel
 import repository.query.Query as Query
-from repository.item.ItemError import NoSuchIndexError
+from chandlerdb.item.ItemError import NoSuchIndexError
 
 class ItemCollection(ContentModel.ContentItem, Query.Query):
     myKindID = None

Index: chandler/repository/item/RefCollections.py
diff -u chandler/repository/item/RefCollections.py:1.13 chandler/repository/item/RefCollections.py:1.14
--- chandler/repository/item/RefCollections.py:1.13	Wed Feb  2 22:22:38 2005
+++ chandler/repository/item/RefCollections.py	Fri Mar 18 13:41:46 2005
@@ -1,15 +1,15 @@
 
-__revision__  = "$Revision: 1.13 $"
-__date__      = "$Date: 2005/02/03 06:22:38 $"
+__revision__  = "$Revision: 1.14 $"
+__date__      = "$Date: 2005/03/18 21:41:46 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.Path import Path
 from repository.util.LinkedMap import LinkedMap
 from repository.item.Indexes import NumericIndex, AttributeIndex, CompareIndex
-from repository.item.ItemError import *
+from chandlerdb.item.ItemError import *
 
 
 class RefList(LinkedMap):
@@ -37,7 +37,6 @@
             self._setItem(item)
         self._indexes = None
 
-        self._flags |= RefList.SETDIRTY
         if readOnly:
             self._flags |= RefList.READONLY
         
@@ -96,6 +95,10 @@
             raise AssertionError, 'Item is already set'
         
         self._item = item
+        if item is not None:
+            self._flags |= RefList.SETDIRTY
+        else:
+            self._flags &= ~RefList.SETDIRTY
 
     def _getRepository(self):
 
@@ -497,7 +500,7 @@
         To get an item through its alias, use L{getByAlias} instead.
 
         @param key: the UUID of the item referenced.
-        @type key: L{UUID<chandlerdb.util.UUID.UUID>}
+        @type key: L{UUID<chandlerdb.util.uuid.UUID>}
         @param default: the default value to return if there is no reference
         for C{key} in this ref collection, C{None} by default.
         @type default: anything
@@ -676,7 +679,7 @@
         attrs['name'] = name
         if withSchema:
             attrs['cardinality'] = 'list'
-            attrs['otherName'] = item._kind.getOtherName(name)
+            attrs['otherName'] = item._kind.getOtherName(name, None, item)
 
         generator.startElement('ref', attrs)
         self._xmlValues(generator, version)

Index: chandler/repository/persistence/Repository.py
diff -u chandler/repository/persistence/Repository.py:1.96 chandler/repository/persistence/Repository.py:1.97
--- chandler/repository/persistence/Repository.py:1.96	Wed Mar  2 14:10:00 2005
+++ chandler/repository/persistence/Repository.py	Fri Mar 18 13:41:48 2005
@@ -1,12 +1,12 @@
 
-__revision__  = "$Revision: 1.96 $"
-__date__      = "$Date: 2005/03/02 22:10:00 $"
+__revision__  = "$Revision: 1.97 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import logging, threading, PyLucene
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.item.Item import Item
 from repository.persistence.RepositoryView import RepositoryView
 from repository.persistence.RepositoryView import OnDemandRepositoryView

Index: chandler/repository/util/SingleRef.py
diff -u chandler/repository/util/SingleRef.py:1.8 chandler/repository/util/SingleRef.py:1.9
--- chandler/repository/util/SingleRef.py:1.8	Tue Jan 11 14:12:01 2005
+++ chandler/repository/util/SingleRef.py	Fri Mar 18 13:41:53 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.8 $"
-__date__      = "$Date: 2005/01/11 22:12:01 $"
+__revision__  = "$Revision: 1.9 $"
+__date__      = "$Date: 2005/03/18 21:41:53 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 
 class SingleRef(object):
     """
-    Wraps a L{UUID<chandlerdb.util.UUID.UUID>} to form a uni-directional
+    Wraps a L{UUID<chandlerdb.util.uuid.UUID>} to form a uni-directional
     reference to an item.
 
     Direct use of this type is not necessary since setting an item as a value

Index: chandler/repository/remote/RemoteRepository.py
diff -u chandler/repository/remote/RemoteRepository.py:1.11 chandler/repository/remote/RemoteRepository.py:1.12
--- chandler/repository/remote/RemoteRepository.py:1.11	Wed Jan  5 12:17:47 2005
+++ chandler/repository/remote/RemoteRepository.py	Fri Mar 18 13:41:50 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.11 $"
-__date__      = "$Date: 2005/01/05 20:17:47 $"
+__revision__  = "$Revision: 1.12 $"
+__date__      = "$Date: 2005/03/18 21:41:50 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -9,7 +9,7 @@
 from repository.persistence.DBRepositoryView import DBRepositoryView
 from repository.remote.Transport import SOAPTransport, JabberTransport
 from repository.remote.RemoteFilter import RemoteFilter
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 
 
 class RemoteRepository(DBRepository):

Index: chandler/repository/schema/Types.py
diff -u chandler/repository/schema/Types.py:1.78 chandler/repository/schema/Types.py:1.79
--- chandler/repository/schema/Types.py:1.78	Tue Feb 15 19:59:33 2005
+++ chandler/repository/schema/Types.py	Fri Mar 18 13:41:51 2005
@@ -1,12 +1,12 @@
 
-__revision__  = "$Revision: 1.78 $"
-__date__      = "$Date: 2005/02/16 03:59:33 $"
+__revision__  = "$Revision: 1.79 $"
+__date__      = "$Date: 2005/03/18 21:41:51 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import mx.DateTime
 
-import chandlerdb.util.UUID
+import chandlerdb.util.uuid
 import repository.util.Path
 import repository.util.SingleRef
 import repository.util.URL
@@ -102,6 +102,9 @@
     def isAlias(self):
         return False
 
+    def isSimple(self):
+        return True
+
     def typeXML(self, value, generator, withSchema):
         generator.characters(self.makeString(value))
 
@@ -348,7 +351,7 @@
         if data == Type.NoneString:
             return None
 
-        return chandlerdb.util.UUID.UUID(data)
+        return chandlerdb.util.uuid.UUID(data)
 
     def makeString(self, value):
 
@@ -359,7 +362,7 @@
     
     def recognizes(self, value):
 
-        return value is None or type(value) is chandlerdb.util.UUID.UUID
+        return value is None or type(value) is chandlerdb.util.uuid.UUID
 
     def eval(self, value):
 
@@ -389,7 +392,7 @@
         if data[offset] == '\0':
             return offset+1, None
         
-        return offset+17, chandlerdb.util.UUID.UUID(data[offset+1:offset+17])
+        return offset+17, chandlerdb.util.uuid.UUID(data[offset+1:offset+17])
 
 
 class SingleRef(Type):
@@ -403,7 +406,7 @@
         if data == Type.NoneString:
             return None
         
-        uuid = chandlerdb.util.UUID.UUID(data)
+        uuid = chandlerdb.util.uuid.UUID(data)
         return repository.util.SingleRef.SingleRef(uuid)
 
     def makeString(self, value):
@@ -447,9 +450,13 @@
         if data[offset] == '\0':
             return offset+1, None
         
-        uuid = chandlerdb.util.UUID.UUID(data[offset+1:offset+17])
+        uuid = chandlerdb.util.uuid.UUID(data[offset+1:offset+17])
         return offset+17, repository.util.SingleRef.SingleRef(uuid)
 
+    def isSimple(self):
+
+        return False
+
 
 class Path(Type):
 
@@ -704,7 +711,7 @@
         name = attrs['name']
 
         if attrs.has_key('typeid'):
-            typeHandler = itemHandler.repository[chandlerdb.util.UUID.UUID(attrs['typeid'])]
+            typeHandler = itemHandler.repository[chandlerdb.util.uuid.UUID(attrs['typeid'])]
             value = typeHandler.makeValue(itemHandler.data)
         elif attrs.has_key('type'):
             value = itemHandler.makeValue(attrs['type'], itemHandler.data)

Index: chandler/repository/persistence/DBContainer.py
diff -u chandler/repository/persistence/DBContainer.py:1.36 chandler/repository/persistence/DBContainer.py:1.37
--- chandler/repository/persistence/DBContainer.py:1.36	Tue Feb 15 16:29:20 2005
+++ chandler/repository/persistence/DBContainer.py	Fri Mar 18 13:41:48 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.36 $"
-__date__      = "$Date: 2005/02/16 00:29:20 $"
+__revision__  = "$Revision: 1.37 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2002 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -10,7 +10,7 @@
 
 from repository.item.Access import ACL, ACE
 from repository.item.Item import Item
-from chandlerdb.util.UUID import UUID, _uuid
+from chandlerdb.util.uuid import UUID, _hash
 from repository.persistence.Repository import Repository
 from repository.persistence.RepositoryError import RepositoryFormatError
 
@@ -455,7 +455,7 @@
         if uuid is None:
             uuid = key
 
-        self.put(pack('>16sll', key._uuid, _uuid.hash(name), ~version),
+        self.put(pack('>16sll', key._uuid, _hash(name), ~version),
                  uuid._uuid)
 
     def readName(self, version, key, name):
@@ -466,7 +466,7 @@
         if isinstance(name, unicode):
             name = name.encode('utf-8')
 
-        cursorKey = pack('>16sl', key._uuid, _uuid.hash(name))
+        cursorKey = pack('>16sl', key._uuid, _hash(name))
         store = self.store
         
         while True:
@@ -576,7 +576,7 @@
         else:
             if isinstance(name, unicode):
                 name = name.encode('utf-8')
-            key = pack('>16sll', key._uuid, _uuid.hash(name), ~version)
+            key = pack('>16sll', key._uuid, _hash(name), ~version)
 
         if acl is None:    # deleted acl
             value = pack('>l', 0)
@@ -593,7 +593,7 @@
         else:
             if isinstance(name, unicode):
                 name = name.encode('utf-8')
-            cursorKey = pack('>16sl', key._uuid, _uuid.hash(name))
+            cursorKey = pack('>16sl', key._uuid, _hash(name))
 
         store = self.store
         
@@ -811,7 +811,7 @@
         def writeName(name):
             if isinstance(name, unicode):
                 name = name.encode('utf-8')
-            buffer.write(pack('>l', _uuid.hash(name)))
+            buffer.write(pack('>l', _hash(name)))
             
         for name, uValue in values:
             writeName(name)
@@ -928,7 +928,7 @@
 
             if isinstance(name, unicode):
                 name = name.encode('utf-8')
-            hash = _uuid.hash(name)
+            hash = _hash(name)
 
             vCount, dCount = unpack('>ll', item[-8:])
             pos = -(dCount + 2) * 4 - vCount * 20
@@ -1167,8 +1167,8 @@
         if isinstance(name, unicode):
             name = name.encode('utf-8')
 
-        return super(HashTuple, self).__contains__(_uuid.hash(name))
+        return super(HashTuple, self).__contains__(_hash(name))
 
     def hash(self, name):
 
-        return _uuid.hash(name)
+        return _hash(name)

Index: chandler/repository/persistence/DBItemIO.py
diff -u chandler/repository/persistence/DBItemIO.py:1.6 chandler/repository/persistence/DBItemIO.py:1.7
--- chandler/repository/persistence/DBItemIO.py:1.6	Tue Mar 15 15:03:17 2005
+++ chandler/repository/persistence/DBItemIO.py	Fri Mar 18 13:41:48 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.6 $"
-__date__      = "$Date: 2005/03/15 23:03:17 $"
+__revision__  = "$Revision: 1.7 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 from struct import pack, unpack
 from cStringIO import StringIO
 
-from chandlerdb.util.UUID import UUID, _uuid
+from chandlerdb.util.uuid import UUID, _hash
 from repository.item.Item import Item
 from repository.item.Values import Values, References, ItemValue
 from repository.item.ItemIO import ItemWriter, ItemReader
@@ -194,7 +194,7 @@
     def _unchangedValue(self, item, name):
 
         try:
-            self.values.append((name, self.oldValues[_uuid.hash(name)]))
+            self.values.append((name, self.oldValues[_hash(name)]))
         except KeyError:
             raise AssertionError, "unchanged value for '%s' not found" %(name)
 
@@ -268,7 +268,8 @@
             buffer.write(chr(flags))
             buffer.write(value.uuid._uuid)
             if withSchema:
-                self.writeSymbol(buffer, item._kind.getOtherName(name))
+                self.writeSymbol(buffer,
+                                 item._kind.getOtherName(name, attribute._uuid))
             value._saveValues(version)
             if value._indexes:
                 buffer.write(pack('>H', len(value._indexes)))
@@ -548,7 +549,7 @@
             if withSchema:
                 offset, otherName = self.readSymbol(offset, data)
             else:
-                otherName = kind.getOtherName(name)
+                otherName = kind.getOtherName(name, attribute._uuid)
             value = view._createRefList(None, name, otherName,
                                         True, False, False, uuid)
             count, = unpack('>H', data[offset:offset+2])

Index: chandler/repository/remote/CloudFilter.py
diff -u chandler/repository/remote/CloudFilter.py:1.7 chandler/repository/remote/CloudFilter.py:1.8
--- chandler/repository/remote/CloudFilter.py:1.7	Wed Jan  5 12:17:47 2005
+++ chandler/repository/remote/CloudFilter.py	Fri Mar 18 13:41:50 2005
@@ -1,11 +1,11 @@
 
-__revision__  = "$Revision: 1.7 $"
-__date__      = "$Date: 2005/01/05 20:17:47 $"
+__revision__  = "$Revision: 1.8 $"
+__date__      = "$Date: 2005/03/18 21:41:50 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 from repository.remote.ItemFilter import ItemFilter
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.SAX import ContentHandler, XMLOffFilter
 from repository.persistence.RepositoryError import NoSuchItemError
 

Index: chandler/parcels/osaf/mail/imap.py
diff -u chandler/parcels/osaf/mail/imap.py:1.45 chandler/parcels/osaf/mail/imap.py:1.46
--- chandler/parcels/osaf/mail/imap.py:1.45	Tue Feb 15 10:22:55 2005
+++ chandler/parcels/osaf/mail/imap.py	Fri Mar 18 13:41:44 2005
@@ -1,5 +1,5 @@
-__revision__  = "$Revision: 1.45 $"
-__date__      = "$Date: 2005/02/15 18:22:55 $"
+__revision__  = "$Revision: 1.46 $"
+__date__      = "$Date: 2005/03/18 21:41:44 $"
 __copyright__ = "Copyright (c) 2005 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -19,7 +19,7 @@
 
 #Chandler imports
 import osaf.framework.twisted.TwistedRepositoryViewManager as TwistedRepositoryViewManager
-import chandlerdb.util.UUID as UUID
+import chandlerdb.util.uuid as UUID
 import repository.item.Query as Query
 import osaf.contentmodel.mail.Mail as Mail
 import application.Globals as Globals

Index: chandler/repository/persistence/PackHandler.py
diff -u chandler/repository/persistence/PackHandler.py:1.21 chandler/repository/persistence/PackHandler.py:1.22
--- chandler/repository/persistence/PackHandler.py:1.21	Wed Jan  5 12:17:46 2005
+++ chandler/repository/persistence/PackHandler.py	Fri Mar 18 13:41:48 2005
@@ -1,12 +1,12 @@
 
-__revision__  = "$Revision: 1.21 $"
-__date__      = "$Date: 2005/01/05 20:17:46 $"
+__revision__  = "$Revision: 1.22 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import os, re
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.Path import Path
 from repository.util.SAX import ContentHandler
 from repository.item.Item import Item

Index: chandler/parcels/osaf/contentmodel/mail/Mail.py
diff -u chandler/parcels/osaf/contentmodel/mail/Mail.py:1.59 chandler/parcels/osaf/contentmodel/mail/Mail.py:1.60
--- chandler/parcels/osaf/contentmodel/mail/Mail.py:1.59	Thu Feb 17 16:14:00 2005
+++ chandler/parcels/osaf/contentmodel/mail/Mail.py	Fri Mar 18 13:41:42 2005
@@ -1,8 +1,8 @@
 """ Classes used for Mail parcel kinds
 """
 
-__revision__  = "$Revision: 1.59 $"
-__date__      = "$Date: 2005/02/18 00:14:00 $"
+__revision__  = "$Revision: 1.60 $"
+__date__      = "$Date: 2005/03/18 21:41:42 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -14,10 +14,10 @@
 import application.Globals as Globals
 import repository.query.Query as Query
 import repository.item.Query as ItemQuery
-import chandlerdb.util.UUID as UUID
+import chandlerdb.util.uuid as UUID
 import email.Utils as Utils
 import re as re
-import repository.item.ItemError as ItemError
+import chandlerdb.item.ItemError as ItemError
 
 from repository.util.Path import Path
 

Index: chandler/repository/item/Indexes.py
diff -u chandler/repository/item/Indexes.py:1.10 chandler/repository/item/Indexes.py:1.11
--- chandler/repository/item/Indexes.py:1.10	Fri Jan 28 15:45:11 2005
+++ chandler/repository/item/Indexes.py	Fri Mar 18 13:41:46 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.10 $"
-__date__      = "$Date: 2005/01/28 23:45:11 $"
+__revision__  = "$Revision: 1.11 $"
+__date__      = "$Date: 2005/03/18 21:41:46 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -86,6 +86,8 @@
 
     class node(SkipList.node):
 
+        __slots__ = ('_entryValue')
+
         def __init__(self, level, skipList):
 
             super(NumericIndex.node, self).__init__(level, skipList)

Index: chandler/parcels/osaf/mail/message.py
diff -u chandler/parcels/osaf/mail/message.py:1.48 chandler/parcels/osaf/mail/message.py:1.49
--- chandler/parcels/osaf/mail/message.py:1.48	Tue Mar 15 12:08:07 2005
+++ chandler/parcels/osaf/mail/message.py	Fri Mar 18 13:41:44 2005
@@ -1,5 +1,5 @@
-__revision__  = "$Revision: 1.48 $"
-__date__      = "$Date: 2005/03/15 20:08:07 $"
+__revision__  = "$Revision: 1.49 $"
+__date__      = "$Date: 2005/03/18 21:41:44 $"
 __copyright__ = "Copyright (c) 2005 Open Source Applications Foundation"
 __license__   = "http://osafoundation.orgdler_0.1_license_terms.htm"
 
@@ -14,7 +14,7 @@
 
 #Chandler imports
 import osaf.contentmodel.mail.Mail as Mail
-import chandlerdb.util.UUID as UUID
+import chandlerdb.util.uuid as UUID
 
 #Chandler Mail Service imports
 import constants as constants

Index: chandler/parcels/osaf/mail/smtp.py
diff -u chandler/parcels/osaf/mail/smtp.py:1.33 chandler/parcels/osaf/mail/smtp.py:1.34
--- chandler/parcels/osaf/mail/smtp.py:1.33	Tue Mar  8 16:05:45 2005
+++ chandler/parcels/osaf/mail/smtp.py	Fri Mar 18 13:41:44 2005
@@ -1,5 +1,5 @@
-__revision__  = "$Revision: 1.33 $"
-__date__      = "$Date: 2005/03/09 00:05:45 $"
+__revision__  = "$Revision: 1.34 $"
+__date__      = "$Date: 2005/03/18 21:41:44 $"
 __copyright__ = "Copyright (c) 2005 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -19,7 +19,7 @@
 #Chandler imports
 import osaf.framework.twisted.TwistedRepositoryViewManager as TwistedRepositoryViewManager
 import osaf.contentmodel.mail.Mail as Mail
-import chandlerdb.util.UUID as UUID
+import chandlerdb.util.uuid as UUID
 import application.Globals as Globals
 import M2Crypto.SSL.TwistedProtocolWrapper as wrapper
 import M2Crypto.SSL as SSL

Index: chandler/repository/persistence/RepositoryError.py
diff -u chandler/repository/persistence/RepositoryError.py:1.15 chandler/repository/persistence/RepositoryError.py:1.16
--- chandler/repository/persistence/RepositoryError.py:1.15	Tue Feb  8 15:45:14 2005
+++ chandler/repository/persistence/RepositoryError.py	Fri Mar 18 13:41:48 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.15 $"
-__date__      = "$Date: 2005/02/08 23:45:14 $"
+__revision__  = "$Revision: 1.16 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -11,10 +11,14 @@
 class RepositoryError(ValueError):
     "All repository related exceptions go here"
 
-class ExclusiveOpenDeniedError(RepositoryError):
+
+class RepositoryLockNotGrantedError:
+    pass
+
+class ExclusiveOpenDeniedError(RepositoryLockNotGrantedError):
     pass
 
-class RepositoryOpenDeniedError(RepositoryError):
+class RepositoryOpenDeniedError(RepositoryLockNotGrantedError):
     pass
 
 

Index: chandler/repository/query/tests/TestNotification.py
diff -u chandler/repository/query/tests/TestNotification.py:1.22 chandler/repository/query/tests/TestNotification.py:1.23
--- chandler/repository/query/tests/TestNotification.py:1.22	Wed Feb 23 18:02:11 2005
+++ chandler/repository/query/tests/TestNotification.py	Fri Mar 18 13:41:49 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.22 $"
-__date__      = "$Date: 2005/02/24 02:02:11 $"
+__revision__  = "$Revision: 1.23 $"
+__date__      = "$Date: 2005/03/18 21:41:49 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -8,7 +8,6 @@
 import repository.query.tests.QueryTestCase as QueryTestCase
 import repository.query.Query as Query
 import repository.item.Item as Item
-import chandlerdb.util.UUID as UUID
 
 import NotificationItem
 

Index: chandler/repository/item/PersistentCollections.py
diff -u chandler/repository/item/PersistentCollections.py:1.24 chandler/repository/item/PersistentCollections.py:1.25
--- chandler/repository/item/PersistentCollections.py:1.24	Thu Mar  3 18:03:07 2005
+++ chandler/repository/item/PersistentCollections.py	Fri Mar 18 13:41:46 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.24 $"
-__date__      = "$Date: 2005/03/04 02:03:07 $"
+__revision__  = "$Revision: 1.25 $"
+__date__      = "$Date: 2005/03/18 21:41:46 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.SingleRef import SingleRef
-from repository.item.ItemError import *
+from chandlerdb.item.ItemError import *
 
 
 class PersistentCollection(object):

Index: chandler/repository/schema/TypeHandler.py
diff -u chandler/repository/schema/TypeHandler.py:1.1 chandler/repository/schema/TypeHandler.py:1.2
--- chandler/repository/schema/TypeHandler.py:1.1	Wed Jan  5 12:17:48 2005
+++ chandler/repository/schema/TypeHandler.py	Fri Mar 18 13:41:51 2005
@@ -1,10 +1,10 @@
 
-__revision__  = "$Revision: 1.1 $"
-__date__      = "$Date: 2005/01/05 20:17:48 $"
+__revision__  = "$Revision: 1.2 $"
+__date__      = "$Date: 2005/03/18 21:41:51 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.Path import Path
 from repository.util.SingleRef import SingleRef
 from repository.util.ClassLoader import ClassLoader

Index: chandler/parcels/osaf/framework/blocks/Block.py
diff -u chandler/parcels/osaf/framework/blocks/Block.py:1.102 chandler/parcels/osaf/framework/blocks/Block.py:1.103
--- chandler/parcels/osaf/framework/blocks/Block.py:1.102	Thu Mar 17 15:01:28 2005
+++ chandler/parcels/osaf/framework/blocks/Block.py	Fri Mar 18 13:41:43 2005
@@ -1,11 +1,11 @@
-__version__ = "$Revision: 1.102 $"
-__date__ = "$Date: 2005/03/17 23:01:28 $"
+__version__ = "$Revision: 1.103 $"
+__date__ = "$Date: 2005/03/18 21:41:43 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import application.Globals as Globals
 from repository.item.Item import Item
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 import wx
 import logging
 import hotshot
@@ -671,4 +671,4 @@
                 
         
 class BlockEvent(Item):
-    pass
\ No newline at end of file
+    pass

Index: chandler/repository/persistence/RepositoryView.py
diff -u chandler/repository/persistence/RepositoryView.py:1.35 chandler/repository/persistence/RepositoryView.py:1.36
--- chandler/repository/persistence/RepositoryView.py:1.35	Wed Mar  2 14:10:00 2005
+++ chandler/repository/persistence/RepositoryView.py	Fri Mar 18 13:41:48 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.35 $"
-__date__      = "$Date: 2005/03/02 22:10:00 $"
+__revision__  = "$Revision: 1.36 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -8,7 +8,7 @@
 
 from threading import currentThread, Thread
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.Path import Path
 from repository.util.ThreadSemaphore import ThreadSemaphore
 from repository.persistence.RepositoryError \
@@ -291,7 +291,7 @@
 
         @param spec: a path or UUID
         @type spec: L{Path<repository.util.Path.Path>} or
-                    L{UUID<chandlerdb.util.UUID.UUID>} 
+                    L{UUID<chandlerdb.util.uuid.UUID>} 
         @param load: load the item if it not yet loaded, C{True} by default
         @type load: boolean
         @return: an item or C{None} if not found
@@ -346,7 +346,7 @@
         See L{find} for more information.
 
         @param uuid: a UUID
-        @type uuid: L{UUID<chandlerdb.util.UUID.UUID>} or a uuid string
+        @type uuid: L{UUID<chandlerdb.util.uuid.UUID>} or a uuid string
         @param load: load the item if it not yet loaded, C{True} by default
         @type load: boolean
         @return: an item or C{None} if not found
@@ -376,7 +376,7 @@
         None)} and the ACL for an attribute value on an item is stored with
         C{(item.itsUUID, attributeName)}.
 
-        @param uuid: a L{UUID<chandlerdb.util.UUID.UUID>} instance
+        @param uuid: a L{UUID<chandlerdb.util.uuid.UUID>} instance
         @param name: a string or C{None}
         @return: an L{ACL<repository.item.Access.ACL>} instance or C{None}
         """
@@ -797,6 +797,7 @@
     REFCOUNTED = 0x0002
     LOADING    = 0x0004
     COMMITTING = 0x0008
+    FDIRTY     = 0x0010
     
     # flags from Item
     # CDIRTY   = 0x0200
@@ -808,6 +809,7 @@
     def removeNotificationCallback(self, fn):
         return self.repository.removeNotificationCallback(fn)
 
+
 class OnDemandRepositoryView(RepositoryView):
 
     def __init__(self, repository, name):

Index: chandler/application/Application.py
diff -u chandler/application/Application.py:1.310 chandler/application/Application.py:1.311
--- chandler/application/Application.py:1.310	Fri Mar 18 11:32:25 2005
+++ chandler/application/Application.py	Fri Mar 18 13:41:41 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.310 $"
-__date__ = "$Date: 2005/03/18 19:32:25 $"
+__version__ = "$Revision: 1.311 $"
+__date__ = "$Date: 2005/03/18 21:41:41 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -7,10 +7,11 @@
 from new import classobj
 import wx
 import Globals
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 import application.Parcel
 from repository.persistence.DBRepository import DBRepository
-from repository.persistence.RepositoryError import VersionConflictError
+from repository.persistence.RepositoryError \
+     import VersionConflictError, MergeError
 from crypto import Crypto
 import logging as logging
 
@@ -586,7 +587,15 @@
             self.focus = focus
             self.needsUpdateUI = True
 
-        updateOnIdle()
+        try:
+            updateOnIdle()
+        except MergeError, e:
+            if e.getReasonCode() == MergeError.BUG:
+                logger.warning("Changes cancelled due to merge error: %s", e)
+                self.repository.view.cancel()
+                self.needsUpdateUI = True
+            else:
+                raise
 
         if self.needsUpdateUI:
             try:

Index: chandler/repository/remote/RepositoryServer.py
diff -u chandler/repository/remote/RepositoryServer.py:1.4 chandler/repository/remote/RepositoryServer.py:1.5
--- chandler/repository/remote/RepositoryServer.py:1.4	Mon Oct 18 13:05:08 2004
+++ chandler/repository/remote/RepositoryServer.py	Fri Mar 18 13:41:50 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.4 $"
-__date__      = "$Date: 2004/10/18 20:05:08 $"
+__revision__  = "$Revision: 1.5 $"
+__date__      = "$Date: 2005/03/18 21:41:50 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 
 import sys, re, xmlrpclib, jabber
 from SOAPpy import SOAPServer
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 
 
 class RepositoryServer(object):

Index: chandler/repository/packs/schema/model/Query.kind
diff -u chandler/repository/packs/schema/model/Query.kind:1.3 chandler/repository/packs/schema/model/Query.kind:1.4
--- chandler/repository/packs/schema/model/Query.kind:1.3	Thu Mar  3 16:58:20 2005
+++ chandler/repository/packs/schema/model/Query.kind	Fri Mar 18 13:41:46 2005
@@ -34,7 +34,7 @@
 
     <ref name="type" type="path">//Schema/Core/String</ref>
     <attribute name="cardinality">single</attribute>
-    <attribute name="initialValue" type="str"/>
+    <attribute name="initialValue"/>
   </item>
 
   <item>

Index: chandler/repository/packs/schema/model/UUID.type
diff -u chandler/repository/packs/schema/model/UUID.type:1.5 chandler/repository/packs/schema/model/UUID.type:1.6
--- chandler/repository/packs/schema/model/UUID.type:1.5	Mon Oct 18 13:05:05 2004
+++ chandler/repository/packs/schema/model/UUID.type	Fri Mar 18 13:41:46 2005
@@ -5,6 +5,6 @@
   <class module="repository.schema.Types">UUID</class>
 
   <attribute name="implementationTypes" cardinality="dict" type="class">
-    <value name="python">chandlerdb.util.UUID.UUID</value>
+    <value name="python">chandlerdb.util.uuid.UUID</value>
   </attribute>
 </item>

Index: chandler/repository/util/LinkedMap.py
diff -u chandler/repository/util/LinkedMap.py:1.26 chandler/repository/util/LinkedMap.py:1.27
--- chandler/repository/util/LinkedMap.py:1.26	Tue Feb 15 16:29:21 2005
+++ chandler/repository/util/LinkedMap.py	Fri Mar 18 13:41:53 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.26 $"
-__date__      = "$Date: 2005/02/16 00:29:21 $"
+__revision__  = "$Revision: 1.27 $"
+__date__      = "$Date: 2005/03/18 21:41:53 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -11,6 +11,8 @@
 
     class link(object):
 
+        __slots__ = ('_previousKey', '_nextKey', '_value', '_alias')
+
         def __init__(self, value):
 
             super(LinkedMap.link, self).__init__()

Index: chandler/parcels/osaf/contentmodel/contacts/Contacts.py
diff -u chandler/parcels/osaf/contentmodel/contacts/Contacts.py:1.16 chandler/parcels/osaf/contentmodel/contacts/Contacts.py:1.17
--- chandler/parcels/osaf/contentmodel/contacts/Contacts.py:1.16	Tue Feb 15 22:39:12 2005
+++ chandler/parcels/osaf/contentmodel/contacts/Contacts.py	Fri Mar 18 13:41:42 2005
@@ -1,13 +1,11 @@
 """ Classes used for Contacts parcel kinds
 """
 
-__revision__  = "$Revision: 1.16 $"
-__date__      = "$Date: 2005/02/16 06:39:12 $"
+__revision__  = "$Revision: 1.17 $"
+__date__      = "$Date: 2005/03/18 21:41:42 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
-from repository.item.ItemError import ChildNameError
-
 import osaf.contentmodel.ContentModel as ContentModel
 import mx.DateTime as DateTime
 import repository.query.Query as Query
@@ -56,16 +54,12 @@
         parent = ContentModel.ContentModel.getContentItemParent(view)
         me = parent.getItemChild("me")
         if me is None:
-            try:
-                me = Contact(name="me", parent=parent)
-                me.displayName = "Me"
-                me.contactName = ContactName(parent=me)
-                me.contactName.firstName = "Chandler"
-                me.contactName.lastName = "User"
-            except ChildNameError:
-                # If "me" already exists, that means we're actually
-                # in the process of creating it.
-                return None
+            me = Contact(name="me", parent=parent)
+            me.displayName = "Me"
+            me.contactName = ContactName(parent=me)
+            me.contactName.firstName = "Chandler"
+            me.contactName.lastName = "User"
+
         cls.meContactID = me.itsUUID
 
         return me

Index: chandler/repository/schema/Cloud.py
diff -u chandler/repository/schema/Cloud.py:1.23 chandler/repository/schema/Cloud.py:1.24
--- chandler/repository/schema/Cloud.py:1.23	Wed Feb  2 12:15:52 2005
+++ chandler/repository/schema/Cloud.py	Fri Mar 18 13:41:51 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.23 $"
-__date__      = "$Date: 2005/02/02 20:15:52 $"
+__revision__  = "$Revision: 1.24 $"
+__date__      = "$Date: 2005/03/18 21:41:51 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import re
 
 from repository.item.Item import Item
-from repository.item.ItemError import RecursiveDeleteError
+from chandlerdb.item.ItemError import RecursiveDeleteError
 from repository.item.RefCollections import RefList
 from repository.item.PersistentCollections import PersistentCollection
 from repository.remote.CloudFilter import CloudFilter, EndpointFilter

Index: chandler/repository/persistence/DBRepository.py
diff -u chandler/repository/persistence/DBRepository.py:1.7 chandler/repository/persistence/DBRepository.py:1.8
--- chandler/repository/persistence/DBRepository.py:1.7	Thu Feb 17 11:59:06 2005
+++ chandler/repository/persistence/DBRepository.py	Fri Mar 18 13:41:48 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.7 $"
-__date__      = "$Date: 2005/02/17 19:59:06 $"
+__revision__  = "$Revision: 1.8 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -10,7 +10,7 @@
 from struct import pack
 
 from chandlerdb.util import lock
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.item.Item import Item
 from repository.util.SAX import XMLGenerator
 from repository.persistence.Repository import Repository

Index: chandler/repository/remote/Transport.py
diff -u chandler/repository/remote/Transport.py:1.7 chandler/repository/remote/Transport.py:1.8
--- chandler/repository/remote/Transport.py:1.7	Wed Jan  5 12:17:47 2005
+++ chandler/repository/remote/Transport.py	Fri Mar 18 13:41:50 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.7 $"
-__date__      = "$Date: 2005/01/05 20:17:47 $"
+__revision__  = "$Revision: 1.8 $"
+__date__      = "$Date: 2005/03/18 21:41:50 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import sys, re, xmlrpclib, jabber
 
 from SOAPpy import SOAPProxy
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 
 
 class RemoteError(ValueError):

Index: chandler/repository/persistence/FileContainer.py
diff -u chandler/repository/persistence/FileContainer.py:1.18 chandler/repository/persistence/FileContainer.py:1.19
--- chandler/repository/persistence/FileContainer.py:1.18	Mon Dec 13 16:31:06 2004
+++ chandler/repository/persistence/FileContainer.py	Fri Mar 18 13:41:48 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.18 $"
-__date__      = "$Date: 2004/12/14 00:31:06 $"
+__revision__  = "$Revision: 1.19 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -12,7 +12,7 @@
 from PyLucene import IndexSearcher, QueryParser
 from PyLucene import Document, Field
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.persistence.DBContainer import DBContainer
 from repository.persistence.RepositoryError import RepositoryError
 

Index: chandler/parcels/osaf/framework/sharing/WebDAV.py
diff -u chandler/parcels/osaf/framework/sharing/WebDAV.py:1.15 chandler/parcels/osaf/framework/sharing/WebDAV.py:1.16
--- chandler/parcels/osaf/framework/sharing/WebDAV.py:1.15	Mon Feb 14 16:35:04 2005
+++ chandler/parcels/osaf/framework/sharing/WebDAV.py	Fri Mar 18 13:41:43 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.15 $"
-__date__ = "$Date: 2005/02/15 00:35:04 $"
+__version__ = "$Revision: 1.16 $"
+__date__ = "$Date: 2005/03/18 21:41:43 $"
 __copyright__ = "Copyright (c) 2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -12,7 +12,7 @@
 import logging
 import application.Globals as Globals
 import crypto.ssl as ssl
-import chandlerdb.util.UUID
+import chandlerdb.util.uuid
 
 logger = logging.getLogger('WebDAV')
 logger.setLevel(logging.INFO)
@@ -328,7 +328,7 @@
     urlToTest = None
     while tries > 0:
         # Random string to use for trying a put
-        uuid = chandlerdb.util.UUID.UUID()
+        uuid = chandlerdb.util.uuid.UUID()
         url = "%s://%s%s%s%s.tmp" % (scheme, host, portString, path, uuid)
         response = client.propfind(url, depth=0)
         body = response.read()

Index: chandler/repository/tests/TestText.py
diff -u chandler/repository/tests/TestText.py:1.21 chandler/repository/tests/TestText.py:1.22
--- chandler/repository/tests/TestText.py:1.21	Wed Jan  5 12:17:49 2005
+++ chandler/repository/tests/TestText.py	Fri Mar 18 13:41:52 2005
@@ -2,15 +2,15 @@
 Text storage unit tests
 """
 
-__revision__  = "$Revision: 1.21 $"
-__date__      = "$Date: 2005/01/05 20:17:49 $"
+__revision__  = "$Revision: 1.22 $"
+__date__      = "$Date: 2005/03/18 21:41:52 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import unittest, os
 
 from repository.tests.RepositoryTestCase import RepositoryTestCase
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 
 class TestText(RepositoryTestCase):
     """ Test Text storage """

Index: chandler/repository/item/Query.py
diff -u chandler/repository/item/Query.py:1.12 chandler/repository/item/Query.py:1.13
--- chandler/repository/item/Query.py:1.12	Thu Mar  3 16:30:15 2005
+++ chandler/repository/item/Query.py	Fri Mar 18 13:41:46 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.12 $"
-__date__      = "$Date: 2005/03/04 00:30:15 $"
+__revision__  = "$Revision: 1.13 $"
+__date__      = "$Date: 2005/03/18 21:41:46 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -47,12 +47,11 @@
     def run(self, kinds):
 
         if kinds:
-            view = kinds[0].itsView
             matches = set()
             changedItems = set()
 
-            for item in view._log:
-                if item._status & Item.NDIRTY:
+            for item in kinds[0].itsView._log:
+                if item._isNDirty():
                     changedItems.add(item)
 
             for item in self._run(kinds, changedItems):

Index: chandler/repository/tests/TestIndexes.py
diff -u chandler/repository/tests/TestIndexes.py:1.3 chandler/repository/tests/TestIndexes.py:1.4
--- chandler/repository/tests/TestIndexes.py:1.3	Wed Jan  5 12:17:49 2005
+++ chandler/repository/tests/TestIndexes.py	Fri Mar 18 13:41:52 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.3 $"
-__date__      = "$Date: 2005/01/05 20:17:49 $"
+__revision__  = "$Revision: 1.4 $"
+__date__      = "$Date: 2005/03/18 21:41:52 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -75,6 +75,67 @@
             self.assert_(movies.getByIndex('n', i - 1).itsUUID == mi.itsUUID)
             self.assert_(movies.getByIndex('n', i).itsUUID == mj.itsUUID)
         
+    def _remove(self):
+
+        movies = self.rep.find(self.kh).movies
+
+        keys = movies.keys()
+        values = movies.values()
+        n = len(keys)
+
+        for m in xrange(0, n / 2):
+            i = random.randint(0, n - 1)
+            print 'random remove:', i
+
+            movie = movies.getByIndex('n', i)
+            movies.remove(movie)
+            del values[i]
+        
+            for i in xrange(0, n - 1):
+                self.assert_(values[i] is movies.getByIndex('n', i))
+            n -= 1
+
+    def _add(self):
+
+        movies = self.rep.find(self.kh).movies
+
+        keys = movies.keys()
+        values = movies.values()
+        n = len(keys)
+
+        kind = values[0].itsKind
+        parent = values[0].itsParent
+        count = random.randint(0, n / 2)
+
+        for m in xrange(0, count):
+            title = "movie%d" %(n+m)
+            movie = kind.newItem(title, parent)
+            movies.append(movie)
+        
+            for i in xrange(0, n - 1):
+                self.assert_(values[i] is movies.getByIndex('n', i))
+            for i in xrange(n, n + m):
+                self.assert_(movies.getByIndex('n', i)._name == "movie%d" %(i),
+                             movies.getByIndex('n', i)._name)
+
+    def testAdd(self):
+
+        self._add()
+
+    def testRemove(self):
+
+        self._add()
+
+    def testAddRemove(self):
+
+        self._add()
+        self._remove()
+
+    def testRemoveAdd(self):
+
+        self._remove()
+        self._add()
+
 
 if __name__ == "__main__":
 #    import hotshot

Index: chandler/repository/__hardhat__.py
diff -u chandler/repository/__hardhat__.py:1.7 chandler/repository/__hardhat__.py:1.8
--- chandler/repository/__hardhat__.py:1.7	Fri Jul  2 07:04:03 2004
+++ chandler/repository/__hardhat__.py	Fri Mar 18 13:41:45 2005
@@ -3,7 +3,7 @@
 
 info = {
         'name': 'repository',
-        'root': '../..',
+        'root': '..',
        }
 
 dependencies = ()

Index: chandler/repository/persistence/DBRefs.py
diff -u chandler/repository/persistence/DBRefs.py:1.3 chandler/repository/persistence/DBRefs.py:1.4
--- chandler/repository/persistence/DBRefs.py:1.3	Wed Feb  2 22:22:38 2005
+++ chandler/repository/persistence/DBRefs.py	Fri Mar 18 13:41:48 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.3 $"
-__date__      = "$Date: 2005/02/03 06:22:38 $"
+__revision__  = "$Revision: 1.4 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -10,7 +10,7 @@
 from repository.item.RefCollections import RefList
 from repository.item.Indexes import NumericIndex
 from repository.persistence.RepositoryError import MergeError, ItemViewError
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.LinkedMap import LinkedMap
 
 
@@ -18,6 +18,8 @@
 
     class link(LinkedMap.link):
 
+        __slots__ = ()
+
         def getValue(self, linkedMap):
 
             value = self._value

Index: chandler/parcels/osaf/framework/sharing/ICalendar.py
diff -u chandler/parcels/osaf/framework/sharing/ICalendar.py:1.15 chandler/parcels/osaf/framework/sharing/ICalendar.py:1.16
--- chandler/parcels/osaf/framework/sharing/ICalendar.py:1.15	Thu Mar 10 23:16:52 2005
+++ chandler/parcels/osaf/framework/sharing/ICalendar.py	Fri Mar 18 13:41:43 2005
@@ -2,7 +2,7 @@
 import application.Parcel
 import osaf.contentmodel.ItemCollection as ItemCollection
 import osaf.contentmodel.calendar.Calendar as Calendar
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 import StringIO
 import vobject
 import logging

Index: chandler/repository/persistence/DBLob.py
diff -u chandler/repository/persistence/DBLob.py:1.3 chandler/repository/persistence/DBLob.py:1.4
--- chandler/repository/persistence/DBLob.py:1.3	Thu Mar  3 18:43:52 2005
+++ chandler/repository/persistence/DBLob.py	Fri Mar 18 13:41:48 2005
@@ -1,13 +1,13 @@
 
-__revision__  = "$Revision: 1.3 $"
-__date__      = "$Date: 2005/03/04 02:43:52 $"
+__revision__  = "$Revision: 1.4 $"
+__date__      = "$Date: 2005/03/18 21:41:48 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 
 from repository.item.Values import Values, ItemValue
 from repository.util.Lob import Lob
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.Streams import ConcatenatedInputStream, NullInputStream
 
 

Index: chandler/parcels/osaf/mail/sharing.py
diff -u chandler/parcels/osaf/mail/sharing.py:1.24 chandler/parcels/osaf/mail/sharing.py:1.25
--- chandler/parcels/osaf/mail/sharing.py:1.24	Wed Feb  9 13:05:59 2005
+++ chandler/parcels/osaf/mail/sharing.py	Fri Mar 18 13:41:44 2005
@@ -1,5 +1,5 @@
-__revision__  = "$Revision: 1.24 $"
-__date__      = "$Date: 2005/02/09 21:05:59 $"
+__revision__  = "$Revision: 1.25 $"
+__date__      = "$Date: 2005/03/18 21:41:44 $"
 __copyright__ = "Copyright (c) 2005 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -13,7 +13,7 @@
 #Chandler imports
 import osaf.contentmodel.mail.Mail as Mail
 import osaf.contentmodel.ItemCollection as ItemCollection
-import repository.item.ItemError as ItemError
+import chandlerdb.item.ItemError as ItemError
 
 #Chandler Mail Service imports
 import smtp as smtp

Index: chandler/repository/item/ItemHandler.py
diff -u chandler/repository/item/ItemHandler.py:1.64 chandler/repository/item/ItemHandler.py:1.65
--- chandler/repository/item/ItemHandler.py:1.64	Tue Jan 25 19:03:34 2005
+++ chandler/repository/item/ItemHandler.py	Fri Mar 18 13:41:46 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.64 $"
-__date__      = "$Date: 2005/01/26 03:03:34 $"
+__revision__  = "$Revision: 1.65 $"
+__date__      = "$Date: 2005/03/18 21:41:46 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -10,9 +10,9 @@
 from repository.item.PersistentCollections import PersistentDict
 from repository.item.Values import Values, References, ItemValue
 from repository.persistence.RepositoryError import NoSuchItemError
-from repository.item.ItemError import *
+from chandlerdb.item.ItemError import *
 
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.util.Path import Path
 from repository.util.ClassLoader import ClassLoader
 from repository.util.SAX import ContentHandler
@@ -282,27 +282,29 @@
 
     def getTypeName(self, attribute, attrs, default):
 
+        name = None
+
         if attrs.has_key('typeid'):
             try:
-                return self.repository[UUID(attrs['typeid'])].handlerName()
+                name = self.repository[UUID(attrs['typeid'])].handlerName()
             except KeyError:
                 raise TypeError, "Type %s not found" %(attrs['typeid'])
 
-        if attrs.has_key('typepath'):
+        elif attrs.has_key('typepath'):
             typeItem = self.repository.find(Path(attrs['typepath']))
             if typeItem is None:
                 raise TypeError, "Type %s not found" %(attrs['typepath'])
-            return typeItem.handlerName()
+            name = typeItem.handlerName()
 
-        if attrs.has_key('type'):
-            return attrs['type']
+        elif attrs.has_key('type'):
+            name = attrs['type']
 
-        if attribute is not None:
+        elif attribute is not None:
             attrType = attribute.getAspect('type', default=None)
             if attrType is not None:
-                return attrType.handlerName()
+                name = attrType.handlerName()
 
-        return default
+        return name or default
 
     def _setupTypeDelegate(self, attrs):
 
@@ -702,7 +704,7 @@
         otherName = attrs.get('otherName')
 
         if otherName is None and attribute is not None:
-            otherName = self.kind.getOtherName(name, default=None)
+            otherName = self.kind.getOtherName(name, None, None, None)
 
         if otherName is None:
             raise TypeError, 'Undefined other endpoint for %s.%s of kind %s' %(self.name or self.uuid, name, self.kind.itsPath)

Index: chandler/parcels/osaf/framework/wakeup/WakeupCaller.py
diff -u chandler/parcels/osaf/framework/wakeup/WakeupCaller.py:1.14 chandler/parcels/osaf/framework/wakeup/WakeupCaller.py:1.15
--- chandler/parcels/osaf/framework/wakeup/WakeupCaller.py:1.14	Thu Jan 27 14:07:35 2005
+++ chandler/parcels/osaf/framework/wakeup/WakeupCaller.py	Fri Mar 18 13:41:44 2005
@@ -4,7 +4,7 @@
 import repository.util.ClassLoader as ClassLoader
 import twisted.internet.reactor as reactor
 import logging as logging
-import chandlerdb.util.UUID as UUID
+import chandlerdb.util.uuid as UUID
 
 class WakeupCall(object):
     def receiveWakeupCall(self, wakeupCallItem):

Index: chandler/repository/schema/Alias.py
diff -u chandler/repository/schema/Alias.py:1.11 chandler/repository/schema/Alias.py:1.12
--- chandler/repository/schema/Alias.py:1.11	Wed Jan  5 12:17:48 2005
+++ chandler/repository/schema/Alias.py	Fri Mar 18 13:41:51 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.11 $"
-__date__      = "$Date: 2005/01/05 20:17:48 $"
+__revision__  = "$Revision: 1.12 $"
+__date__      = "$Date: 2005/03/18 21:41:51 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -17,6 +17,16 @@
     def isAlias(self):
         return True
 
+    def isSimple(self):
+
+        if 'types' in self._references:
+            for t in self._references['types']:
+                if not t.isSimple():
+                    return False
+            return True
+
+        return False
+
     def type(self, value):
 
         if 'types' in self._references:

Index: chandler/parcels/osaf/framework/blocks/ContainerBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.151 chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.152
--- chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.151	Mon Feb  7 14:53:54 2005
+++ chandler/parcels/osaf/framework/blocks/ContainerBlocks.py	Fri Mar 18 13:41:43 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.151 $"
-__date__ = "$Date: 2005/02/07 22:53:54 $"
+__version__ = "$Revision: 1.152 $"
+__date__ = "$Date: 2005/03/18 21:41:43 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -7,7 +7,7 @@
 from DragAndDrop import DropReceiveWidget as DropReceiveWidget
 from DynamicContainerBlocks import Toolbar as Toolbar
 from Styles import Font
-from chandlerdb.util.UUID import UUID
+from chandlerdb.util.uuid import UUID
 from repository.item.Item import Item
 from osaf.contentmodel.ItemCollection import ItemCollection
 import wx

Index: chandler/repository/schema/Kind.py
diff -u chandler/repository/schema/Kind.py:1.104 chandler/repository/schema/Kind.py:1.105
--- chandler/repository/schema/Kind.py:1.104	Mon Feb 28 12:28:11 2005
+++ chandler/repository/schema/Kind.py	Fri Mar 18 13:41:51 2005
@@ -1,21 +1,24 @@
 
-__revision__  = "$Revision: 1.104 $"
-__date__      = "$Date: 2005/02/28 20:28:11 $"
+__revision__  = "$Revision: 1.105 $"
+__date__      = "$Date: 2005/03/18 21:41:51 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 from new import classobj
 
+from chandlerdb.util.uuid import UUID, _combine
+from chandlerdb.schema.descriptor import CDescriptor
+from chandlerdb.item.ItemError import NoSuchAttributeError, SchemaError
+
 from repository.item.Item import Item
 from repository.item.Values import ItemValue, Values, References
 from repository.item.PersistentCollections import PersistentCollection
-from repository.item.ItemError import NoSuchAttributeError, SchemaError
 from repository.persistence.RepositoryError import RecursiveLoadItemError
 from repository.util.Path import Path
-from chandlerdb.util.UUID import UUID, _uuid
 from repository.util.SingleRef import SingleRef
 from repository.item.Monitors import Monitors, Monitor
 
+
 class Kind(Item):
 
     def __init__(self, name, parent, kind):
@@ -101,10 +104,14 @@
                 raise AssertionError, sync
             
             for name, descriptor in descriptors.items():
-                attr = descriptor.getAttribute(self)
-                if not (attr is None or attr[0] in attributes):
-                    if descriptor.unregisterAttribute(self):
-                        delattr(cls, name)
+                try:
+                    attrId, flags = descriptor.getAttribute(self)
+                except KeyError:
+                    pass
+                else:
+                    if attrId not in attributes:
+                        if descriptor.unregisterAttribute(self):
+                            delattr(cls, name)
 
         for name, attribute, k in self.iterAttributes():
             descriptor = cls.__dict__.get(name, None)
@@ -164,7 +171,7 @@
         is the repository.
         @type parent: an item or the item's repository view
         @param uuid: The uuid for the item.
-        @type uuid: L{UUID<chandlerdb.util.UUID.UUID>}
+        @type uuid: L{UUID<chandlerdb.util.uuid.UUID>}
         @param cls: an optional python class to instantiate the item with,
         defaults to the class set on this kind.
         @type cls: a python new style class, that is, a type instance
@@ -218,13 +225,13 @@
 
         superClasses = []
         
-        hash = _uuid.combine(0, self._uuid._hash)
+        hash = _combine(0, self._uuid._hash)
         for superKind in self.getAttributeValue('superKinds',
                                                 _attrDict=self._references):
             c = superKind.getItemClass()
             if c is not Item and c not in superClasses:
                 superClasses.append(c)
-                hash = _uuid.combine(hash, superKind._uuid._hash)
+                hash = _combine(hash, superKind._uuid._hash)
 
         count = len(superClasses)
 
@@ -290,8 +297,11 @@
                 result = False
         else:
             for name, descriptor in descriptors.iteritems():
-                attr = descriptor.getAttribute(self)
-                if attr is not None:
+                try:
+                    attrId, flags = descriptor.getAttribute(self)
+                except KeyError:
+                    pass
+                else:
                     clsDescriptor = cls.__dict__.get(name, None)
                     if clsDescriptor is not descriptor:
                         self.itsView.logger.warn("Descriptor for attribute '%s', %s, on class %s doesn't match descriptor on Kind %s, %s", name, clsDescriptor, cls, self.itsPath, descriptor)
@@ -301,7 +311,7 @@
                         self.itsView.logger.warn("Descriptor for attribute '%s' on class %s doesn't correspond to an attribute on Kind %s", name, cls, self.itsPath)
                         result = False
                     else:
-                        if attr[0] != attribute._uuid:
+                        if attrId != attribute._uuid:
                             self.itsView.logger.warn("Descriptor for attribute '%s' on class %s doesn't correspond to the attribute of the same name on Kind %s", name, cls, self.itsPath)
                             result = False
 
@@ -319,7 +329,7 @@
 
         return None
 
-    def getAttribute(self, name, noError=False):
+    def getAttribute(self, name, noError=False, item=None):
         """
         Get an attribute definition item.
 
@@ -333,6 +343,19 @@
         instance
         """
 
+        if item is not None:
+            try:
+                descriptor = Kind._descriptors[type(item)][name]
+            except KeyError:
+                pass
+            else:
+                try:
+                    attrId, flags = descriptor.getAttribute(self)
+                except KeyError:
+                    pass
+                else:
+                    return self.itsView.find(attrId)
+
         refs = self._references
         child = self.getItemChild(name)
 
@@ -366,17 +389,24 @@
         else:
             return self._inheritAttribute(name) is not None
 
-    def getOtherName(self, name, **kwds):
+    def getOtherName(self, name, _attrID=None, item=None, default=0):
+
+        if 'otherNames' in self._values:
+            try:
+                return self._values['otherNames'][name]
+            except KeyError:
+                pass
 
-        otherName = self.getAttributeValue('otherNames', default={},
-                                           _attrDict=self._values).get(name)
+        if _attrID is not None:
+            attribute = self.find(_attrID)
+        else:
+            attribute = self.getAttribute(name, False, item)
 
+        otherName = attribute._values.get('otherName', None)
         if otherName is None:
-            otherName = self.getAttribute(name).getAspect('otherName')
-            if otherName is None:
-                if 'default' in kwds:
-                    return kwds['default']
-                raise TypeError, 'Undefined otherName for attribute %s on kind %s' %(name, self.itsPath)
+            if default != 0:
+                return default
+            raise TypeError, 'Undefined otherName for attribute %s on kind %s' %(name, self.itsPath)
 
         return otherName
 
@@ -487,9 +517,9 @@
             else:
                 duplicates[superKind._uuid] = superKind
                 
-        hash = _uuid.combine(0, self._uuid._hash)
+        hash = _combine(0, self._uuid._hash)
         for superKind in superKinds:
-            hash = _uuid.combine(hash, superKind._uuid._hash)
+            hash = _combine(hash, superKind._uuid._hash)
         if hash < 0:
             hash = ~hash
         name = "mixin_%08x" %(hash)
@@ -579,7 +609,7 @@
                     item.setDirty(Item.RDIRTY, name,
                                   attrDict=references, noMonitors=True)
 
-    def flushCaches(self):
+    def flushCaches(self, reason):
         """
         Flush the caches setup on this Kind and its subKinds.
 
@@ -609,7 +639,14 @@
         for subKind in self.getAttributeValue('subKinds',
                                               _attrDict=self._references,
                                               default=[]):
-            subKind.flushCaches()
+            subKind.flushCaches(reason)
+
+        if reason is not None:
+            logger = self.itsView.logger
+            for cls in Kind._kinds.get(self._uuid, []):
+                logger.warning('Change in %s caused syncing of attribute descriptors on class %s.%s for Kind %s', reason, cls.__module__, cls.__name__, self.itsPath)
+                self._setupDescriptors(cls, reason)
+            
 
 
     # begin typeness of Kind as SingleRef
@@ -681,6 +718,10 @@
     
         return False
 
+    def isSimple(self):
+
+        return False
+
     # end typeness of Kind as SingleRef
 
     def getClouds(self, cloudAlias):
@@ -714,26 +755,30 @@
     _descriptors = {}
     
 
-class Descriptor(object):
-
-    def __init__(self, name):
-
-        self.name = name
-        self.attrs = {}
+class Descriptor(CDescriptor):
 
     def registerAttribute(self, kind, attribute):
 
         values = attribute._values
         
         if 'otherName' in values:
-            flags = Descriptor.REF
+            flags = CDescriptor.REF
+            if values.get('cardinality', 'single') in ('list', 'dict'):
+                flags |= CDescriptor.SIMPLE
+                
         elif 'redirectTo' in values:
-            flags = Descriptor.REDIRECT
+            flags = CDescriptor.REDIRECT
+
         else:
-            flags = Descriptor.VALUE
+            flags = CDescriptor.VALUE
+            type = attribute.getAttributeValue('type',
+                                               _attrDict=attribute._references,
+                                               default=None)
+            if type is not None and type.isSimple():
+                flags |= CDescriptor.SIMPLE
 
         if values.get('required', False):
-            flags |= Descriptor.REQUIRED
+            flags |= CDescriptor.REQUIRED
 
         self.attrs[kind._uuid] = (attribute._uuid, flags)
 
@@ -744,7 +789,7 @@
 
     def getAttribute(self, kind):
 
-        return self.attrs.get(kind._uuid, None)
+        return self.attrs[kind._uuid]
 
     def isValueRequired(self, item):
 
@@ -755,7 +800,7 @@
         else:
             attrDict = self.getAttrDict(item, flags)
             return attrDict, (attrDict is not None and
-                              flags & Descriptor.REQUIRED != 0)
+                              flags & CDescriptor.REQUIRED != 0)
 
     def getName(self):
 
@@ -763,37 +808,15 @@
 
     def getAttrDict(self, obj, flags):
 
-        if flags & Descriptor.VALUE:
+        if flags & CDescriptor.VALUE:
             return obj._values
-        elif flags & Descriptor.REF:
+        elif flags & CDescriptor.REF:
             return obj._references
-        elif flags & Descriptor.REDIRECT:
+        elif flags & CDescriptor.REDIRECT:
             return None
 
         raise AssertionError, (self.name, flags)
 
-    def __get__(self, obj, owner):
-
-        if obj is None:
-            raise AttributeError, self.name
-
-        kind = obj._kind
-        if kind is not None:
-            try:
-                attrID, flags = self.attrs[kind._uuid]
-                attrDict = self.getAttrDict(obj, flags)
-            except KeyError:
-                pass
-            else:
-                return obj.getAttributeValue(self.name,
-                                             _attrDict=attrDict,
-                                             _attrID=attrID)
-
-        try:
-            return obj.__dict__[self.name]
-        except KeyError:
-            raise AttributeError, self.name
-            
     def __set__(self, obj, value):
 
         if obj is None:
@@ -834,11 +857,6 @@
             del obj.__dict__[self.name]
         except KeyError:
             raise AttributeError, self.name
-
-    VALUE    = 0x0001
-    REF      = 0x0002
-    REDIRECT = 0x0004
-    REQUIRED = 0x0008
     
 
 class SchemaMonitor(Monitor):
@@ -846,8 +864,4 @@
     def schemaChange(self, op, kind, attrName):
 
         if isinstance(kind, Kind) and kind.monitorSchema:
-            kind.flushCaches()
-            logger = kind.itsView.logger
-            for cls in Kind._kinds.get(kind._uuid, []):
-                logger.warning('Change in %s caused syncing of attribute descriptors on class %s.%s for Kind %s', attrName, cls.__module__, cls.__name__, kind.itsPath)
-                kind._setupDescriptors(cls, attrName)
+            kind.flushCaches(attrName)

Index: chandler/repository/tests/TestRedirectToOrdering.py
diff -u chandler/repository/tests/TestRedirectToOrdering.py:1.3 chandler/repository/tests/TestRedirectToOrdering.py:1.4
--- chandler/repository/tests/TestRedirectToOrdering.py:1.3	Thu Jul 22 13:50:43 2004
+++ chandler/repository/tests/TestRedirectToOrdering.py	Fri Mar 18 13:41:52 2005
@@ -2,8 +2,8 @@
 Unit tests for the ordering under mixinKinds of the redirectTo aspect 
 """
 
-__revision__  = "$Revision: 1.3 $"
-__date__      = "$Date: 2004/07/22 20:50:43 $"
+__revision__  = "$Revision: 1.4 $"
+__date__      = "$Date: 2005/03/18 21:41:52 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -127,18 +127,17 @@
             aTask = taskKind.newItem('aTask', self.rep)
 
         redirectTo = aTask.getAttributeAspect('who', 'redirectTo')
-        print "who points to " + aTask.getAttributeAspect('who', 'redirectTo')
-        self.assert_(redirectTo == 'creator')
+        print "who points to", aTask.getAttributeAspect('who', 'redirectTo')
+        self.assert_(redirectTo == 'creator', redirectTo)
 
         # place the last superKind first
         taskKind.superKinds.placeItem(taskKind.superKinds.last(), None)
-
         # flush kind caches after re-arranging superKinds
-        taskKind.flushCaches()
+        taskKind.flushCaches('superKinds')
 
         redirectTo = aTask.getAttributeAspect('who', 'redirectTo')
-        print "who points to " + aTask.getAttributeAspect('who', 'redirectTo')
-        self.assert_(redirectTo == 'participant')
+        print "who points to", aTask.getAttributeAspect('who', 'redirectTo')
+        self.assert_(redirectTo == 'participant', redirectTo)
         
                   
 if __name__ == "__main__":

Index: chandler/repository/item/Item.py
diff -u chandler/repository/item/Item.py:1.200 chandler/repository/item/Item.py:1.201
--- chandler/repository/item/Item.py:1.200	Wed Mar  2 14:10:00 2005
+++ chandler/repository/item/Item.py	Fri Mar 18 13:41:46 2005
@@ -1,32 +1,28 @@
 
-__revision__  = "$Revision: 1.200 $"
-__date__      = "$Date: 2005/03/02 22:10:00 $"
+__revision__  = "$Revision: 1.201 $"
+__date__      = "$Date: 2005/03/18 21:41:46 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import cStringIO
 
+from chandlerdb.util.uuid import UUID
+from chandlerdb.schema.descriptor import _countAccess
+from chandlerdb.item.item import CItem
+from chandlerdb.item.ItemError import *
+
 from repository.item.RefCollections import RefList
 from repository.item.Values import Values, References, ItemValue
 from repository.item.Access import ACL
 from repository.item.PersistentCollections \
      import PersistentCollection, PersistentList, PersistentDict
-from repository.item.ItemError import *
 
 from repository.util.SingleRef import SingleRef
-from chandlerdb.util.UUID import UUID
 from repository.util.Path import Path
 from repository.util.LinkedMap import LinkedMap
 
 
-__access__ = 0L
-
-def _countAccess():
-    global __access__; __access__ += 1
-    return __access__
-    
-
-class Item(object):
+class Item(CItem):
     'The root class for all items.'
     
     def __init__(self, name, parent, kind):
@@ -49,14 +45,10 @@
         @type kind: an item
         """
 
-        # This needs to be the top of the inheritance diamond, hence we're
-        # not calling super() here.
+        super(Item, self).__init__()
 
         cls = type(self)
-        
-        self.__dict__.update({ '_status': Item.NEW,
-                               '_version': 0L,
-                               '_lastAccess': 0L,
+        self.__dict__.update({ '_version': 0L,
                                '_uuid': UUID(),
                                '_values': Values(self),
                                '_references': References(self),
@@ -89,12 +81,11 @@
 
     def _fillItem(self, name, parent, kind, **kwds):
 
+        self._status = kwds.get('status', 0)
         self.__dict__.update({ '_uuid': kwds['uuid'],
                                '_name': name or None,
                                '_kind': kind,
-                               '_status': kwds.get('status', 0),
                                '_version': kwds['version'],
-                               '_lastAccess': 0L,
                                '_values': kwds.get('values'),
                                '_references': kwds.get('references') })
 
@@ -133,14 +124,16 @@
         @return: a string representation of an item.
         """
 
-        if self._status & Item.RAW:
+        _status = self._status
+        
+        if _status & Item.RAW:
             return super(Item, self).__repr__()
 
-        if self._status & Item.DELETED:
+        if _status & Item.DELETED:
             status = ' (deleted)'
-        elif self._status & Item.STALE:
+        elif _status & Item.STALE:
             status = ' (stale)'
-        elif self._status & Item.NEW:
+        elif _status & Item.NEW:
             status = ' (new)'
         else:
             status = ''
@@ -167,7 +160,7 @@
         """
 
         if self._kind is not None:
-            attribute = self._kind.getAttribute(name, True)
+            attribute = self._kind.getAttribute(name, True, self)
             if attribute is not None:
                 return attribute.hasAspect(aspect)
 
@@ -274,7 +267,7 @@
                 attribute = self.find(_attrID)
             else:
                 noError = kwds.get('noError', False)
-                attribute = self._kind.getAttribute(name, noError=noError)
+                attribute = self._kind.getAttribute(name, noError, self)
 
             if attribute is not None:
                 if aspect != 'redirectTo':
@@ -319,7 +312,8 @@
             elif self._references.has_key(name):
                 _attrDict = self._references
             else:
-                otherName = self._kind.getOtherName(name, default=Item.Nil)
+                otherName = self._kind.getOtherName(name, _attrID, self,
+                                                    Item.Nil)
                 if otherName is not Item.Nil:
                      _attrDict = self._references
                 else:
@@ -362,7 +356,7 @@
                 dirty = Item.VDIRTY
             else:
                 if otherName is None:
-                    otherName = self._kind.getOtherName(name)
+                    otherName = self._kind.getOtherName(name, _attrID, self)
                 self._references._setValue(name, value, otherName)
                 setDirty = False
 
@@ -459,10 +453,10 @@
         @return: a value
         """
 
-        if self._status & Item.STALE:
+        if self.isStale():
             raise StaleItemError, self
 
-        self._lastAccess = _countAccess()
+        _countAccess(self)
 
         try:
             if (_attrDict is self._values or
@@ -483,7 +477,7 @@
             if _attrID is not None:
                 attribute = self.find(_attrID)
             else:
-                attribute = self._kind.getAttribute(name)
+                attribute = self._kind.getAttribute(name, False, self)
 
             inherit = attribute.getAspect('inheritFrom', default=None)
             if inherit is not None:
@@ -562,7 +556,10 @@
                 value = _attrDict._getRef(name)
             except KeyError:
                 raise NoLocalValueForAttributeError, (self, name)
-            _attrDict._removeValue(name, value, self._kind.getOtherName(name))
+            otherName = self._kind.getOtherName(name, _attrID, self)
+            _attrDict._removeValue(name, value, otherName)
+
+        Item._monitorsClass.invoke('remove', self, name)
 
     def hasChild(self, name, load=True):
         """
@@ -651,7 +648,7 @@
         @type load: boolean
         """
         
-        if self._status & Item.STALE:
+        if self.isStale():
             raise StaleItemError, self
 
         if not load:
@@ -824,11 +821,11 @@
         """
 
         if _attrDict is None:
-            if self._values.has_key(attribute):
+            if attribute in self._values:
                 _attrDict = self._values
-            elif self._references.has_key(attribute):
+            elif attribute in self._references:
                 _attrDict = self._references
-            elif self._kind.getOtherName(attribute, default=None):
+            elif self._kind.getOtherName(attribute, None, self, None):
                 _attrDict = self._references
             else:
                 redirect = self.getAttributeAspect(attribute, 'redirectTo',
@@ -923,11 +920,11 @@
         """
 
         if _attrDict is None:
-            if self._values.has_key(attribute):
+            if attribute in self._values:
                 _attrDict = self._values
-            elif self._references.has_key(attribute):
+            elif attribute in self._references:
                 _attrDict = self._references
-            elif self._kind.getOtherName(attribute, default=None):
+            elif self._kind.getOtherName(attribute, None, self, None):
                 _attrDict = self._references
             else:
                 redirect = self.getAttributeAspect(attribute, 'redirectTo',
@@ -1062,11 +1059,11 @@
         """
 
         if _attrDict is None:
-            if self._values.has_key(attribute):
+            if attribute in self._values:
                 _attrDict = self._values
-            elif self._references.has_key(attribute):
+            elif attribute in self._references:
                 _attrDict = self._references
-            elif self._kind.getOtherName(attribute, default=None):
+            elif self._kind.getOtherName(attribute, None, self, None):
                 _attrDict = self._references
             else:
                 redirect = self.getAttributeAspect(attribute, 'redirectTo',
@@ -1132,82 +1129,10 @@
         else:
             return _attrDict._isDirty(name)
 
-    def _isAttaching(self):
-
-        return (self._status & Item.ATTACHING) != 0
-
-    def _setAttaching(self, attaching=True):
-
-        if attaching:
-            self._status |= Item.ATTACHING
-        else:
-            self._status &= ~Item.ATTACHING
-
-    def isDeleting(self):
-        """
-        Tell whether this item is in the process of being deleted.
-
-        @return: C{True} or C{False}
-        """
-        
-        return (self._status & Item.DELETING) != 0
-    
-    def isNew(self):
-        """
-        Tell whether this item is new.
-
-        A new item is defined as an item that was before committed to the
-        repository.
-        
-        @return: C{True} or C{False}
-        """
-
-        return (self._status & Item.NEW) != 0
-    
-    def isDeleted(self):
-        """
-        Tell whether this item is deleted.
-
-        @return: C{True} or C{False}
-        """
-
-        return (self._status & Item.DELETED) != 0
-    
-    def isStale(self):
-        """
-        Tell whether this item pointer is out of date.
-
-        A stale item pointer is defined as an item pointer that is no longer
-        valid. When an item is unloaded, the item pointer is marked
-        stale. The item pointer can be refreshed by reloading the item via the
-        L{find} method, passing it the item's C{uuid} obtained via the
-        L{itsUUID} property.
-        
-        Stale items are encountered when item pointers are kept across
-        transaction boundaries. It is recommended to keep the item's
-        C{uuid} instead.
-
-        @return: C{True} or C{False}
-        """
-
-        return (self._status & Item.STALE) != 0
-    
     def _setStale(self):
 
         self._status |= Item.STALE
 
-    def isPinned(self):
-        """
-        Tell whether this item is pinned.
-
-        A pinned item is not freed from memory or marked stale, until it
-        is un-pinned or deleted.
-        
-        @return: C{True} or C{False}
-        """
-
-        return (self._status & Item.PINNED) != 0
-
     def setPinned(self, pinned=True):
         """
         Pin or Un-pin this item.
@@ -1221,24 +1146,6 @@
         else:
             self._status &= ~Item.PINNED
 
-    def isDirty(self):
-        """
-        Tell whether this item was changed and needs to be committed.
-
-        @return: C{True} or C{False}
-        """
-        
-        return (self._status & Item.DIRTY) != 0
-
-    def getDirty(self):
-        """
-        Return the dirty flags currently set on this item.
-
-        @return: an integer
-        """
-
-        return self._status & Item.DIRTY
-
     def setDirty(self, dirty, attribute=None, attrDict=None, noMonitors=False):
         """
         Mark this item to get committed with the current transaction.
@@ -1273,11 +1180,13 @@
                 if not noMonitors:
                     Item._monitorsClass.invoke('set', self, attribute)
                 
-            self._lastAccess = _countAccess()
+            _countAccess(self)
             dirty |= Item.FDIRTY
 
-            if self._status & Item.DIRTY == 0:
-                view = self.getRepositoryView()
+            view = self.getRepositoryView()
+            view._status |= view.FDIRTY
+            
+            if not self.isDirty():
                 if view is not None and not view.isLoading():
                     if attribute is not None:
                         if not self.getAttributeAspect(attribute, 'persist',
@@ -1287,7 +1196,7 @@
                     if view._logItem(self):
                         self._status |= dirty
                         return True
-                    elif self._status & Item.NEW:
+                    elif self.isNew():
                         view.logger.error('logging of new item %s failed', self.itsPath)
             else:
                 self._status |= dirty
@@ -1452,7 +1361,7 @@
             
         elif not self._status & (Item.DELETED | Item.DELETING):
 
-            if self._status & Item.STALE:
+            if self.isStale():
                 raise StaleItemError, self
 
             if not recursive and self.hasChildren():
@@ -1557,7 +1466,7 @@
 
         count = 0
 
-        if not (self._status & Item.STALE):
+        if not self.isStale():
             for name in self._references.iterkeys():
                 if counted:
                     policy = self.getAttributeAspect(name, 'countPolicy',
@@ -1573,7 +1482,7 @@
 
         count = 0
 
-        if not (self._status & Item.STALE):
+        if not self.isStale():
             count += self._values._refCount()
             count += self._references._refCount()
             if self._children is not None:
@@ -1636,7 +1545,7 @@
     def __getKind(self):
 
         kind = self._kind
-        if kind is not None and kind._status & Item.STALE:
+        if kind is not None and kind.isStale():
             kind = self.getRepositoryView()[kind._uuid]
             self._kind = kind
                 
@@ -1655,7 +1564,7 @@
                 else:
                     def removeOrphans(attrDict):
                         for name in attrDict.keys():
-                            curAttr = self._kind.getAttribute(name)
+                            curAttr = self._kind.getAttribute(name, False, self)
                             try:
                                 newAttr = kind.getAttribute(name)
                             except AttributeError:
@@ -1677,7 +1586,7 @@
                 kind._setupClass(self.__class__)
                 kind.getInitialValues(self, self._values, self._references)
 
-            Item._monitorsClass.invoke('kind', self, 'schema')
+            Item._monitorsClass.invoke('schema', self, 'kind')
 
     def mixinKinds(self, *kinds):
         """
@@ -1819,10 +1728,10 @@
         @return: a repository view
         """
 
-        if self._root is None:
-            return None
-        else:
+        try:
             return self._root._parent
+        except AttributeError:
+            return None
 
     def rename(self, name):
         """
@@ -1884,21 +1793,6 @@
             self._setParent(newParent, previous, next, oldView)
             self.setDirty(Item.NDIRTY)
 
-    def _isRepository(self):
-        return False
-
-    def _isView(self):
-        return False
-
-    def _isItem(self):
-        return True
-
-    def _isRefList(self):
-        return False
-
-    def _isUUID(self):
-        return False
-
     def _setParent(self, parent, previous=None, next=None, oldView=None):
 
         if parent is not None:
@@ -1955,7 +1849,7 @@
         @return: an item
         """
 
-        if self._status & Item.STALE:
+        if self.isStale():
             raise StaleItemError, self
 
         child = None
@@ -1966,13 +1860,10 @@
 
     def __getitem__(self, key):
 
-        if isinstance(key, str) or isinstance(key, unicode):
-            child = self.getItemChild(key)
-            if child is not None:
-                return child
-            raise KeyError, key
-
-        raise TypeError, key
+        child = self.getItemChild(key)
+        if child is not None:
+            return child
+        raise KeyError, key
 
     def isRemote(self):
         """
@@ -2036,7 +1927,7 @@
 
         attrName = kwds.get('attribute', None)
         if attrName is not None:
-            attr = self._kind.getAttribute(attrName)
+            attr = self._kind.getAttribute(attrName, False, self)
         else:
             attr = None
         
@@ -2061,10 +1952,10 @@
 
         if path[_index] == '..':
             if attr is not None:
-                otherName = self._kind.getOtherName(attrName)
+                otherName = self._kind.getOtherName(attrName, None, self)
                 parent = self.getAttributeValue(otherName,
                                                 _attrDict=self._references)
-                otherAttr = self._kind.getAttribute(otherName)
+                otherAttr = self._kind.getAttribute(otherName, False, self)
                 if otherAttr.cardinality == 'list':
                     parent = parent.first()
             else:
@@ -2115,7 +2006,7 @@
 
         @param spec: a path or UUID
         @type spec: L{Path<repository.util.Path.Path>} or
-                    L{UUID<chandlerdb.util.UUID.UUID>} 
+                    L{UUID<chandlerdb.util.uuid.UUID>} 
         @param attribute: the attribute for the ref-collections to search
         @type attribute: a string
         @param load: load the item if it not yet loaded, C{True} by default
@@ -2130,7 +2021,7 @@
             return self.walk(spec, lambda parent, name, child, **kwds: child,
                              attribute=attribute, load=load)
 
-        raise TypeError, '%s is not Path or UUID' %(type(spec))
+        raise TypeError, '%s, %s is not Path or UUID' %(spec, type(spec))
 
     def findPath(self, path, attribute=None, load=True):
         """
@@ -2162,7 +2053,7 @@
         See L{find} for more information.
 
         @param uuid: a UUID
-        @type uuid: L{UUID<chandlerdb.util.UUID.UUID>} or a uuid string
+        @type uuid: L{UUID<chandlerdb.util.uuid.UUID>} or a uuid string
         @param load: load the item if it not yet loaded, C{True} by default
         @type load: boolean
         @return: an item or C{None} if not found
@@ -2177,7 +2068,7 @@
 
     def _unloadItem(self, reloadable):
 
-        if self._status & Item.DIRTY:
+        if self.isDirty():
             raise DirtyItemError, self
 
         view = self.getRepositoryView()
@@ -2185,7 +2076,7 @@
         if hasattr(type(self), 'onItemUnload'):
             self.onItemUnload(view)
 
-        if not self._status & Item.STALE:
+        if not self.isStale():
 
             if self._values:
                 self._values._unload()
@@ -2215,7 +2106,7 @@
     def _refList(self, name, otherName=None, persist=None):
 
         if otherName is None:
-            otherName = self._kind.getOtherName(name)
+            otherName = self._kind.getOtherName(name, None, self)
         if persist is None:
             persist = self.getAttributeAspect(name, 'persist', default=True)
 
@@ -2250,9 +2141,8 @@
 
     def __new__(cls, *args, **kwds):
 
-        item = object.__new__(cls, *args, **kwds)
-        item.__dict__.update({ '_status': Item.RAW,
-                               '_parent': None,
+        item = CItem.__new__(cls, *args, **kwds)
+        item.__dict__.update({ '_parent': None,
                                '_children': None,
                                '_root': None,
                                '_acls': None })
@@ -2266,35 +2156,6 @@
             return False
     Nil        = nil()
     
-    DELETED    = 0x00000001
-    VDIRTY     = 0x00000002           # literal or ref changed
-    DELETING   = 0x00000004
-    RAW        = 0x00000008
-    ATTACHING  = 0x00000010
-    SCHEMA     = 0x00000020
-    NEW        = 0x00000040
-    STALE      = 0x00000080
-    NDIRTY     = 0x00000100           # parent or name changed
-    CDIRTY     = 0x00000200           # children list changed
-    RDIRTY     = 0x00000400           # ref collection changed
-    CORESCHEMA = 0x00000800           # core schema item
-    CONTAINER  = 0x00001000           # has children
-    ADIRTY     = 0x00002000           # acl(s) changed
-    PINNED     = 0x00004000           # auto-refresh, don't stale
-    NODIRTY    = 0x00008000           # turn off dirtying
-    FDIRTY     = 0x00010000           # fresh dirty since last mapChange call
-    VMERGED    = 0x00020000
-    RMERGED    = 0x00040000
-    NMERGED    = 0x00080000
-    CMERGED    = 0x00100000
-
-    VRDIRTY    = VDIRTY | RDIRTY
-    DIRTY      = VDIRTY | RDIRTY | NDIRTY | CDIRTY
-    MERGED     = VMERGED | RMERGED | NMERGED | CMERGED
-    SAVEMASK   = (DIRTY | ADIRTY |
-                  NEW | DELETED |
-                  SCHEMA | CORESCHEMA | CONTAINER)
-
     itsName = property(fget = __getName,
                        fset = rename,
                        doc =

Index: chandler/repository/util/SkipList.py
diff -u chandler/repository/util/SkipList.py:1.4 chandler/repository/util/SkipList.py:1.5
--- chandler/repository/util/SkipList.py:1.4	Wed Sep 29 13:04:05 2004
+++ chandler/repository/util/SkipList.py	Fri Mar 18 13:41:53 2005
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.4 $"
-__date__      = "$Date: 2004/09/29 20:04:05 $"
+__revision__  = "$Revision: 1.5 $"
+__date__      = "$Date: 2005/03/18 21:41:53 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -22,6 +22,8 @@
 
     class node(object):
 
+        __slots__ = ('_levels')
+
         def __init__(self, level, skipList):
 
             self._levels = []
@@ -57,6 +59,8 @@
 
     class point(object):
 
+        __slots__ = ('prevKey', 'nextKey', 'dist')
+
         def __init__(self, dist, skipList):
 
             self.prevKey = None



More information about the Commits mailing list