[Zope-dev] zopeproject and eggs lead to wrong zopeversion
Hello, An full-egg zope 3.4 buildout installed with zopeproject tells me the zope version is 3.3.1 (in /++etc++process/): - I have a fully eggified zope 3.4 installed with zopeproject. - I also have a zope 3.3.1 installed on the system python. When I start the 3.4 full-egg instance, I've discovered that zope.app.applicationcontrol.zopeversion tries to reach zope/app/version.txt to determine the major zope version. Since version.txt does not seem to be included in any egg, it fallbacks to the system zope installed. Where is the bug: zopeversion? zopeproject? a missing egg for zope.app itself? Christophe ___ 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] Zope Tests: 5 OK
Summary of messages to the zope-tests list. Period Sun Nov 25 13:00:00 2007 UTC to Mon Nov 26 13:00:00 2007 UTC. There were 5 messages: 5 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sun Nov 25 20:52:27 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-November/008701.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sun Nov 25 20:53:57 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-November/008702.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Nov 25 20:55:28 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-November/008703.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Nov 25 20:56:58 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-November/008704.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Nov 25 20:58:28 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-November/008705.html ___ 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: zopeproject and eggs lead to wrong zopeversion
Christophe Combelles wrote: Hello, An full-egg zope 3.4 buildout installed with zopeproject tells me the zope version is 3.3.1 (in /++etc++process/): - I have a fully eggified zope 3.4 installed with zopeproject. - I also have a zope 3.3.1 installed on the system python. When I start the 3.4 full-egg instance, I've discovered that zope.app.applicationcontrol.zopeversion tries to reach zope/app/version.txt to determine the major zope version. Since version.txt does not seem to be included in any egg, it fallbacks to the system zope installed. "system zope"? It seems like you have a globally available Zope installation. This will obviously confuse any *local* sandbox, such as the one created with zopeproject. Make sure you don't have any Zope libraries on your standard PYTHONPATH. ___ 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] zopeproject and eggs lead to wrong zopeversion
On Nov 26, 2007, at 2:28 PM, Philipp von Weitershausen wrote: Christophe Combelles wrote: Hello, An full-egg zope 3.4 buildout installed with zopeproject tells me the zope version is 3.3.1 (in /++etc++process/): - I have a fully eggified zope 3.4 installed with zopeproject. - I also have a zope 3.3.1 installed on the system python. When I start the 3.4 full-egg instance, I've discovered that zope.app.applicationcontrol.zopeversion tries to reach zope/app/ version.txt to determine the major zope version. Since version.txt does not seem to be included in any egg, it fallbacks to the system zope installed. "system zope"? It seems like you have a globally available Zope installation. This will obviously confuse any *local* sandbox, such as the one created with zopeproject. Make sure you don't have any Zope libraries on your standard PYTHONPATH. Wouldn't it make sense if zopeproject didn't include system python in PYTHONPATH at all? /Tim ___ 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] zopeproject and eggs lead to wrong zopeversion
Previously TIm Terlegård wrote: > On Nov 26, 2007, at 2:28 PM, Philipp von Weitershausen wrote: > > >Christophe Combelles wrote: > >>Hello, > >>An full-egg zope 3.4 buildout installed with zopeproject tells me > >>the zope > >>version is 3.3.1 (in /++etc++process/): > >>- I have a fully eggified zope 3.4 installed with zopeproject. > >>- I also have a zope 3.3.1 installed on the system python. > >>When I start the 3.4 full-egg instance, I've discovered that > >>zope.app.applicationcontrol.zopeversion tries to reach zope/app/ > >>version.txt > >>to determine the major zope version. > >>Since version.txt does not seem to be included in any egg, it > >>fallbacks to the system zope installed. > > > >"system zope"? It seems like you have a globally available Zope > >installation. This will obviously confuse any *local* sandbox, such > >as the one created with zopeproject. Make sure you don't have any > >Zope libraries on your standard PYTHONPATH. > > Wouldn't it make sense if zopeproject didn't include system python > in PYTHONPATH at all? No. Wichert. -- Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. ___ 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: unregistering components?
Chris Withers wrote: Philipp von Weitershausen wrote: On 25 Nov 2007, at 13:37 , Chris Withers wrote: Philipp von Weitershausen wrote: class IComponentRegistry(interface.Interface): I think you should use zope.component.getGlobalSiteManager() for this. So getGlobalSiteManager returns a component registry? Yes. It returns the one and only global registry. Am I right in thinking the global registry is _only_ used if no context is supplied? No. One should never have to supply an explicit context. If so, how come it's not called getGlobalComponentRegistry? Because component registries used to be called site managers and we can't just change the API at this point anymore. Well, getGlobalComponentRegistry could be added as an alternate spelling and people could be encouraged to use it ;-) Feel free to submit a patch :) There seems to be comments suggesting getSiteManager is deprecated, but maybe I'm not getting exactly what is being deprecated... It's not deprecated at all. If it were, it would say so in the code and emit a deprecation warning when you try to use it. How do you set up nested registries? For example, if a certain area of a site should have a registry which overrides the global one, but only for that area, and should fall back on it if not adapter could be found? You use sites. Sites are places (usually containers) in the component hierarchy that have (local) component registries associated with them. So, by "component heirarchy" I'm guessing you really mean "object hierarchy" Yeah, sorry. and by "Site" you mean "something implementing IComponentRegistry"? No, something implementing ISite, which defines a setSiteManager and getSiteManager for setting and retrieving an IComponentRegistry. I'm guessing the adapter to IComponentLookup is what implements the search up the object graph to find an IComponentRegistry? Yes, but that's rarely used (only when you pass an explicit context which we almost never do). Normally, during traversal, an event subscriber reacts to ISites being traversed and remembers the site's component registry in a thread-local variable. getSiteManager() will then return whatever is in the thread-local variable, and therefore getUtility, getMultiAdapter, etc., will use that local registry. If so, where do I find that adapter implementation(s)? See zope.app.component (also for the subscriber stuff mentioned above). And yes, the name "site" is misleading, but again, we have it as legacy now. How to work with sites, how to set them up, etc. is all explained in my book. I'm sure you have a copy :) I do, and I'm very greatful for it... (Btw, this thread has nothing to do with the development *of* Zope and is therefore [EMAIL PROTECTED] or [EMAIL PROTECTED] rather than zope-dev@zope.org material.) ...however, I'm interested in the mechanics of how zope.component handles multiple component registries, in particular how registries are added to and removed from the set of registries that are searched hen looking for a component and some other bits and pieces. Which is the *use* of Zope, not the *development* of Zope. In short, if the current zope.component implementation already does what I want, or whether I need to do work on the development *of* it it order to get what I'm after... ...of course, I don't know exactly what I'm after yet, but I hope you'll bear with my questions in the meantime ;-) ___ 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: unregistering components?
Philipp von Weitershausen wrote: Yes. It returns the one and only global registry. Am I right in thinking the global registry is _only_ used if no context is supplied? No. One should never have to supply an explicit context. Surely that's only the case if you're using zope's traversal stuff? I'm guessing that if you are, you either need to stick with the one global registry or manage either ISites or IComponentLookup's yourself? If so, how come it's not called getGlobalComponentRegistry? Because component registries used to be called site managers and we can't just change the API at this point anymore. Well, getGlobalComponentRegistry could be added as an alternate spelling and people could be encouraged to use it ;-) Feel free to submit a patch :) It's entertaining to get asked to submit a patch *and* told you're not doing anything that belongs on the -dev list in the same email ;-) There seems to be comments suggesting getSiteManager is deprecated, but maybe I'm not getting exactly what is being deprecated... It's not deprecated at all. If it were, it would say so in the code and emit a deprecation warning when you try to use it. What's line 37 of component._api on about then? and by "Site" you mean "something implementing IComponentRegistry"? No, something implementing ISite, which defines a setSiteManager and getSiteManager for setting and retrieving an IComponentRegistry. Are you sure you don't mean ISiteManager, which is marked as being deprecated and to be removed in 2007... If you mean a different ISite, where is it defined? (and I'm guessing there is an ISite somewhere, as I could find no definition of setSiteManager, but how does IComponentArchitecture's getSiteManager relate to that of ISite?) I'm guessing the adapter to IComponentLookup is what implements the search up the object graph to find an IComponentRegistry? Yes, but that's rarely used (only when you pass an explicit context which we almost never do). I think I'm misreading the code in _api then. It looks to me that most things use getSiteManager (even though the comment says it needs to be deprecated) which always appears to return either the global registry or do an IComponentLookup adaptation. If no explicit context is supplied, how does anything other than the global registry end up getting used? Normally, during traversal, an event subscriber reacts to ISites being traversed and remembers the site's component registry in a thread-local variable. getSiteManager() will then return whatever is in the thread-local variable, and therefore getUtility, getMultiAdapter, etc., will use that local registry. If so, where do I find that adapter implementation(s)? See zope.app.component (also for the subscriber stuff mentioned above). I spent quite a while looking and didn't spot them. Where exactly? (also bear in mind that I don't really want to use any of zope.app...) ...however, I'm interested in the mechanics of how zope.component handles multiple component registries, in particular how registries are added to and removed from the set of registries that are searched hen looking for a component and some other bits and pieces. Which is the *use* of Zope, not the *development* of Zope. I'm not really sure why you're quibling over this but I'm quite happy to move this discussion to zope3-users if you're prefer and then move it back to zope-dev if it turns out I need to do *development* of Zope (such as the patch you requested above ;-) ) cheers, 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 )
[Zope-dev] Re: unregistering components?
On 26 Nov 2007, at 18:17 , Chris Withers wrote: Philipp von Weitershausen wrote: Yes. It returns the one and only global registry. Am I right in thinking the global registry is _only_ used if no context is supplied? No. One should never have to supply an explicit context. Surely that's only the case if you're using zope's traversal stuff? Yup. I'm guessing that if you are, you either need to stick with the one global registry or manage either ISites or IComponentLookup's yourself? Not sure what you mean by "if you are". If so, how come it's not called getGlobalComponentRegistry? Because component registries used to be called site managers and we can't just change the API at this point anymore. Well, getGlobalComponentRegistry could be added as an alternate spelling and people could be encouraged to use it ;-) Feel free to submit a patch :) It's entertaining to get asked to submit a patch *and* told you're not doing anything that belongs on the -dev list in the same email ;-) Touche ;) There seems to be comments suggesting getSiteManager is deprecated, but maybe I'm not getting exactly what is being deprecated... It's not deprecated at all. If it were, it would say so in the code and emit a deprecation warning when you try to use it. What's line 37 of component._api on about then? # SiteManager API. This needs to get deprecated eventually. It says *eventually* :) and by "Site" you mean "something implementing IComponentRegistry"? No, something implementing ISite, which defines a setSiteManager and getSiteManager for setting and retrieving an IComponentRegistry. Are you sure you don't mean ISiteManager, which is marked as being deprecated and to be removed in 2007... Yes, I'm sure I mean ISite. If you mean a different ISite, where is it defined? zope.app.component.interfaces. Well, it moved to zope.location.interfaces recently in order to reduce the amount of interdependencies between the eggs, but it's still available w/o deprecation from zope.app.component.interfaces. (and I'm guessing there is an ISite somewhere, as I could find no definition of setSiteManager, but how does IComponentArchitecture's getSiteManager relate to that of ISite?) zope.component.getSiteManager() will return whichever component registry is active. site.getSiteManager() will return the local component registry that has been associated with site (which provides ISite). I'm guessing the adapter to IComponentLookup is what implements the search up the object graph to find an IComponentRegistry? Yes, but that's rarely used (only when you pass an explicit context which we almost never do). I think I'm misreading the code in _api then. It looks to me that most things use getSiteManager (even though the comment says it needs to be deprecated) which always appears to return either the global registry or do an IComponentLookup adaptation. If no explicit context is supplied, how does anything other than the global registry end up getting used? getSiteManager is "overloaded" from zope.app.component. See hooks.py. Yay for indirection :). Normally, during traversal, an event subscriber reacts to ISites being traversed and remembers the site's component registry in a thread-local variable. getSiteManager() will then return whatever is in the thread-local variable, and therefore getUtility, getMultiAdapter, etc., will use that local registry. If so, where do I find that adapter implementation(s)? See zope.app.component (also for the subscriber stuff mentioned above). I spent quite a while looking and didn't spot them. Where exactly? A quick look through zope.app.component/configure.zcml reveals that the subscriber is in site.py. The rest of the machinery is in hooks.py. (also bear in mind that I don't really want to use any of zope.app...) Fair enough. ...however, I'm interested in the mechanics of how zope.component handles multiple component registries, in particular how registries are added to and removed from the set of registries that are searched hen looking for a component and some other bits and pieces. Which is the *use* of Zope, not the *development* of Zope. I'm not really sure why you're quibling over this but I'm quite happy to move this discussion to zope3-users if you're prefer and then move it back to zope-dev if it turns out I need to do *development* of Zope (such as the patch you requested above ;-) ) I guess I'm nitpicking. I would just like to stress the focus of the zope-dev list. And regarding the patch, I've encouraged people to submit patches on zope3-users before, too ;). ___ 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: unregistering components?
Philipp von Weitershausen wrote: I'm guessing that if you are, you either need to stick with the one global registry or manage either ISites or IComponentLookup's yourself? Not sure what you mean by "if you are". Sorry, meant "if you aren't"... If you mean a different ISite, where is it defined? zope.app.component.interfaces. Well, it moved to zope.location.interfaces recently in order to reduce the amount of interdependencies between the eggs, but it's still available w/o deprecation from zope.app.component.interfaces. OK. (and I'm guessing there is an ISite somewhere, as I could find no definition of setSiteManager, but how does IComponentArchitecture's getSiteManager relate to that of ISite?) zope.component.getSiteManager() will return whichever component registry is active. site.getSiteManager() will return the local component registry that has been associated with site (which provides ISite). Okay, what's the difference between these two registries? I think I'm misreading the code in _api then. It looks to me that most things use getSiteManager (even though the comment says it needs to be deprecated) which always appears to return either the global registry or do an IComponentLookup adaptation. If no explicit context is supplied, how does anything other than the global registry end up getting used? getSiteManager is "overloaded" from zope.app.component. See hooks.py. Yay for indirection :). So zope.app.component replaces the getSiteManager implementation in zope.component? :-( A quick look through zope.app.component/configure.zcml reveals that the My bad, I assumed that particular configure.zcml would, in some way, be "special" and so didn't read... subscriber is in site.py. The rest of the machinery is in hooks.py. As an aside, I assume zope.thread is needed because Zope doesn't yet run with Python 2.5 as a whole? Also, where's the code which, in the local registry, defers to the global registry to find more adapters/subscribers/whatever? I guess I'm nitpicking. I would just like to stress the focus of the zope-dev list. Well, I guess with splitting zope into seeprately usable components, this all becomes a much greyer area. I'm exploring the realtionship between components and trying to understand their implementation. That feels like development *of* zope to me, whereas zope3-users has felt like a list for people using "the whole of zope 3", whatever that is nowadays... I'd be happy to use either list and even happier to see all 3 lists merge now that they're low volume enough (ie: just have [EMAIL PROTECTED], rather than zope-dev, zope and zope3-users) cheers, Chris PS: I am quite excited that it looks like I may actually be able to use bits of zope independently, and this wsgi stuff looks pretty cool too :-) -- 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] Escaping special characters in ZCTextIndex.QueryParser?
Robert Casties wrote at 2007-11-25 19:32 +0100: >is it possible to escape parentheses in ZCTextIndex searches? > >If not, why not and how can I do a simple search in an index bypassing >the QueryParser? I fear nobody of us knows this. Therefore, you must yourself look at the sources. If you need this feature and "ZCTextIndex" does not provide it, then you may use a different text index. I know that with "TextIndexNG3" you can select different parsers (among others a parser that does not interpret '(' and ')') or provide your own one. >I have an index where words can contain parentheses and I am unable to >enter a query for these words because the QueryParser interprets all >parentheses as search expression groupings. Then, you will need to change the lexicon as well. Usually, the lexicon breaks words at non alnum characters (with a few exeptions). Again, when I remember right, "TextIndexNG3" allows you to specify additional "word characters" (which do not lead to word braking). -- 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 )
[Zope-dev] Re: zopeproject and eggs lead to wrong zopeversion
Philipp von Weitershausen a écrit : Christophe Combelles wrote: Hello, An full-egg zope 3.4 buildout installed with zopeproject tells me the zope version is 3.3.1 (in /++etc++process/): - I have a fully eggified zope 3.4 installed with zopeproject. - I also have a zope 3.3.1 installed on the system python. When I start the 3.4 full-egg instance, I've discovered that zope.app.applicationcontrol.zopeversion tries to reach zope/app/version.txt to determine the major zope version. Since version.txt does not seem to be included in any egg, it fallbacks to the system zope installed. "system zope"? It seems like you have a globally available Zope installation. This will obviously confuse any *local* sandbox, such as the one created with zopeproject. Make sure you don't have any Zope libraries on your standard PYTHONPATH. Then how is the major zope version defined? Is there any zope/app/version.txt file possibly available for an egg-based installation? Does it even make a sense to define a zope version in that case? Or should version.txt/zopeversion use some version number provided by the KGS? Christophe ___ 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 )