Commit cd94425e authored by 's avatar

fixed and unified raise statements

parent a4625442
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
""" Order support for 'Object Manager'. """ Order support for 'Object Manager'.
$Id: OrderSupport.py,v 1.3 2003/08/07 21:33:27 yuppie Exp $ $Id: OrderSupport.py,v 1.4 2003/09/20 10:59:51 yuppie Exp $
""" """
from types import StringType from types import StringType
...@@ -151,8 +151,8 @@ class OrderSupport: ...@@ -151,8 +151,8 @@ class OrderSupport:
try: try:
object = obj_dict[id] object = obj_dict[id]
except KeyError: except KeyError:
raise (ValueError, raise ValueError('The object with the id "%s" does not exist.'
'The object with the id "%s" does not exist.' % id) % id)
old_position = objects.index(object) old_position = objects.index(object)
new_position = max( old_position - abs(delta), min_position ) new_position = max( old_position - abs(delta), min_position )
if new_position == min_position: if new_position == min_position:
...@@ -211,7 +211,7 @@ class OrderSupport: ...@@ -211,7 +211,7 @@ class OrderSupport:
ids = self.objectIds() ids = self.objectIds()
if id in ids: if id in ids:
return ids.index(id) return ids.index(id)
raise ValueError, 'The object with the id "%s" does not exist.' % id raise ValueError('The object with the id "%s" does not exist.' % id)
security.declareProtected(manage_properties, 'moveObjectToPosition') security.declareProtected(manage_properties, 'moveObjectToPosition')
def moveObjectToPosition(self, id, position): def moveObjectToPosition(self, id, position):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment