Re: [Zope-dev] Exceptions

2000-11-12 Thread Jim Fulton


I think that this would make a great dev.zope.org fish-bowl project.

I'd love to see someone come up with an exception model for
Zope:

  - arranging exceptions in a hierarchy.

  - defining standard APIs for exceptions.

To give an example of what I'd like to gain by having
exception APIs, I'd like there to be ab API for
finding out whether an exception is meant for a human
and getting an exception as HTML, so we stop embedding
markup in exception values to indicate errors meant 
for humans.

Any volunteers? :)

Jim

seb bacon wrote:
 
 I was just building in some error handling into some UI code, and wanted to catch 
errors relating to duplicate ids.  The problem is that just about every client-side 
error raises the same kind of Exception, a 'Bad Request'.  A quick grep counted 41 
different types of 'Bad Request' in my Zope source.
 
 Wouldn't it be *much* nicer to have a hierarchy of exception types, so that 
applications can deal with them at an arbitrarily granular level?  e.g.
 
 ZopeException
 |
 `RequestException
   |  |
   |  `XMLException
   |
   `IdException
 |  |
 |  `ReservedWordException
 |
 `DuplicateException
 
 Has this discussion taken place before?  Would it be useful?  Would its 
effort:benfits ratio be too great to justify doing?
 
 seb
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-12 Thread Dieter Maurer

The Doctor What writes:
  ...
  Now here is my next problem.
  
  Using context.REQUEST.PARENTS doesn't give me the DTML Document that
  called me (so to speak).
  
  I have:
  /test/new/foo_html
  
  My PARENTS shows Zope, Test, and New, but doesn't show foo_html.
"PARENTS" contain the objects from root up to but excluding
the final object on the URL.

You may try to reference the final object by "this()".


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] PythonMethods: Can't Slice context.REQUEST.PARENTS

2000-11-12 Thread The Doctor What

* Dieter Maurer ([EMAIL PROTECTED]) [001112 17:12]:
 The Doctor What writes:
   ...
   Now here is my next problem.
   
   Using context.REQUEST.PARENTS doesn't give me the DTML Document that
   called me (so to speak).
   
   I have:
   /test/new/foo_html
   
   My PARENTS shows Zope, Test, and New, but doesn't show foo_html.
 "PARENTS" contain the objects from root up to but excluding
 the final object on the URL.
 
 You may try to reference the final object by "this()".

Dieter, thanks for your help, but I'm unsure where to use it.

Using context.this().id, self.this().id, m_self.this().id all get me
the same things:
Folder, Zope, and my method.  None give me the DTML Document
foo_html.

This would seem to be an important thing.

To re-iterate in a different way, it's the same as trying to do:
dtml-var id in a DTML Method that is called by a DTML Document.
You expect the id of the DTML Document that called you, not the
Folder that the DTML Document resides in.

Did you mean to do a this().id?  That doesn't work at all, it gives
me a Name Error.

There *must* be a way to do this.

Ciao!

-- 
It has just been discovered that research causes cancer in rats.

The Doctor What: A Holtje Production http://docwhat.gerf.org/
[EMAIL PROTECTED]   KF6VNC

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Security/Acquisition Bug? (take two)

2000-11-12 Thread Charlie Wilkinson

On Sun, Nov 12, 2000 at 11:42:32PM +0100, Dieter Maurer waxed eloquent:
 
 I tried it on my ZopeCVS installation.
 The Python parts are quite new. The C-part is about 2 weeks old.
 
 I can not observe what you describe.
 "/index_html" can be viewed as "Annonymous" without any
 change in permissions.

Hi Dieter,
Thanks for investigating.  I also gave it another try, with the same
results as my previous attempts.  Maybe I'm doing something dumb?
I have followed exactly these steps (as a regular user):

1. mkdir Zope2

2. cvs -z7 -d :pserver:[EMAIL PROTECTED]:/cvs-repository checkout Zope2

3. cd Zope2

4. python wo_pcgi.py

5. python zpasswd.py -u XX -p XX access

6. Edit start file (for port change and stupid log):

#! /bin/sh
reldir=`dirname $0`
PYTHONHOME=`cd $reldir; pwd`
export PYTHONHOME
exec /usr/bin/python \
 $PYTHONHOME/z2.py -P 9000 \
 -D "$@" STUPID_LOG_FILE=$PYTHONHOME/zope.log

7. ./start 

8. Visit http://www.boinklabs.com:9080/index_html

8. Get BASICAUTH login box...  ??

Box is Redhat 6.0 with updates, Python 1.5.2 from source.  CVS is v1.10.5.
The only bit I left out was setting up the CVS login on a prior occasion:

cvs -d :pserver:[EMAIL PROTECTED]:/cvs-repository login

-cw-

-- 
~
Charlie Wilkinson - [EMAIL PROTECTED] - N3HAZ
Parental Unit, UNIX Admin, Homebrewer, Cat Lover, Spam Fighter, HAM, SWLer...
Visit the Radio For Peace International Website: http://www.rfpi.org/
~
CLOBBER INTERNET SPAM:  See!! http://spam.abuse.net/
   Join!! http://www.cauce.org/
~
QOTD:
Al Gore: Please, just concede.  I can't handle another four years of
whiney Republican bumper stickers!

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Security/Acquisition Bug? (take two)

2000-11-12 Thread Charlie Wilkinson

I should have included this in my previous reply - this is the Zope
error I am getting after failing out of BASICAUTH login:

--
Zope Error

Zope has encountered an error while publishing this resource. 

Unauthorized

You are not authorized to access this resource.

No Authorization header found. 

Traceback (innermost last):
  File /share4/Zope2/lib/python/ZPublisher/Publish.py, line 222, in publish_module
  File /share4/Zope2/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /share4/Zope2/lib/python/ZPublisher/Publish.py, line 162, in publish
  File /share4/Zope2/lib/python/ZPublisher/BaseRequest.py, line 463, in traverse
  File /share4/Zope2/lib/python/ZPublisher/HTTPResponse.py, line 569, in unauthorized
Unauthorized: (see above)
--

Does that provide any (additional) clues?

-cw-

-- 
~
Charlie Wilkinson - [EMAIL PROTECTED] - N3HAZ
Parental Unit, UNIX Admin, Homebrewer, Cat Lover, Spam Fighter, HAM, SWLer...
Visit the Radio For Peace International Website: http://www.rfpi.org/
~
CLOBBER INTERNET SPAM:  See!! http://spam.abuse.net/
   Join!! http://www.cauce.org/
~
QOTD:
Al Gore: Please, just concede.  I can't handle another four years of
whiney Republican bumper stickers!

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )