[Zope-Checkins] CVS: Zope/lib/python/ZClasses - Basic.py:1.21.90.1 Method.py:1.24.24.1 Property.py:1.35.90.1 ZClass.py:1.63.68.1.2.1

Tres Seaver cvs-admin at zope.org
Mon Nov 17 17:10:35 EST 2003


Update of /cvs-repository/Zope/lib/python/ZClasses
In directory cvs.zope.org:/tmp/cvs-serv12097/lib/python/ZClasses

Modified Files:
      Tag: tseaver-strexp_delenda-branch
	Basic.py Method.py Property.py ZClass.py 
Log Message:



  - Rip string exceptins out by the root.

  - webdav/*:  clean up block statements for readability.

  - XXX:  Redirects are now showing up in the error log object;  need
          to filter!


=== Zope/lib/python/ZClasses/Basic.py 1.21 => 1.21.90.1 ===
--- Zope/lib/python/ZClasses/Basic.py:1.21	Wed Aug 14 18:03:39 2002
+++ Zope/lib/python/ZClasses/Basic.py	Mon Nov 17 17:10:04 2003
@@ -15,6 +15,7 @@
 
 import Globals, OFS.PropertySheets, OFS.Image, ExtensionClass
 import Acquisition, Products
+from zExceptions import BadRequest
 
 class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
                        OFS.PropertySheets.View):
@@ -84,7 +85,7 @@
         options=self.data()
         changed=0
         if len(actions)!=len(options):
-            raise 'Bad Request', 'wrong number of actions'
+            raise BadRequest, 'wrong number of actions'
 
         for i in range(len(actions)):
             if options[i]['action'] != actions[i]:
@@ -140,7 +141,7 @@
         options=self.data()
         for option in options:
             if option['label']==label:
-                raise 'Bad Request', (
+                raise BadRequest, (
                     'Please provide a <strong>new</strong> label.'
                     )
         if help:


=== Zope/lib/python/ZClasses/Method.py 1.24 => 1.24.24.1 ===
--- Zope/lib/python/ZClasses/Method.py:1.24	Wed May 14 10:43:45 2003
+++ Zope/lib/python/ZClasses/Method.py	Mon Nov 17 17:10:04 2003
@@ -22,6 +22,7 @@
 import OFS.content_types
 from OFS.DTMLMethod import DTMLMethod
 from Products.PythonScripts.PythonScript import PythonScript
+from zExceptions import BadRequest
 
 import marshal
 
@@ -106,10 +107,10 @@
     def _checkId(self, id, allow_dup=0,
                  _reserved=('propertysheets','manage_workspace')):
         if id in _reserved:
-            raise 'Bad Request', 'The id, %s, is reseverd' % id
+            raise BadRequest, 'The id, %s, is reseverd' % id
 
         if not allow_dup and self.getClassAttr(id, self) is not self:
-            raise 'Bad Request', (
+            raise BadRequest, (
                 'The id %s is invalid - it is already in use.' % id)
 
         ZClassMethodsSheet.inheritedAttribute('_checkId')(


=== Zope/lib/python/ZClasses/Property.py 1.35 => 1.35.90.1 ===
--- Zope/lib/python/ZClasses/Property.py:1.35	Wed Aug 14 18:03:39 2002
+++ Zope/lib/python/ZClasses/Property.py	Mon Nov 17 17:10:04 2003
@@ -225,7 +225,7 @@
             p=class_permissions[i]
             if p and (p not in perms):
                 __traceback_info__=perms, p, i
-                raise 'Invalid class permission'
+                raise ValueError, 'Invalid class permission'
 
             if name not in property_sheet_permissions: continue
 


=== Zope/lib/python/ZClasses/ZClass.py 1.63.68.1 => 1.63.68.1.2.1 ===
--- Zope/lib/python/ZClasses/ZClass.py:1.63.68.1	Tue Oct 21 09:56:27 2003
+++ Zope/lib/python/ZClasses/ZClass.py	Mon Nov 17 17:10:04 2003
@@ -20,6 +20,7 @@
 from App.FactoryDispatcher import FactoryDispatcher
 from ComputedAttribute import ComputedAttribute
 from Products.PythonScripts.PythonScript import PythonScript
+from zExceptions import BadRequest, Redirect
 import webdav.Collection
 
 import marshal
@@ -127,7 +128,7 @@
     """Add a Z Class
     """
     if bad_id(id) is not None:
-        raise 'Bad Request', (
+        raise BadRequest, (
             'The id %s is invalid as a class name.' % id)
     if not meta_type: meta_type=id
 
@@ -142,7 +143,7 @@
         elif r.has_key(b):
             bases.append(r[b])
         else:
-            raise 'Invalid class', b
+            raise ValueError, 'Invalid class: %s' % b
 
     Z=ZClass(id, title, bases, zope_object=zope_object)
     Z._zclass_.meta_type=meta_type
@@ -372,7 +373,7 @@
         jar=self._waaa_getJar()
         globals=jar.root()['ZGlobals']
         if globals.has_key(class_id):
-            raise 'Duplicate Class Ids'
+            raise ValueError, 'Duplicate Class Ids'
 
         globals[class_id]=z
 
@@ -620,7 +621,7 @@
     #def tpURL(self): return 'propertysheets'
     def manage_workspace(self, URL2):
         "Emulate standard interface for use with navigation"
-        raise 'Redirect', URL2+'/manage_workspace'
+        raise Redirect, URL2+'/manage_workspace'
 
     views       = Basic.ZClassViewsSheet('views')
     basic       = Basic.ZClassBasicSheet('basic')




More information about the Zope-Checkins mailing list