[Commits] (vajda) fixed first part of bug 1780

commits at osafoundation.org commits at osafoundation.org
Thu Aug 26 12:25:05 PDT 2004


Commit by: vajda
Modified files:
chandler/repository/item/ItemRef.py 1.87 1.88

Log message:
fixed first part of bug 1780

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/ItemRef.py.diff?r1=text&tr1=1.87&r2=text&tr2=1.88

Index: chandler/repository/item/ItemRef.py
diff -u chandler/repository/item/ItemRef.py:1.87 chandler/repository/item/ItemRef.py:1.88
--- chandler/repository/item/ItemRef.py:1.87	Thu Aug 19 11:06:25 2004
+++ chandler/repository/item/ItemRef.py	Thu Aug 26 12:25:03 2004
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.87 $"
-__date__      = "$Date: 2004/08/19 18:06:25 $"
+__revision__  = "$Revision: 1.88 $"
+__date__      = "$Date: 2004/08/26 19:25:03 $"
 __copyright__ = "Copyright (c) 2002 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -1178,10 +1178,16 @@
 
         key = previous._uuid
 
-        if indexName is None:
-            nextKey = self.nextKey(key)
-        else:
-            nextKey = self._indexes[indexName].getNextKey(key)
+        try:
+            if indexName is None:
+                nextKey = self.nextKey(key)
+            else:
+                nextKey = self._indexes[indexName].getNextKey(key)
+        except KeyError:
+            if key in self:
+                raise
+            else:
+                raise ValueError, '%s not in collection %s' %(previous, self)
 
         if nextKey is not None:
             return self[nextKey]
@@ -1203,10 +1209,16 @@
 
         key = next._uuid
 
-        if indexName is None:
-            previousKey = self.previousKey(key)
-        else:
-            previousKey = self._indexes[indexName].getPreviousKey(key)
+        try:
+            if indexName is None:
+                previousKey = self.previousKey(key)
+            else:
+                previousKey = self._indexes[indexName].getPreviousKey(key)
+        except KeyError:
+            if key in self:
+                raise
+            else:
+                raise ValueError, '%s not in collection %s' %(next, self)
 
         if previousKey is not None:
             return self[previousKey]



More information about the Commits mailing list