Re: [Zope-dev] Usage of try: .. except: .. in zope

2002-03-11 Thread Ivo van der Wijk

On Sun, Mar 10, 2002 at 05:40:58PM -0500, Craeg K. Strong wrote:
> Sorry, I am not answering your question
> 
> but I was curious about your product.   Have you thought about
> restricting Folder contents based on type?That could be extremely 
> interesting.
> It is also something that is on the list to be potentially incorporated 
> into Zope 2.6
> 

I definately have, that is, I'm considering filtering allowed metatypes.
It won't be in my first release however.

Ivo


-- 
Drs. I.R. van der Wijk  -=-
Brouwersgracht 132  Amaze Internet Services V.O.F.
1013 HA Amsterdam, NL   -=-
Tel: +31-20-4688336   Linux/Web/Zope/SQL/MMBase
Fax: +31-20-4688337   Network Solutions
Web: http://www.amaze.nl/Consultancy
Email:   [EMAIL PROTECTED]   -=-

___
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] Usage of try: .. except: .. in zope

2002-03-10 Thread Dieter Maurer

Ivo van der Wijk writes:
 > ...
 > It this Exception-type-less
 > try/except construct used elsewhere in Zope (I think I've seen it before)? 
Yes, unfortunately.
 > Should I put a request in the collector? 
Yes, please.


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 )



[Zope-dev] Usage of try: .. except: .. in zope

2002-03-10 Thread Ivo van der Wijk

Hi All,

I'm currently implementing a QuotaFolder for Zope, i.e. a Folder 
that restricts the number of objects, their sizes and their total
size (and in the future: the installabe meta types).

Things look very promising (if anyone feels like testing, please mail
me), but it took me quite a while to fix one bug:

When creating a ZopeTutorial in a QuotaFolder, I always got

Error Type: Bad Request
Error Value: The id "examples" is invalid--it is already in use.

I couldn't really figure out why my QuotaFolder would cause ZopeTutorial
to be installed (or actually imported) twice. Until I studied its code:

In addTutorial in TutorialTopic.py, there's the following piece of
importing code:

# work around old Zope bug in importing
try:
folder.manage_importObject(tutorialExamplesFile)
except:
folder._p_jar=self.Destination()._p_jar
folder.manage_importObject(tutorialExamplesFile)
 
Basically, anything can go wrong in the first manage_importObject (and
in my case it was the raising of a QuotaExceeded exception), causing
the code to try to import the file *again*

Isn't there a better/cleaner way to do this? It this Exception-type-less
try/except construct used elsewhere in Zope (I think I've seen it before)? 
Should I put a request in the collector? 

Cheers,

Ivo

-- 
Drs. I.R. van der Wijk  -=-
Brouwersgracht 132  Amaze Internet Services V.O.F.
1013 HA Amsterdam, NL   -=-
Tel: +31-20-4688336   Linux/Web/Zope/SQL/MMBase
Fax: +31-20-4688337   Network Solutions
Web: http://www.amaze.nl/Consultancy
Email:   [EMAIL PROTECTED]   -=-

___
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 )