Re: [Zope-dev] Weird IndexableObjectWrapper + TopicIndex + aq_acquired interactions.

2005-09-21 Thread Lennart Regebro
Dieter, my man!

 Now, in our case, the object is an IndexableObjectWrapper, wrapping an
 Acquisition wrapped object. So, aq_acquire will Acquicision wrap the
 IndexableObjectWrapper, with the result that the object being used now
 has no context!
 
 Really?

No?

What is the aq_parent that was used when wrapping the object?

Eh, which one? The aq_chain of both the original aq wrapper and the
indexableobjectrapper is correct. The aq_chain of the outside
aq_wrapper is just [self]. Which seems expected, since aq_acquire
think it got an object without acquisition, right?


It is context of the IndexableObjectWrapper.
The context of the indexable wrapped object does not change.

Right...

 Then, it passes this to validate, who in turn passes it to allowed,
 who check that the object has the users user folder in it's context.
 
 And it hasn't, because it has no context. *blam* You get an
 AuthorizedError, and the object does not get indexed.
 
 Where does the context come from used when aq_acquire acquisition
 wrapped the IndexableObjectWrapper?

I don't think there is any context involved.

 The best way around such problems would probably by to make
 IndexableObjectWrapper a public class.

Public?

-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py added FilelogHandler

2005-09-21 Thread Chris Withers

Is there any way this could use normal python loggers?

logger = getLogger('progress')

?

(and then with a more generic section in zope.conf for having more 
loggers configured...)


Andreas Jung wrote:

Log message for revision 38482:
  added FilelogHandler
  


Changed:
  U   Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py

-=-
Modified: Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py
===
--- Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py  2005-09-15 
13:22:20 UTC (rev 38481)
+++ Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py  2005-09-16 
08:29:14 UTC (rev 38482)
@@ -95,3 +95,16 @@
 def output(self, text):
 LOG(self._ident, INFO, text)
 
+

+class FilelogHandler(StdoutHandler)
+ Use a custom file for logging 
+
+__implements__ = IProgressHandler
+
+def __init__(self, filename, steps=100):
+StdoutHandler.__init__(self, steps)
+self.filename = filename
+
+def output(self, text):
+open(self.filename, 'a').write(text + '\n')
+

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins



--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py added FilelogHandler

2005-09-21 Thread Chris Withers

Andreas Jung wrote:
This is basically a backport of ongoing work where we can't and want use 
the Zope logger.


How come?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py added FilelogHandler

2005-09-21 Thread Chris Withers

Andreas Jung wrote:
This is basically a backport of ongoing work where we can't and want use 
the Zope logger.


How come?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py added FilelogHandler

2005-09-21 Thread Andreas Jung



--On 21. September 2005 13:29:26 +0200 Chris Withers 
[EMAIL PROTECTED] wrote:



Andreas Jung wrote:

This is basically a backport of ongoing work where we can't and want use
the Zope logger.


How come?



Basically a co-worker had the requirement to do some maintenance  work on 
the ZCatalog and he did not want to configure a new logger or to mess up 
the existing logfile.


-aj



pgp3LAhzPmPi9.pgp
Description: PGP signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Weird IndexableObjectWrapper + TopicIndex + aq_acquired interactions.

2005-09-21 Thread Dieter Maurer
Lennart Regebro wrote at 2005-9-21 08:18 +0200:
 ...
What is the aq_parent that was used when wrapping the object?

Eh, which one? The aq_chain of both the original aq wrapper and the
indexableobjectrapper is correct. The aq_chain of the outside
aq_wrapper is just [self]. Which seems expected, since aq_acquire
think it got an object without acquisition, right?

Depending of what self is.

When an acquisition wrapper is formed, there always must some context
(which is put into aq_parent).

Almost all contexts contain a full acquisition chain.

Maybe, we should wrap the IndexableObjectWrapper into the
context of the catalog?

 ...
 Where does the context come from used when aq_acquire acquisition
 wrapped the IndexableObjectWrapper?

I don't think there is any context involved.

When an acquisition wrapper is formed, there is a context -- the
one put as parent argument of the acquisition wrapper constructor.

 The best way around such problems would probably by to make
 IndexableObjectWrapper a public class.

Public?

Yes, public (to let all security checks succeed).

   Of course, this means that someone with the permission to
   customize a catalog can obtain information he may not
   gain in a different way.


-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Weird IndexableObjectWrapper + TopicIndex + aq_acquired interactions.

2005-09-21 Thread Lennart Regebro
 When an acquisition wrapper is formed, there always must some context
 (which is put into aq_parent).

Well, as I can figure out this is the code that does the wrapping:

  /* Crap, we've got to construct a wrapper so we can use Wrapper_findattr */
  UNLESS (self=newWrapper(self, Py_None, (PyTypeObject*)Wrappertype))
return NULL;

And that has None as the container/context.


http://svn.zope.org/Zope/tags/Zope-2-8-1/lib/python/Acquisition/_Acquisition.c?rev=37855view=markup
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )