Re: [Zope3-Users] ZODB and unique values
On Mon, Aug 3, 2009 at 9:09 PM, Gary Poster wrote: > > On Aug 3, 2009, at 3:00 PM, Gustavo Rahal wrote: ... > Practically, using the BTrees that the ZODB provides will typically > have the behavior you want for the first and third gotcha. For the > second gotcha, we typically give each connection to the ZODB its own > random starting point stored on a volatile (disposable) attribute for > the index, and each connection increments that point. Look at the > code in zope.intid, for instance: _generateId in > http://svn.zope.org/zope.intid/trunk/src/zope/intid/__init__.py?rev=100049&view=auto Gustavo, Note that a simpler variation on this is to assign the values randomly. Assigning them sequentially from a random starting point is an optimization to reduce the number of BTree nodes read and updated by a particular client. Jim -- Jim Fulton ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] classProvides and inheritance
On Sat, Aug 15, 2009 at 4:49 PM, Iain Duncan wrote: > Hi, I'm new here so please tell me if this is the wrong list. > > I have a case where I want a class, ( the class object itself, not an > instantiated class ) to provide an interface so that a utility look up > can get me the class itself. This is working ok with: > > class IPet(PersistentResource): > implements(Pet) > classProvides(IResourceClass) > > but, all classes that inherit from PersistentResource should provide > this too, That's a matter of opinion. > and this does not get inherited just by using classProvides in > the definitiation of PersistentResource. > > Before I go making metaclasses and stuff, thought I should check if I am > missing something simple! No. Class provides isn't inherited by design. Jim -- Jim Fulton ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] classProvides and inheritance
On Sat, Aug 15, 2009 at 5:06 PM, Iain Duncan wrote: > On Sat, 2009-08-15 at 16:57 -0400, Jim Fulton wrote: >> On Sat, Aug 15, 2009 at 4:49 PM, Iain Duncan wrote: ... > I understood that, I just phrased my question poorly. np > So given the > clarification, is there a straightforward way for me to make it so, No. > or > will I need to make a metaclass that enforces my desired behaviour? I don't think a meta class would help you. You would need to implement an alternative __provides__ descriptor. At that point, you'd be depending on an internal implementation detail, but you wouldn't be the first. :/ Jim -- Jim Fulton ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] threads, pool size and cache recommendations (quad core)
On Wed, Dec 16, 2009 at 8:26 AM, Roy Mathew wrote: > Folks, I am looking for some configuration advice. > I am running a zope3 application that uses the ZODB. I expect a peak load of > a 100 concurrent users, and am on a *quad* core Intel Xeon Linux box. Am I > better off running 2 or 3 ZEO clients talking to the app-server (I am > assuming that the OS will load balance so that all processors are utilized > well). Or should I not use ZEO at all, and simply assign a large cache, a > large connection pool and lots of threads to a single process. I am sure > that this is an issue many of you have had to contend with. I would > appreciate some rough idea of what the numbers should be for each of the 2 > scenarios I outline. Assuming that your application ends up being CPU bound, you should use 4 single-threaded processes. (One per core.) Python can't (generally) make use of more than one processor. If you're not CPU bound, then you can increase the number of threads until you are. That's broad-brush advice. Keep in mind that the more threads/processes you have, the more memory you'll use for a given cache size. The optimum cache size will depend a lot on your app. Jim -- Jim Fulton ___ Zope3-users mailing list Zope3-users@zope.org https://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] ZEO multi-processes client setup with WSGI
On Thu, Jun 24, 2010 at 6:09 AM, Thierry Florac wrote: > > Hi, > > I'm currently going to setup a new Zope3 web site. > I'd like to setup this site using : > - a remote ZEO server > - several physical web servers, each hosting a set of ZEO clients and > using WSGI (with mod_wsgi). > > My main question is about mod_wsgi multi-processes setup, and > actually : if defining several processes (ideally, one for each CPU > core), can several ZEO clients processes share the same ZEO cache ?? No. Jim -- Jim Fulton ___ Zope3-users mailing list Zope3-users@zope.org https://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] ZEO multi-processes client setup with WSGI
On Thu, Jun 24, 2010 at 9:14 AM, Thierry Florac wrote: > So as processes setup is defined via WSGI, how can I define such a > "zope.conf" setup with several ZEO clients sharing the same > configuration file ? I typically set up sgi apps with paste deploy. You can use either repoze.zodbconn or zc.zodbwsgi to configure wsgi ZEO clients with paste deploy. > Is there a simple setup so that each process use it's own ZEO cache ?? If you you don't use persistent caches, then each client (process) will get its own cache automatically. I'm not aware of any mechanism for managing persistent caches whe there can be a more or less arbitrary number of forked processes. Jim -- Jim Fulton ___ Zope3-users mailing list Zope3-users@zope.org https://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] So, there is going to be no Zope4... how to handle maintenance a couple of years from now?
On Sun, Sep 7, 2014 at 5:37 AM, Thierry Florac wrote: > > Hi, > > I think ZCA doesn't do "so much more" than implement a few object design > patterns and provide a very flexible components registry framework. > I'm working mainly on developing new framework-like packages and I just > can't work without it except by re-inventing it! > > Many users blame ZCML just because it's XML ! As well they should! 0.5 ;) > But it's just configuration, and separating configuration from > Python code is one of the greatest benefits of ZCML, mainly while > working on huge projects. The XML format is just a detail and is > probably not so worse than many INI-like or text based configuration > format; and at least it's a de-facto standard. When I started working on zcml, it used a very light-weight but custom syntax. I was talked in to using XML by someone who later complained about it. :) I regret not sticking with the lighter weight syntax. Jim P.S. ZCML uses a pretty lightweight style of XML, relying more on attributes than on nested elements. Ironically/typically I was criticized for this by XML purists. -- Jim Fulton http://www.linkedin.com/in/jimfulton ___ Zope3-users mailing list Zope3-users@zope.org https://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] So, there is going to be no Zope4... how to handle maintenance a couple of years from now?
On Sun, Sep 7, 2014 at 4:44 AM, Milind Khadilkar wrote: > Thanks, Thierry. > I think the real problem with ZCA and ZCML is "bad press". We did not face > any ZCML problem when we worked on the Zope3 projects. It was later, > thankfully, that we came across the negative opinion. ZCA did require a > mindset change for some, but more often than not it has helped them in their > future work on other platforms too. > But that was 10 years ago... Don't know about now. I'm proud of the ZCA in many ways, but: - ZCA was designed for problems that most people don't or shouldn't have, which is making a complex application pluggable. If your application is complex, that's a problem http://legacy.python.org/dev/peps/pep-0020/ - In the Zope 3 project, we used the CA way more than we should have. Initially, this was to prove that we could. Once we were convinced that every (damn) thing could be pluggable we should have stopped and simplified, using the ZCA only where needed. Instead, we'd established a culture of crazy levels of indirection. - Outrageous indirection in the base system made starting new projects either super difficult, an exercise in cargo-cult-programming, or both. I've come to the conclusion that any framework that requires or encourages its users to use project-templates or project-setup wizards isn't something I want to use. I stopped using Zope 3 several years ago when I realized that the weight of the framework wasn't justified by it's benefits, at least for me. I've decided that I'd rather use decoupled frameworks that, ideally, are simple to learn and use individually. That's why I use bobo now, http://bobo.digicool.com. A more conventional choice along the same lines would be Flask, although I think bobo is simpler. (Of course, I'm biased. :) I still use the ZCA, especially zope.event, but in a wildly lighter-weight fashion than I did in Zope 3. Part of the reason I prefer simpler server frameworks today is that Web applications are far more client centered today than they were when I worked on Zope 2 and even Zope 3. Today, for applications (as opposed to content *sites*), UI logic, including templating, mostly happens on the client, and web servers are largely REST/RPC/Database servers. Jim P.S. If you find the ZCA interesting, you should check out Scala and it's implicits and type-level programming. It does many of the same things as the ZCA at compile time. It's crazy beautiful and evil all at the same time. :) -- Jim Fulton http://www.linkedin.com/in/jimfulton ___ Zope3-users mailing list Zope3-users@zope.org https://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Publisher events on response
Paul Everitt wrote: Hi. Are there any events, current or planned, that can be observed to modify the response? Yes. They are planned. Let's say I want to write a little function to transform every HTML page that gets returned on a site. (Perhaps I want to hack it to make it adhere to the corporate identity from the customer.) In Apache2 there is a concept of a filter: http://www.apachetutor.org/dev/#filter modpython supports this: http://www.onlamp.com/pub/a/python/2003/10/02/mod_python.html At the Castle Sprint, Jim talked about the possibility of having events on the publisher, to allow folks to hook in and perform processing on results. Any news on this? No news, other than: - I'm not sure whether this should be done with subscribers, adapters, or some combination. :) - I've started down the road to a much more event-driven publication model in my bobo branch: http://svn.zope.org/Zope3/branches/jim-bobo/src/zope/bobo/publication.py?rev=28563&view=markup This still isn't what you (and I want) wrt to output processing. I really haven't had much time to think about this. My rough thinking so far: - The result of traversal should be adapted to a publiing interface of some sort. - The result of the above adaptation (or some method of the same) should be called to produce a publishing result. - The result of the call should then be adapted to some final interface. The result of this adaptation should be handed to the response. (Or maybe this step should be done by the response when it is given the result of the call.) I think this last step would allow you to hook something up. I'd love to get suggestions if people have any ideas of how this might work. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] z3 frustration
Andreas Jung wrote: --On Sonntag, 15. Mai 2005 19:02 Uhr +0200 [EMAIL PROTECTED] wrote: Hi z3's ok, I'm really frustrated by now. First I did not succeed to turn a content object into an Image container. After giving up on that, I tried designing my own skin both using Philipp's and Stephans examples. Without success. bleh They seem to do it differently (St and Ph.). And I'm getting opaque system errors again. Using both ways. Maybe you should provide the error messages with your complaint...otherwise nobody can give you any further help without reasonable information :-) In particular, he needs to provide a traceback, either from the program output or log or from the error reporting utility. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Catalog questions
Kevin Dangoor wrote: I'm not sure if zope3-users is a more appropriate forum for this topic than zodb-dev (probably is, which is why I'm here). I'm working on (or, rather, have) a packaging of Zope 3.1's catalog for use with the standalone ZODB. Packaging this up brought up a couple of questions: 1) the intid utility is used to maintain an object<->integer ID mapping for use as a document ID in catalog indexes. Given that the objects already have an integer ID, _p_oid, _p_oid is not an integer. > with a convenient API for moving back and forth between object and ID, why maintain two more btrees to hold this information? To get integers and to get some indirection from the underlying storage, which might not be ZODB. 2) intid does not directly store an object pointer, but rather a reference object. Is the purpose here to allow you to work with parts of the result set without having to activate the original, potentially large, objects? No. The main purpose of key references are to get valid keys. Most objects are not valid persistent keys. Are the reference objects the place you would likely store metadata (I didn't see a facility in catalog itself for this)? No. 3) I noticed that the .c extensions for the text index only have Python versions in 3.1. Was the performance difference not big enough to want to bring these across, or was it just a matter of amount of time available to get catalog running there? Probably the later. It probably wouldn't be hard. The text index was ported two years ago during a sprint. I didn't even realize that anything was left behind. All in all, making Zope 3.1's catalog work with standalone ZODB was a far more enjoyable experience than working with Zope 2.8's. :) Later this week, I'll toss a tar file up with this packaged catalog for others to play around with. Cool. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Catalog questions
Kevin Dangoor wrote: On 6/6/05, Jim Fulton <[EMAIL PROTECTED]> wrote: Kevin Dangoor wrote: 1) the intid utility is used to maintain an object<->integer ID mapping for use as a document ID in catalog indexes. Given that the objects already have an integer ID, _p_oid, _p_oid is not an integer. Err... Yeah, that would be a good reason not to use _p_oid :) I *thought* it was an int, but clearly it is an 8 byte string. It happens to be 8 bytes for file storage. The storage API only says it's a string. >>>Are the reference objects the place you would likely >>>store metadata (I didn't see a facility in catalog itself for this)? >> >>No. > I'm not going to worry about that until I see an actual performance issue with my objects being activated... I'll note that the Zope 2 Catalog's meta-data table is a holdover from a Digital Creations product for publishing DBase files on the web. People uploaded the DBase files into our product, which stored the data in a tabular structure and associated indexes. It's not obvious to me that the meta data table is a performance win. It could be a loss, at least depending on the application. The rows in the meta-data table are just tuples. These tuples can be very large. A bucket will typically hold 30-60 of these tuples. Loading oe of these buckets could eaily be more expensive than loading an object. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Catalog questions
Stephan Richter wrote: On Monday 06 June 2005 14:31, Kevin Dangoor wrote: 1) the intid utility is used to maintain an object<->integer ID mapping for use as a document ID in catalog indexes. Given that the objects already have an integer ID, _p_oid, with a convenient API for moving back and forth between object and ID, why maintain two more btrees to hold this information? Not all objects you want to index might be in the ZODB. 2) intid does not directly store an object pointer, but rather a reference object. Is the purpose here to allow you to work with parts of the result set without having to activate the original, potentially large, objects? Are the reference objects the place you would likely store metadata (I didn't see a facility in catalog itself for this)? Yeah, I think this is the design goal. I think storing annotations on the reference objects is probably the right choice. Sorry, I missed the second part of your answer. You should not store meta data on the reference objects. You should use the reference objects (or intids) as keys into data structures storing meta data. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] migrating data between different zope3 releases
Alen Stanisic wrote: Hi all, How would one go about migrating data (persistent objects) from, for example, Zope X3.0 to a 3.1 instance. If I remember correctly there is a file import/export functionality in Zope2 (which I am not sure would be used between different zope2 versions). I guess it also depends on the version of ZODB. My assumption is I would have to write some sort of a migration script. Zope 3.1 should be able to read Zope X3.0 databases without any special conversion. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] utf-8/latin-1 content in page templates
Andreas Reuleaux wrote: I would like to use utf-8 (latin-1) content in page templates like this ... What I would really like is the possibility of specifying the encoding when registering the page: Sounds right to me. A similar option is needed in the PageTemplateFile and ViewPageTemplateFile classes. I have not tried yet to render the page from a view class (how would I do that?) The browser:page directive creates a view. If you want to associate a class with that view, you can specify it with a class attribute. Am I missing something? With regard to encoding, no. I guess we just haven't needed non-ascii character sets in page template sources up to now. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] pluggable authentication utility
Roger Ineichen wrote: Hi Ricki On Behalf Of GMane Sent: Wednesday, June 15, 2005 5:52 PM To: zope3-users@zope.org Subject: [Zope3-Users] pluggable authentication utility Hi, I have a simple question about pluggable authentication. I created a folder and I made it a site. In the default Site-Management Folder I created a Pluggable Authentication Utility (named plaut). Inside it I made a PrincipalFolder (Partner) and added a user soc1. Don't give a name (plau). Pluggable authentication utilities are as dfault unnamed. All components right now will lookup the PAU with name=''. For 3.2, we need to find a way to make this clearer. Either we need to provide a more verbose description of what the name is for or perhaps, as Stephan has suggested, for components that are always looked up without names, we should not provide the option of entering a name and, for others, we should require a name. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] ZDaemonTests testUmask error
Stephan Richter wrote: On Tuesday 21 June 2005 02:56, Alen Stanisic wrote: This is the only error I get when running 'make check' should this be of major concern? It's not a big concern, but it would be nice, if it could be fixed. If you have a patch, send it in. Some detective work is needed first. This isn't failing for me. I imagine that this isn't failing for most people. Alan, What specific OS are you running. What is your umask setting? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] zsync
Stephan Richter wrote: On Tuesday 21 June 2005 00:50, Corey wrote: Is zsync really only necessary if you do TTW development w/ Zope3? Is it still being developed, or is it stable? ( I just noticed the synchonization chapter in the Zope3 Dev book was excluded ) zsync has not been developed for a long time and I would not consider it stable, though most of the stuff should work. The biggest remaining issues are: - Need security checks for TTW checkout and check in - Need a not TTW-based interface - Because of the first two issues, zsync hasn't been actively used or developed for some time, which is really a shame. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Need testing of 3.1, especially for backward compatibility
Zope 3.1 has lots of architectural cleanups. The most major cleanup is the removal of services and the effect it had on the through-the-web component registration support. Stephan made a significant effort to make this backward compatible. Databases created with Zope X3.0 *should* work with Zope 3.1, but this needs to be tested. If you have an X3.0 database that you want to be able to use with 3.1, I strongly suggest you make a copy of it and try out the 3.1 beta release with the copy. If you run into problems: - Report any problems you encounter at: http://www.zope.org/Collectors/Zope3-dev - Be prepared to make a copy of your database, before trying it with 3.1, to developers so that they can try to reproduce your problem. Backward compatibility is important to us, but you have to do your part by helping us test for backward compatibility. Note that we only try to provide backward compatibility for features or situations that we think people use or encounter in *practice*. There are times when, for practicality, we don't try to provide backward compatability support if we don't think people will be affected. This is another reason why your testing is so important. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Output the template of a view class
Florian Lindner wrote: Hello, sine I suspect my last email to have drowned on the list, I try to ask again. How can I ouput the template from the associated view class? class view: def __call__(self): return template How to do that? Assuming that the template was defines via ViewPageTemplateFile, then: return self.template() Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] woah... zcml O.D.
Corey wrote: Appologies if some of these questions seem naive, I'm just beginning to more thoroughly delve into zope3 - of which I've been very impressed so far. However - is it just me, or does zope3 seem to require a rather massive amount of configuration? Zope has always required a fair bit of configuration. In Zope 2, this has largely been burried in the Python code, making Zope 2 Python code especially Zope specific. Is that specifically an artifact of Component Architectures in general? Or is this by design? The component architecture adds some configuration. Also, a goal of Zope 3, especially the Zope 3 application server is to make it possible to override components without changing Python code. Having said all of that, zcml also reflects the unavoidable process of getting things at least somewhat wrong at first. Over time, zcml has evolved and gotten easier to deal with. In particular, we are now in the process of simplifying zcml in a number of ways: - Zope 3.1 has many fewer component types and thus fewer zcml directives. Most components can now be registered with utility and adapter directives. Old directives are still supported for backward compatibility, but over time, I expect the vocabulary of ZCML directives to shrink quite a bit. - Starting in Zope 3.1, it is possible to declare interfaces adapted in Python and adapter and utility directives can use information defined in Python for required and provided interfaces. For example, most of my adapter directives now look like: I can make declarations in Python that aid interpretation of the Python code and I don't have to repeat those in zcml. - zcml was intended for configuration, but, in our attempts to make things easier, zcml has taken on a definition role in many areas. For example, a number of common directives, like browser:page, browser:editform, browser:addform and so on *define* new components as well as registering them. Our (ZC's) zc.page package is a rection to that that moves definition back into Python, where it belongs, allowing much simpler configuration. Are "site administrators" really supposed to understand all that zcml in the configure.zcml files, or are they more realistically the domain of component developers? They are the domain of component developers, who develop base configurations, and integrators who might overide configuration when integrating a package of components into an application. > It seems to me that the configure.zcml looks almost as if it would basically be considered "hands off", once the application/component was coded and installed. > > Generally how much of any particular configure.zcml could - practically > speaking - be modified in a usefull manner? In particular, a consumer of a package never modifies the zcml, however, as mentioned above, an integrator might override some of the configuration in theor own zcml. How much gets overridden depends on the needs of the integrator. Even for relatively smallish apps, such as the buddydemo and zwiki, the configure.zcml file seem quite large; I hate to imagine what a more involved and complex app would do. Am I just looking at it wrong? Perhaps the basic idea is small amounts of code, and large amounts of configuration/meta-programming via zcml? For both of these apps, there is much less zcml code than Python code. The zwiki app has an unusual amount of security policy in it. In fact, it has way too much, IMO. For one thing, it depends on a particular security policy. If a site uses a differeny security policy, they will have to actually rewrite the zwiki zcml file. The buddydemo application has *very* little application logic, which tends to inflate the configuration/code ratio. For 3.1, both of these packages zcml files could be shortened a fair amount. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] suppress menu item with zcml?
Dylan Reinhardt wrote: Is there a simple/correct way to suppress a menu item using ZCML? For example, I have a content type that implements IAttributeAnnotatable and I want to suppress display of the "Metadata" tab in zmi_views. I expected this would work: __ This is the normal way to do it yes. When my content interface *inherits* from an interface, this seems to work... but when my class *implements* an interface, this appears not to. I don't know what you mean. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] suppress menu item with zcml?
Stephan Richter wrote: On Tuesday 21 June 2005 13:57, Dylan Reinhardt wrote: When my content interface *inherits* from an interface, this seems to work... but when my class *implements* an interface, this appears not to. That seems strange and would be a deep adapter-registry problem, most likely. If you can reproduce this problem in a simple/contained test, please add an issue for it. What is the correct way to do what I'm trying to do? The simplest way would be to comment it out. That doesn't work if the configuration is not yours. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] suppress menu item with zcml?
Dylan Reinhardt wrote: On 6/23/05, Jim Fulton <[EMAIL PROTECTED]> wrote: Dylan Reinhardt wrote: When my content interface *inherits* from an interface, this seems to work... but when my class *implements* an interface, this appears not to. I don't know what you mean. Perhaps I'm not using the correct terminology. :-) Here are the two cases: Case 1 ("implements"): -- I have a ZCML directive such as this: Case 2 ("inherits"). --- I use the following in my interface definition: from something.interfaces import ISomeBase class IMyClass(ISomeBase): """ this interface inherits from another one """ In case 2, I'm able to use the menuitem ZCML directive to suppress a menu that's defined by ISomeBase. All good. In case 1, I can't find a way to suppress the display of the Metadata tab at least not without resorting to a custom template or wrapping/modifying built-in code. This *seems* like a task for ZCML, yes? Does that help clarify the problem I'm seeing? I think so. So, you don't want to define a new interface that extends IAttributeAnnotatable. You should be able to define the menu item for the class. If you can't I'd consider that a bug. (This bug is not unlikely, because we may not have gotten around to supporting classes in menu-item for attriutes.) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: [Z3lab-checkins] r24502 - in z3lab/cpsskins/trunk: . browser/editor browser/skin elements/formats
Florent Guillaume wrote: ... + + +def renderItems(content, start='', repeat='%s', separator='', end='', **kw): +if IMenuItems.providedBy(content): +items_markup = [start] +items_append = items_markup.append +for item in content: +items_append(repeat % (item['url'], item['title'])) +items_append(separator) +items_append(end) +return ''.join(items_markup) +else: +return '' In general in Zope 3 it's my understanding that it's better to do try: c = IMenuItems(content) except ComponentLookupError: return '' ... c used as iterable ... return ... Note that I prefer: c = IMenuItems(content, None) if c is None: return '' ... than testing directly for the provided interface, as it gives an opportunity for an adapter to do its job. It's probably slower though, and maybe not a pattern generally used for marker interfaces. Opinions ? IMO, testing for an interface is sometimes preferable to using an adapter. Some people feel very strongly that you should never test for an interface -- I don't. It seems silly to add an adapter just to avoid using a test (for religious reasons iow). In particular, providing adapters to handle cases where an object doesn't provide some service and can't really be adapted to provide a service seems really silly to me. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] missing_value for Text fields
Andreas Reuleaux wrote: missing_values for Text fields don't work for me (complete example show below): The autogenerated add form is usable for me only * if I either make boom a TextLine instead of Text boom=TextLine( title=u'Boom', required=False, missing_value=u'') * or if I drop the missing_value param boom=Text( title=u'Boom', required=False) However, the combination Text field with missing_value (as in the example below) causes some garbage html (the rest of the form: morestuff) to be put in the textarea field for boom when I try to add a foo object. This is a bug. Please submit it to the collector: http://www.zope.org/Collectors/Zope3-dev Thanks. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: [Z3lab-checkins] r24502 - in z3lab/cpsskins/trunk: . browser/editor browser/skin elements/formats
Jean-Marc Orliaguet wrote: Jim Fulton wrote: Florent Guillaume wrote: ... + + +def renderItems(content, start='', repeat='%s', separator='', end='', **kw): +if IMenuItems.providedBy(content): +items_markup = [start] +items_append = items_markup.append +for item in content: +items_append(repeat % (item['url'], item['title'])) +items_append(separator) +items_append(end) +return ''.join(items_markup) +else: +return '' In general in Zope 3 it's my understanding that it's better to do try: c = IMenuItems(content) except ComponentLookupError: return '' ... c used as iterable ... return ... Note that I prefer: c = IMenuItems(content, None) if c is None: return '' ... here is a trival question but what is the syntax for multi-adapters? layout_renderer = getMultiAdapter((layout, request), IRenderer) works, Right. That's the way to do it. > but: layout_renderer = IRenderer(layout, request) returns a BrowserRequest object instead of the renderer implementing IRenderer Right, interface call only does single-adapter lookup. The second argument is the default. and: layout_renderer = IRenderer((layout, request)) returns a TypeError saying 'Could not adapt' Yup. You are trying to look up an adapter for a tuple. Note that I've wanted to be able to do multi-adapter lookup using interface call. I've reluctantly come to the conclusion that it isn't a good idea. See: http://mail.zope.org/pipermail/interface-dev/2004-August/63.html FWIW, One idea I've had is to be able to compute adapter factories from interfaces that then provide a nice syntax. Something like: getRenderer = component.adapterFactory(IRenderer) ... layoutRendered = getRenderer(layout, request) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope3 Product directory Problem
Chris Withers wrote: And I'm pretty sure that Zope 3 needs Python 2.4 ;-) No, Zope 3 works with Python 2.3. Some add-ons might require 2.4. Of course, Plone doesn't work with Zope 3. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Sending object modified event on FTP upload - best practice?
Jeff Shell wrote: I'm about to get working on a project in Zope 3 that will be our first major project for a paying customer (in fact, our marquee customer and one of our marquee sites). This project will be replacing an aging Zope 2 site, which relied heavily on FTP for its content management. When content is uploaded by FTP to an existing object, the catalog is reindexed. Nicely, in Zope 3 I can depend on object modification events to handle cataloging. In looking at how FTP support is written in zope.app.ftp, I notice that ObjectCreatedEvent notifications are sent off when new objects are created. But when zope.app.ftp.FTPView._overwrite(...) is used to write to an existing object via an IWriteFile adapter, the FTP View does not send an object modified event. I'm assuming that it's the responsibility of my IWriteFile adapter to send notifications of this event? Yes. > Or is this something that should be in the FTPView's implementation? No. The FTPView isn't actually modifying the object, the IWriteFile viw is. It's possible that the write-file adapter could be modifying a different object than the one it adapts. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] SECURITY WARNING: Don't use the Zope 3 sendmail mailer
There is a feature in Zope 3, called the "sendmail" mailer, which is not enabled by default, for using a shell command to invoke a mailer to send mail. (The name comes from the popular Unix mailer sendmail, which is often invoked as a sub-process.) Invoking a shell from a server program is a potential serious security hole. This feature can be enabled with a ZCML directive like: If you have added a directive like this to your configuration, you should remove it or change it to use the smpt mailer: This feature will be removed in future versions of Zope, including Zope 3.1, and 3.0.2 (if there is a 3.0.2). If you gave questions about this, please send them to the Zope 3 users list, [EMAIL PROTECTED] Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: [Zope3-dev] Zope 3 Bug Day Summary
Stephan Richter wrote: Hello everyone! I just wanted to let everyone know that we had a very successfull Zope 3 Bug Day today! I would like to thank Zope Corporation, POV, Nuxeo and the other community members for supporting this event by providing the manpower we needed! We were able to fix all outstanding bugs that prohibited us from making the first release candidate of Zope 3.1. As a result, I will create the 3.1 branch today, lift the feature freeze, and make a release later this weekend or first thing on Monday. I want to second this thanks. I'm very happy to see 3.1 finally nearing completon. Jim P.S. I'd like to remind everyone that there are just 3 months left before the feature freeze for 3.2. :) -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] svn problem
Leticia Larrosa wrote: Hi all: I try to connect to the svn repository of zope 3 at this direction: http://svn.zope.org/Zope3/branches/ZopeX3-3.0/src/zwiki/ using TortoiseSVN, and test by other hand with the svn package of Debian. I both I get the error: PROPFIND of "": 301 Moved Permanently ( http://svn.zope.org) That is not an svn repository. It is a viewcvs view of the svn repo. Use: svn://svn.zope.org/repos/main/Zope3/branches/ZopeX3-3.0/src/zwiki Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] svn problem
Leticia Larrosa wrote: Thanks to Jim. I try whith "svn://svn.zope.org/repos/main/Zope3/branches/ZopeX3-3.0/src/zwiki" too, but get the error: "svn: Can't connect to host 'svn.zope.org': Connection timed out" You can connect without problem? Yup Any have an idea about why get this error? Nope, sorry. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] PythonScripts
Benji York wrote: Jason Leach wrote: So are PythonScripts going to be included in Zope3 any time soon? I currently don't see them in 3.1. No. At some point, we will have TTW modules and libraries. Modules will be for software prototyping. Libraries will fill the same ecological niche as Python Scripts. They will be content objects that provide access to functions that can be used in content space templates. There isn't, at present, much interest in/resources for through-the-web development in Zope 3. There is certainly interest but there is greater interest in other areas. This is definately something that I hope will recieve some focus before too long. BTW, to clarify, I'd like to draw a distinction between development and scripting. My current vision is that, for various reasons, we will support TTW development only for prototyping. That is, we'll provide facilities that allow one to prototype components through the web and then automatically migrate them to file-system-based components. We will also support TTW scripting. Scripting is used to create "active content", which is content that includes some programming logic. Scripting is used for one-off tasks, like manipulating results of searches or automating specialized tasks. Scripting includes development of content-space templates, libraries, etc. Stephan Richter wrote: > On Tuesday 06 September 2005 19:39, Jason Leach wrote: > >>So are PythonScripts going to be included in Zope3 any time soon? I >>currently don't see them in 3.1. > > > Probably not. We have not made a commitment in Zope 3 to support TTW > development yet. To clarify, I have made a commitment to support TTW scripting some time in the future, meaning I fully expect to provide these sorts of facilities in the future. It's possible that Python scripts will make it into Zope 3 someday -- in a round-about way. My *hope* is that someday Zope 2 and Zope 3 converge in such a way that they differ only by configuration. If that hope is realized, you'll be able to blend classic Zope 2 facilities, like Python Scripts, with Zpe 3 facilities. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] BrowserResponse, write()
Stephan Richter wrote: On Friday 16 September 2005 11:39, Andreas Reuleaux wrote: What else should be used now? - Not sure if this has been discussed before. Just return the data; it is handled properly now. You could even create a file stream now, if there is a lot of data. Stephan, that's not much of an explanation. Andreas, we didn't think response.write was being used. What are you trying to do? Stephan, we may have to provide backward compatibility. since it's in Philipps book. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Users and the Ownership of Objects
Gary Poster wrote: ... Also, we will need to combine this with our security system - each user will be able to edit objects that they are registered as the owner of (probably with workflow constraints...). Is this possible within the default zope security policy, or will I have to write a new one (which is a daunting prospect!) I think you will need to write your own, but won't be terribly surprised to learn I'm wrong. :-) We have plans to release an alternate security policy that we have. Writing a new policy is not nearly as daunting as in Zope 2, at least from the perspective of someone who has looked at implementations in Zope 2 and Zope 3. That said, I understand the concern. It's actually possible in Zope 3. :) Note that in the Sharing policy that we'll be releasing (soon, I hope), the sharing privilege is pretty darn close to ownership, as we've discussed. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] addview name not form
Florian Lindner wrote: Am Freitag, 30. September 2005 18:55 schrieb Julien Anguenot: Florian Lindner wrote: Am Donnerstag, 29. September 2005 20:25 schrieb Julien Anguenot: First have a look at this : http://www.zope.org/Collectors/Zope3-dev/391 The addMenuItem directive should look this way in order to work : without 'for="CS.ContentFolder.interfaces.IContentFolder"' (check the collector entry) But then the menu entry does not show up in views on IContentFolder. And I need it showing up there. The addMenuItem doesn't support the layer attribute. I'm going to add this to the addMenuItem directive interface. When do you think you will be done? Just checked it in the trunk. You may want to try out. Changeset [38705] After the update from python 2.3 to 2.4.2, deleting my SVN checkout, rechecking out and compiling, recreating a clean instance, I get upon startup: File "/home/florian/Zope3/src/zope/app/component/registration.py", line 27, in ? from zope.app.component.interfaces import registration as interfaces File "/home/florian/Zope3/src/zope/app/component/interfaces/__init__.py", line 22, in ? from zope.app.container.constraints import ContainerTypesConstraint zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/florian/Desktop/zope/etc/site.zcml", line 3.2-3.50 ZopeXMLConfigurationError: File "/home/florian/Desktop/zope/etc/package-includes/securitypolicy-meta.zcml", line 1.0-1.62 ZopeXMLConfigurationError: File "/home/florian/Zope3/src/zope/app/securitypolicy/meta.zcml", line 4.2-7.51 SyntaxError: invalid syntax (constraints.py, line 240) You are still using Python 2.3. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] addview name not form
Florian Lindner wrote: Am Freitag, 30. September 2005 20:08 schrieb Jim Fulton: Florian Lindner wrote: Am Freitag, 30. September 2005 18:55 schrieb Julien Anguenot: Florian Lindner wrote: Am Donnerstag, 29. September 2005 20:25 schrieb Julien Anguenot: First have a look at this : http://www.zope.org/Collectors/Zope3-dev/391 The addMenuItem directive should look this way in order to work : without 'for="CS.ContentFolder.interfaces.IContentFolder"' (check the collector entry) But then the menu entry does not show up in views on IContentFolder. And I need it showing up there. The addMenuItem doesn't support the layer attribute. I'm going to add this to the addMenuItem directive interface. When do you think you will be done? Just checked it in the trunk. You may want to try out. Changeset [38705] After the update from python 2.3 to 2.4.2, deleting my SVN checkout, rechecking out and compiling, recreating a clean instance, I get upon startup: File "/home/florian/Zope3/src/zope/app/component/registration.py", line 27, in ? from zope.app.component.interfaces import registration as interfaces File "/home/florian/Zope3/src/zope/app/component/interfaces/__init__.py", line 22, in ? from zope.app.container.constraints import ContainerTypesConstraint zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/florian/Desktop/zope/etc/site.zcml", line 3.2-3.50 ZopeXMLConfigurationError: File "/home/florian/Desktop/zope/etc/package-includes/securitypolicy-meta.zcml ", line 1.0-1.62 ZopeXMLConfigurationError: File "/home/florian/Zope3/src/zope/app/securitypolicy/meta.zcml", line 4.2-7.51 SyntaxError: invalid syntax (constraints.py, line 240) You are still using Python 2.3. Sure? [EMAIL PROTECTED] ~ $ python -V Python 2.4.2 Yes, I'm sure. Look at the script you are using to start Zope. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] querying the catalog
Duncan McGreggor wrote: On Sep 30, 2005, at 11:31 PM, Alen Stanisic wrote: Not sure if it will help but whenever I had to look up a catalog I would only do zapi.getUtility(ICatalog) and I noticed you are also providing a name and context. Yeah, with or without the extra parameters, it always only returns the root catalog instance. I also believe that if you are looking up a catalog by name as you seem to be doing it is not enought for the catalog object to be named accumac_catalog but you also have to register it as the name ('Register As' field in New Utility Registration) during catalog creation. I usually leave 'Register As' blank as I only ever needed to get catalog by ICatalog interface only -> zapi.getUtility(ICatalog) When I created it, I set "register as" to "accumac_catalog". Based on the experience you shared, I deleted my catalog and did not give it a name upon creation. zapi.getUtility(ICatalog) now works, as it gets the "sub-site's" catalog in the accumac/++etc++site/default directory. Very strange. If I understood this more, or if there was expert-aided interest, I would troubleshoot this. It may not be a bug, but there at least seem to be issues of an anti-intuitive nature here... Alen, thanks again for your assistance in this matter :-) I suspect there was a problem of some sort with your original registration. We normally use named local catalogs and haven't had a problem. BTW, you should not pass the "context" argument to the component-lookup functions *unless* you want to find a component in a different site. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] object has no attribute '_SampleContainer__data'
Tom Dossis wrote: Leticia Larrosa wrote: When a try to see the view of list of "Service" of one of the "ServiceList" I get the following error: """ 'Service' object has no attribute '_SampleContainer__data' """ I'm newcomer in zope 3 and any idea will be appreciated. Thanks in advance. Leticia Larrosa In addition to the previous reply; I experienced the above problem when.. I implementend a simple subclass of SampleContainer, then changed to subclass BTreeContainer, but forget to delete existing instances created in Zope. A tell tale sign is you can no longer delete the broken instance(s) This sounds like a bug. Could you report this with a specific example? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Advanced usage of Z3 schemas...
Andreas Jung wrote: Hi, I am currently thinking about for a new version of PloneCollectorNG based on Zope 3. The currently implementation uses per-instances schemas (acquired from a parent object managing the schema). How would you do that in Zope 3? I'm not sure what "that" is. Surely PloneCollectorNG schemas are different from Zope 3 schemas. What is the important property of these schemas that you want to retain? - Is it important that the schemas be through-the-web? - Is it important that the schemas be interfaces? How are you using the schemas? For example, do you want to do component dispatch on the schemas? Another question: in Zope 3 we have FieldProperties that automatically handle setting and getting values. This implementation stores the values as instance attributes. What would be the recommended way to store attributes in a RDBMS instead inside the ZODB? By introducing a new RDBMSFieldProperty that handles the set/get methods in the same way as the FieldProperty implementation? Possibly. It depends on the RDBMS integration strategy. If you were using Ape, you'd probably use the existing field storage. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] event subscribers
Pete Taylor wrote: hi all... question for any event subscriber gurus (or just anyone who knows more than me, which probably won't take much ;) ) i have a set of actions that i would like to have trigger off of a particular state in a workflow. in my unittest i can see that the workflow fires the event, but my subscriber doesn't pick up on it. similarly, the subscriber i have in zcml in the application proper does not respond when the workflow transition event is fired. the functionality works if i explicitly call my subscription method against the event, but that only proves that the functionality of the code isn't broken... the relevant zcml portion is as follows: for="qarelease.interfaces.IRelease zope.app.workflow.stateful.interfaces.IAfterTransitionEvent" factory=".release.notifyTransition" /> the unittest subscribes with ztapi as follows: ztapi.subscribe((IRelease, IAfterTransitionEvent), None, notifyTransition) this seems, from both srichter's book and philiKON's book to be the right way to do this (moving from ztapi.handle to ztapi.subscribe since handle is being deprecated). does anyone have any experience in attempting to do anything like this? Normallym event subscribers are single-object adapters. In some cases, we have subscrobers that redispatch on multiple objects. For example, object events have a subscriber that redispatches events based on the object and event. You expect something similar to be going on for workflow events, but I suspect there isn't. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] object has no attribute '_SampleContainer__data'
Tom Dossis wrote: Jim Fulton wrote: Tom Dossis wrote: Leticia Larrosa wrote: I get the following error: """ 'Service' object has no attribute '_SampleContainer__data' """ I implementend a simple subclass of SampleContainer, then changed to subclass BTreeContainer, but forget to delete existing instances created in Zope. A tell tale sign is you can no longer delete the broken instance(s) This sounds like a bug. Could you report this with a specific example? Jim I can remember exactly how I naively did this originally, but I can achieve it with a little sabotage.. I missinterpreted your original message. I thought you were dealing with Broken objects, not broken objects. :) Broken objects are objects that can't be created, usually becase their class isn't around any more. The system should be able to recognize these and at least allow their deletion. >>> class Bogus(BTreeContainer): pass ... >>> bogus = Bogus() >>> root['bogus'] = bogus = Bogus() >>> del bogus.__dict__['_SampleContainer__data'] >>> del root['f'] Traceback (most recent call last): : File ".. /zope/interface/adapter.py", line 487, in subscribers subscribers = [subscription(*objects) File ".. /zope/app/container/contained.py", line 177, in dispatchToSublocations for sub in subs.sublocations(): File ".. /zope/app/container/contained.py", line 208, in sublocations for key in container: File ".. /zope/app/container/sample.py", line 56, in __iter__ return iter(self.__data) AttributeError: 'Bogus' object has no attribute '_SampleContainer__data' Is this a bug because the container now fails to fulfill it's interface causing object propogation to fail? Yes. Is defensive programming desirable or appropriate? Possibly. Probably only in the delete-object case. Ideally, if there was an error when deleting an object, the error would be reported and some UI might be provided to force delete even in the face of errors -- perhaps only if the user has a stronger permission. subs = ISublocations(object, None) if subs is not None: for sub in subs.sublocations(): def sublocations(self) container = self.container for key in container: yield container[key] I don't know what your point is here. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Interface tests: NotImplemented or NotImplementedError
FWIW, I consider interface tests to be a sucessful failure. They were worth trying but are not really worth the bother most of the time. IMO, you should only consider them in a case where you have an interface that you expect many implementations of and you want to reuse tests accross the implementations. Even then, there's a danger that the necessary infrastructure to allow reuse will make the tests unfathomable. Jim Lorenzo Gil Sanchez wrote: Hi everybody, while writing my first interface test I got to the point of writing the makeTestObject method which should raise a not implemented error (so implementations of this interace should override it) In the Zope 3 book the method is like this: def makeTestObject(self): raise NotImplemented() but after playing a bit with the Python interpreter it says that NotImplemented is not callable neither an exception. Looking in some real zope3 tests I saw another version of the method: def makeTestObject(self): raise NotImplementedError() So I guess is a little bug in the Zope3 book. Or, Am I missing something? Regards Lorenzo Gil Sanchez ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] make check
Paul Dumais wrote: Hi all, I have one error: Ran 6991 tests in 333.025s FAILED (failures=1) when doing make check on a Zope-3.1.0 build on Ubuntu Linux. In short it is: Failure in test testRunIgnoresParentSignals (zdaemon.tests.testzdrun.ZDaemonTest s) Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 260, in run testMethod() File "/home/paul/Zope-3.1.0/build/lib.linux-i686-2.4/zdaemon/tests/testzdrun.p y", line 237, in testRunIgnoresParentSignals self.assert_(is_started, "spawned process failed to start in a minute") File "/usr/lib/python2.4/unittest.py", line 309, in failUnless if not expr: raise self.failureException, msg AssertionError: spawned process failed to start in a minute Is this serious? How could I get this test to pass? Don't run the tests as root. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] make check
Stephan Richter wrote: On Wednesday 26 October 2005 16:26, Jim Fulton wrote: AssertionError: spawned process failed to start in a minute Is this serious? How could I get this test to pass? Don't run the tests as root. I see this error sporatically using a non-root user as well. I just never worry about it. :-) Right. This is not what I thought it was. This is something that I diagnosed and thought I fixed a few weeks ago. I'll look at it. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] make check
Jim Fulton wrote: Stephan Richter wrote: On Wednesday 26 October 2005 16:26, Jim Fulton wrote: AssertionError: spawned process failed to start in a minute Is this serious? How could I get this test to pass? Don't run the tests as root. I see this error sporatically using a non-root user as well. I just never worry about it. :-) Right. This is not what I thought it was. This is something that I diagnosed and thought I fixed a few weeks ago. I'll look at it. OK, Tim helped me remember what was going on with this. I predict you can make this test pass by setting the execute bit on the script donothing.sh in zdaemon/tests in the installation. This test is trying to execute this script and can't because the execute bits got cleared in the release process. The test really should be rewritten to write the shell script itself and set the permissions to whatever it wants. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] make check
Sorry, where are you looking at this. In the release, the permissions are correct. In an installation created with Python 2.4, the bits are not. What version of Python are you using? Jim Paul Dumais wrote: Sent this using the wrong account: On 10/26/05, Paul Dumais <[EMAIL PROTECTED]> wrote: Hi Jim, The execute bit seems OK: -rwxr-xr-x 1 root root59 2005-10-02 12:48 donothing.sh I get more errors if I run as root (the above one included). Ubuntu does something tricky to the root account so that you cannot su root. You have to sudo 'command' to do root tasks. I suspect this difference is why I get more errors when I do sudo make check. Since I am running make check as a user on the system, I though I would try chown 'user' donothing.sh. Doing this gives the same error when I run 'make check'. I guess this begs the question: should I be looking to chown 'user' a bunch of files and directories (since I plan to run everything as a user)? Should I be looking to get rid of the su root lockout feature of Ubuntu? Hopefully none of this should be necessary since my 'user' is a superuser. I guess this is not a major problem, since Steve is safely ignoring the error. Thanks for the quick replies! I read some posts from August that mentioned that it may just be an issue of a slower machine (my machine has a few other processes running on it). Increasing the error threshold to something higher may be what's needed? Paul On 10/26/05, Jim Fulton <[EMAIL PROTECTED]> wrote: Jim Fulton wrote: Stephan Richter wrote: On Wednesday 26 October 2005 16:26, Jim Fulton wrote: AssertionError: spawned process failed to start in a minute Is this serious? How could I get this test to pass? Don't run the tests as root. I see this error sporatically using a non-root user as well. I just never worry about it. :-) Right. This is not what I thought it was. This is something that I diagnosed and thought I fixed a few weeks ago. I'll look at it. OK, Tim helped me remember what was going on with this. I predict you can make this test pass by setting the execute bit on the script donothing.sh in zdaemon/tests in the installation. This test is trying to execute this script and can't because the execute bits got cleared in the release process. The test really should be rewritten to write the shell script itself and set the permissions to whatever it wants. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: [Zope3-dev] Freeze approaching quickly
Julien Anguenot wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stephan Richter wrote: with October winding down, the freeze on the trunk is coming quickly. So, if you have any outstanding work, now is the time to get it done. During the last week I have monitored the proposals and branches a bit and I think most people are done with their work. [...] Did I miss anyone? Now is the time to speak up! yes, I'd like to see the "Better XML support for PT" proposal as well : http://svn.zope.org/Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/ http://www.zope.org/DevHome/Wikis/DevSite/Projects/ComponentArchitecture/BetterXMLSupportForPageTemplates I'll take time to finish the remaining issues around this in the following days and we'll be able to discuss it after this. Is it ok for everybody ? I think this is too risky for this release: 1. This change seems to be pretty controversial. There is a lot of fear that this will cause browser compatability problems. I think this fear can only be addressed by an alpha release and it's too late for that for the december Zope releases. 2. I get the impression from talking to Fred that there is still a lot of work required to land this and that a significant amount of his time would likely be required. I'm worrid that this could be a major source of instability and I think we have enough of those already. I suggest the following: - You keep working on your branch and get it to the point that it is *stable* and ready to merge. - Soon after the 3.2 release branch is made in early November, you merge your stable branch to the trunk and we'll make a 3.3 alpha release that people can use to try out this change. We'll let it be known that the change will be included in 3.3 unless people discover serious client-compatibility problems created by the change. You could use this release or the trunk for your xmlforms experiments. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] make check
Paul Dumais wrote: That was at: /usr/local/Zope-3.1.0/lib/python/zdaemon/tests/ The one at: /home/paul/Zope-3.1.0/build/lib.linux-i686-2.4/zdaemon/tests/donothing.sh did not have the permissions set. I changed it, ran the tests and all passed! Ran 6991 tests in 263.891s OK So it seems that the -x bits are are set correctly in the installation but not the release (opposite of what you said? - not sure), but it is the release version that is run, so it is there that it needs to be set properly. Actually, this is neither the release nor the installation. This is the "build", which is an intermediate thing. :/ The bottom line is that this test needs to be rewritten. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Generations - a missed use case? (Evolving an application for the first time)
ound not providing generation support in the past. Unfortunately, there's no way for the generation system to know which situation applies. Presumably, an install script can have the logic to know this and perform some appropriate action. Note too that an application that needs to catch up from an "unmanaged" generation to a current generation might prefer to provide a direct conversion, rather than taking intermediate steps. Assuming that the best way to catch up is by running all evolution scripts from (before) the beggining is guessing too much. In summary, I think that the installation script is the right way to handle this situation. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Adapting a builtin?
It is valid both to: - Declare an interface for a built-in type and register adapters for that interface, and to - Register adapters for builtin types directly. I can't promise that this works now, but it ought to work. I'm 90% sure that it does in fact work, at least in Zope 3. Jim Roger Ineichen wrote: Hi Jim, can you confirm that this is a valid concept for the adapter registry or do we get trouble in the future? I didn't find any sample in the README.txt files about adapting builtin strings like a "principal_id"). Hi Michael and Mac -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Howitz Sent: Wednesday, December 07, 2005 8:59 AM To: Paul Winkler Cc: zope3-users@zope.org Subject: Re: [Zope3-Users] Adapting a builtin? On Tue, 2005-12-06 at 18:44 -0500, Paul Winkler wrote: Hi, Is it possible to register an adapter for a builtin type such as str? All the adapter examples I see use an interface for the "for" attribute. Something like: Hi, in plain Zope3 (I'm not using Five, but it may be similar there.) you can declare an interface for the buitin: (e.g. in interfaces.py) class interface IStr(Interface): # define the methods here which you need to access def upper(): "upper ... as an example" In configure.zcml, you declare the interface for the builtin: Then you can do: IHTTPConnection('string') to get the adapter. HTH, mac That's a interesting question. I do it also, but in a different way. It works for me like this and the adapter registry and persistence work well. -- class PrincipalMessagesForPrincipalId(BaseMessages): """Base implementation for principal annotation based messages.""" adapts(IAttributeAnnotatable, str) implements(IPrincipalMessages) messageQueueKey = 'PrincipalMessages' def __init__(self, context, principalId): """Initialize with a context.""" self.context = context self.principalId = principalId -- With adapts() and implements() you can use a simply registration like: -- -- Regards Roger Ineichen Projekt01 GmbH www.projekt01.ch _ END OF MESSAGE ___________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Adapting a builtin?
Martijn Faassen wrote: Jim Fulton wrote: It is valid both to: - Declare an interface for a built-in type and register adapters for that interface, and to - Register adapters for builtin types directly. I can't promise that this works now, but it ought to work. I'm 90% sure that it does in fact work, at least in Zope 3. If exceptions are counted as built-ins, Nope. Builtins are things like str and list. The interface package actually provides some special support for types like these that can't have interface-declaration data added to them. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: What's the rationale of @@ ? Was: index.html
Stephan Richter wrote: On Tuesday 13 December 2005 08:02, Andreas Elvers wrote: what the rationale of @@ anyway ? I've searched for a definition for this in the Developer Handbook and elsewhere but it's hard to search for @@ and view. For insight or pointer to documentation or source to this matter I'd be very happy. It is a shortcut for the ++view++ namespace. @@ looks like two eyes. ;-) More importantly: - It is short - It doesn't have any English words in it This is the most likely place where name spaces might appear in public URLs, so I wanted to make them as unobtrusive as possible. (If you work hard, you can avoid them altogether, but I don't expect most people to work that hard.) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: What's the rationale of @@ ? Was: index.html
Jeff Rush wrote: Frank Burkhardt wrote: On Tue, Dec 13, 2005 at 02:02:05PM +0100, Andreas Elvers wrote: what the rationale of @@ anyway ? I've searched for a definition for this in the Developer Handbook and elsewhere but it's hard to search for @@ and view. @@ marks a given path component explicitely as a view of the previous object. Example: http://zopeserver/contents.html Could mean either "The object named 'contents.html' in the root folder" or (if there is no such object) "The 'contents.html' view (List of contained objects) of the root folder" - the object is preferred. http://zopeserver/@@contents.html Will always display the list of contained objects of the root folder - no matter if there's a object 'contents.html' or not. Hmm, but the '@@' is optional, as I can leave it off and still get the contents.html view if there is no object named contents.html in that folder. This would seem to confuse developers, as if there IS an accidental collision of an item name with a view that is unknown to the developer, it will return the view out of nowhere. No, it will return the view. Shouldn't the '@@' should be *required* on views to avoid this ambiguity? This is a matter of policy. It is straightforward to change. Many people hate @@ and the ++view++name syntax. They will often arrange their item and view names so that they don't overlap. It might be nice to have easily-configured alternate policies. For example: - require @@, as you suggest - log a warning, or possible raise an error in development mode, if, when you get an item, you also find a view with the same name. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: What's the rationale of @@ ? Was: index.html
Chris Withers wrote: Jim Fulton wrote: This is a matter of policy. It is straightforward to change. Many people hate @@ and the ++view++name syntax. They will often arrange their item and view names so that they don't overlap. How hard is it to plug in different url parsing? It's often something people want to do their own way, and as you point out, some people don't like the default ;-) This isn't really URL parsing, it's traversal. It's easy to plug in different traversal adapters. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: What's the rationale of @@ ? Was: index.html
Andreas Elvers wrote: Chris Withers wrote: Jim Fulton wrote: This is a matter of policy. It is straightforward to change. Many people hate @@ and the ++view++name syntax. They will often arrange their item and view names so that they don't overlap. How hard is it to plug in different url parsing? It's often something people want to do their own way, and as you point out, some people don't like the default ;-) So I could have http://localhost/@@PagedView/page/20 ? The would be great. You can have anything you want as long as you are willing to write the necessary components. I have no idea what the URL above means, so I won't hazard to guess how you should do it. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope3 Glossary on zope.org
Andreas Elvers wrote: Hi, I really think the service stuff should be moved to a place like "deprecated terms". Is it possible to get editing rights for this wiki page ? Yup. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Get to ZODB root from global utility
John Smith wrote: Hi, Does anyone know if there any way to get to the main ZODB root of the site other than using zope.app.zapi.getRoot(someObject)? Here is the background. I want to programatically create new folders underneath the Zope root, according to some external source which my zope instance polls periodically. I have made a global utility what spawns a worker thread which creates the folder objects. My problem is I don't seem to be able to work out how to get hold of the Zope root as I have not get any context. Each database defined in zope.conf is registered as a ZODB.interfaces.IDatabase with the name given in zope.conf. If you you have only one database and it doesn't have a name, then you should be able to look up the utility without supplying a name. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Get to ZODB root from global utility
John Smith wrote: Dear Jim, I was unable to import IDatabase from ZODB.interfaces, although I could import IDataManager and IConnection. However, when I tried: root = zapi.getUtility(IDataManager) I got a componentlookuperror. (The same error happens with IConnection). Did you try IBuddy? ;) Any thoughts? I'm guessing that you are using Zope 3.0. The registration of databases as utilities wasn't added until 3.1. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] URGENT RFC: Is anyone using response.write in Zope 3?
When we refactored the Zope 3 pubisher to work more closely with WSGI, we decided to remove the response.write method. We should have written a proposal for this, but we failed to do so. Over the last few weeks there has been much discussion of this in which I asserted many times that I didn't think any applications outside of Zope 3 itself used this method. No one has disagreed with me. I want to double check this. Does anyone have any Zope 3 applications that are using response.write? Assuming that the answer is "no" (or that no one answers today), I'm going to more clearly document how to return long output and I'm going to add a method that generates a hopefully helpful error. Note that we may add this method (or something like it) back in the future to support chunked streaming output, Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: [Zope3-dev] Re: URGENT RFC: Is anyone using response.write in Zope 3?
Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: When we refactored the Zope 3 pubisher to work more closely with WSGI, we decided to remove the response.write method. We should have written a proposal for this, but we failed to do so. Over the last few weeks there has been much discussion of this in which I asserted many times that I didn't think any applications outside of Zope 3 itself used this method. No one has disagreed with me. I want to double check this. Does anyone have any Zope 3 applications that are using response.write? Assuming that the answer is "no" (or that no one answers today), I'm going to more clearly document how to return long output and I'm going to add a method that generates a hopefully helpful error. Note that we may add this method (or something like it) back in the future to support chunked streaming output, IIRC, Christian Theune wrote that he had been using 'response.write'; I think the note was in the "Twisted Publisher" thread about a week and a half back. Thanks, for the reminder, but this was internal Zope code that had inadequate tests. It is also code that isn't being used in production at this time because it is incomplete. (This is sad, because I think zsync has tremendous potential. We should probably move it to a development branch and remove it from the main tree until it's ready. Sigh.) I think he stumbled accross this while addressing a collector issue. I really want to know if any Zope 3 applications outside of Zope 3 itself are using this API. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: ZCML, practicality, purity (was "Excellent perspective...")
Martin Aspeli wrote: So it's very refreshing to see Zope 3 without ZCML. I hope the trend continues. I think Philipp makes what in my limited understanding is a very good point here: http://www.z3lab.org/sections/blogs/philipp-weitershausen/2005_12_14_zcml-needs-to-do-less Me too. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: ZCML, practicality, purity (was "Excellent perspective...")
Chris McDonough wrote: On Dec 22, 2005, at 12:05 PM, Shane Hathaway wrote: Time and again people fail to realize that Zope 3 wants to create the low level framework right first, and only after that add high level simplifications and shortcuts to have less configuration and provide fastest developer exeperience. Of course people aren't attracted to Zope 3 yet because they feel it's complex. And there's a reason: it *is* complex. For now. So you don't think anyone but hard core Pythonistas should use Zope 3 yet? Does anyone think that code generation in the form of a "starter package" could help here? Yes. I'm hoping that the ArchGenXML project will produce that for Zope 3. I wonder how that work is progressing ... Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: ZCML, practicality, purity (was "Excellent perspective...")
Jean-Marc Orliaguet wrote: Shane Hathaway wrote: ... The problem with ZCML is not the language (XML). Writing the same description in python would not address such issues as: - when looking at a component, how can I know how it is wired inside the application without doing a grep on 100 files? - when looking at the wires, how do I quickly get access to the components that they connect together? I agree. This is an issue with any system with lots of indirection. It's even a hassle with lots of inheritence, although at least base classes provide an avenue of search. This is all I need in order to understand how an application is built. If it was easier to navigate between the components by following the wires, there wouldn't be such an issue with ZCML I think. Maybe a GUI, or IDE would help a lot. Have you looked at apidoc? If not you should. It's far from perfect, but it's a great start. It needs more people contributing ideas. It could also be that ZCML is cluttered with too much information that really doesn't belong there. Yup. For instance ZCML should not be used for the application setup (for creating menus, actions, workflows, etc.) because this has nothing to do with connecting components. This could be done in python or be stored in archives in XML (.tgz, .zip, ..). Except that these all *are* components. Shane Hathaway wrote: > Chris McDonough wrote: > >> I assume this means you've given up on the idea of creating a GUI >> ZCML configuration tool, the? > > > No. In fact, I've been creating the tool for the purpose of convincing > myself that ZCML is right, even though I still believe it's wrong. :-) > > One thing I've learned from the GUI project, however, is that its > greatest value is being able to *query* the configuration. It lets you > answer questions like "where are all the views named update.html?". > That's valuable independently of the format of ZCML. This would be a good feature to add to apidoc. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Get classes implementing Interface
Florian Lindner wrote: Hello, how can I get all classes that implement a specific interface? What interface do I need to search for, when I want all objects that can be added and work as container? IContainer seem to be implemented by a lot more objects... There isn't an api for that. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: URGENT RFC: Is anyone using response.write in Zope 3?
Philipp von Weitershausen wrote: Jim Fulton wrote: When we refactored the Zope 3 pubisher to work more closely with WSGI, we decided to remove the response.write method. We should have written a proposal for this, but we failed to do so. Over the last few weeks there has been much discussion of this in which I asserted many times that I didn't think any applications outside of Zope 3 itself used this method. No one has disagreed with me. I want to double check this. Does anyone have any Zope 3 applications that are using response.write? Assuming that the answer is "no" (or that no one answers today), I'm going to more clearly document how to return long output and I'm going to add a method that generates a hopefully helpful error. Note that we may add this method (or something like it) back in the future to support chunked streaming output, Alas, I just realized from Adam Summer's posting to zope3-users two days ago (http://mail.zope.org/pipermail/zope3-users/2005-December/001746.html) that my book is using response.write(). I had totally forgotten about it, though it isn't much of a problem. The book is about Zope X3 3.0 and can't make guarantees about future versions. Just to be safe I've added an entry to my errata page: page 204, Example 12.24, line 17: Using the ``write()`` method of HTTP-based responses does not provide a performance advantage in Zope X3 3.0 and 3.1 and is not supported anymore in Zope 3.2 and higher. To effectively return large data without holding it in memory, it is now recommended to create a temporary file and return that:: import tempfile f = tempfile.TemporaryFile() f.write(pdf.data) return f This will only work with Zope 3.2 and higher. Yeah, this is definately a problem. I don't want to make it hard for people who bought the book. I'd also rather not delay the release any more. Hopefully, the new error message in 3.2 will make this clearer. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Philipp von Weitershausen wrote: Florian Lindner wrote: my first use case is that I want to enhance the HomefolderManager to make it possible to select something else than a Folder to be created automatically. Right now I have forked a version of the HomefolderManager and just changed in the code. But I would like to have a more generic solution and I'll also commit it back to the trunk. For that I want all classes implementing IContainer (and IContentType ?) and let the user select on in the configuration dialog of the HomefolderManager. More use caess probably show up in my project later, but nothing fixed at this time. So what you want is to create objects. Classes are just an implementation detail to creating objects :). Factories create objects, whether they're from a class is immaterial. So, what you want is not a list of classes but a list of factories that can create IContainers. This is possible by using zapi.getUtilitiesFor(IFactory) and then checking each factory's getInterfaces() method whether IContainer is a part of the returned result. I would probably base an implementation of all on the UtilityVocabulary. I'll also note that the use case is also directly addressed through containment constraints. You can say that a container should only contain objects of some given types and you will get just those types in the add list. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Florian Lindner wrote: Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton: Philipp von Weitershausen wrote: Florian Lindner wrote: my first use case is that I want to enhance the HomefolderManager to make it possible to select something else than a Folder to be created automatically. Right now I have forked a version of the HomefolderManager and just changed in the code. But I would like to have a more generic solution and I'll also commit it back to the trunk. For that I want all classes implementing IContainer (and IContentType ?) and let the user select on in the configuration dialog of the HomefolderManager. More use caess probably show up in my project later, but nothing fixed at this time. So what you want is to create objects. Classes are just an implementation detail to creating objects :). Factories create objects, whether they're from a class is immaterial. So, what you want is not a list of classes but a list of factories that can create IContainers. This is possible by using zapi.getUtilitiesFor(IFactory) and then checking each factory's getInterfaces() method whether IContainer is a part of the returned result. I would probably base an implementation of all on the UtilityVocabulary. I'll also note that the use case is also directly addressed through containment constraints. You can say that a container should only contain objects of some given types and you will get just those types in the add list. But the HomeFolderManager is not a container itself it's just a utility that creates container upon requests. And I want to make choosable which container to create. Or do I misunderstand you? I missunderstood you. I'm not familiar with HomeFolderManager. In any case, the approach taken for containment constraints, which Philipp sketched above, should be applicable. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Zope 3.2.0b3 released
I've made a source release of Zope 3.2.0 beta 3. I plan to make a Windows release tomorrow, when I have access to a windows machine with a compiler, unless someone beats me to it. This release was motivated by a fairly severe bug in the input buffering used to integrate Twisted with Zope. The release can be downloaded at: http://www.zope.org/Products/Zope3/3.2.0b3 I plan to make a final 3.2.0 release on Thursday or Friday. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: [Zope3-dev] Zope 3.2.0b3 released
Tim Peters wrote: [Jim Fulton] I've made a source release of Zope 3.2.0 beta 3. I plan to make a Windows release tomorrow, when I have access to a windows machine with a compiler, unless someone beats me to it. I gave it a try, but it dies near the start of the process: $ \python24\python.exe ..\zpkg\bin\zpkg -C releases\Zope.cfg -v 3.2.0b3 -t Zope-win 'version.txt' doesn't match any files in (in C:\Code\Zope3.2\src\zope\app\PACKAGE.cfg) I _suppose_ this is because there's no file named version.txt in src/zope/app/ under svn+ssh://svn.zope.org/repos/main/Zope3/tags/Zope-3.2.0b3 Did you miss step #3 from http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/MakingARelease ? Assuming that's all there is to it, I'll add it myself ... Yes, I followed the step, but I forgot to add the file. Sigh. The file is actually included in the source tar ball. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problems with Zope 3.2.0b3 on Linux
Marco Groppo wrote: Hi! I'm experiencing some "strange" problems with Zope 3.2.0b3 Did you have the problem with beta 2? > on GNU/Linux (Ubuntu Breezy i386, kernel 2.6.12, python 2.4.2, gcc 3.4). If I add an object to the root folder (for example using the ZMI) and I try to see one of its browser views Zope sends me a 404 error page. If I add more objects and then I try to delete one of them, sometimes I can still see the object after the deletion (even if I reload the page) and sometimes (for example if I try to reload the page one more time) I can't. Weird. I haven't seen this. (obviously) > I tried to run the tests with 'make check' and the result was: Ran 8033 tests with 0 failures and 0 errors in 604.001 seconds. If I test the installation with bin/zopetest: +++ Running unit tests: Ran 7650 tests with 0 failures and 0 errors in 298.561 seconds. Running zope.app.testing.functional.Functional tests: Set up zope.app.testing.functional.Functional Traceback (most recent call last): File "./zopetest", line 39, in ? sys.exit(testrunner.run(defaults)) File "/home/marco/zope3.2/lib/python/zope/testing/testrunner.py", line 238, in run failed = run_with_options(options) File "/home/marco/zope3.2/lib/python/zope/testing/testrunner.py", line 391, in run_with_options setup_layers, failures, errors) File "/home/marco/zope3.2/lib/python/zope/testing/testrunner.py", line 557, in run_layer setup_layer(layer, setup_layers) File "/home/marco/zope3.2/lib/python/zope/testing/testrunner.py", line 632, in setup_layer layer.setUp() File "/home/marco/zope3.2/lib/python/zope/app/testing/functional.py", line 197, in setUp FunctionalTestSetup(self.config_file) File "/home/marco/zope3.2/lib/python/zope/app/testing/functional.py", line 139, in __init__ self.app = Debugger(self.db, config_file) File "/home/marco/zope3.2/lib/python/zope/app/debug/debug.py", line 35, in __init__ config(config_file) File "/home/marco/zope3.2/lib/python/zope/app/appsetup/appsetup.py", line 110, in config context = xmlconfig.file(file, context=context, execute=execute) File "/home/marco/zope3.2/lib/python/zope/configuration/xmlconfig.py", line 554, in file include(context, name, package) File "/home/marco/zope3.2/lib/python/zope/configuration/xmlconfig.py", line 483, in include f = openInOrPlain(path) File "/home/marco/zope3.2/lib/python/zope/configuration/xmlconfig.py", line 394, in openInOrPlain fp = open(filename) IOError: [Errno 2] No such file or directory: '/home/marco/zope3.2/bin/ftesting.zcml' +++ This is very odd. I can't reproduce this. I have installed Zope 3.2 b3 on Windows also and I haven't noticed any problem so far. Maybe you should try the linux installation process again. Is anyone else seeing symptoms like these? P.S.: sorry for my English... It looks good to me. :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problems with Zope 3.2.0b3 on Linux
Marco Groppo wrote: I forgot to say that some times I get this error when I try to access a ZODB object (it doesn't matter what kind of object): +++ ERROR ZODB.Connection Shouldn't load state for 0x36 when the connection is closed Traceback (most recent call last): File "/usr/lib/python2.4/threading.py", line 422, in run self.__target(*self.__args, **self.__kwargs) File "/home/marco/apps/zope3.2/lib/python/twisted/python/threadpool.py", line 149, in _worker context.call(ctx, function, *args, **kwargs) File "/home/marco/apps/zope3.2/lib/python/twisted/python/context.py", line 59, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "/home/marco/apps/zope3.2/lib/python/twisted/python/context.py", line 37, in callWithContext return func(*args,**kw) --- --- File "/home/marco/apps/zope3.2/lib/python/twisted/web2/wsgi.py", line 139, in run result = self.application(self.environment, self.startWSGIResponse) File "/home/marco/apps/zope3.2/lib/python/zope/app/wsgi/__init__.py", line 49, in __call__ request = self.requestFactory(environ['wsgi.input'], environ) File "/home/marco/apps/zope3.2/lib/python/zope/app/publication/httpfactory.py", line 62, in __call__ request_class, publication_class = chooseClasses(method, env) File "/home/marco/apps/zope3.2/lib/python/zope/app/publication/httpfactory.py", line 34, in chooseClasses request_class, publication = factory() File "/home/marco/apps/zope3.2/lib/python/zope/app/publication/requestpublicationfactories.py", line 79, in __call__ request_class = component.queryUtility( File "/home/marco/apps/zope3.2/lib/python/zope/component/__init__.py", line 260, in queryUtility return getSiteManager(context).queryUtility(interface, name, default) File "/home/marco/apps/zope3.2/lib/python/ZODB/Connection.py", line 729, in setstate raise ConnectionStateError(msg) ZODB.POSException.ConnectionStateError: Shouldn't load state for 0x36 when the connection is closed +++ ...and then, if I reload the page, the problem can magically disappear, and if I request the view another time I can get the error again, and so on and so on... it seems to me that the behaviour is totally random. Does anybody know what's going on? For some reason, a database connection wasn't closed properly. Is there anything special about your setup? Is this a plain Zope install? Are you using ZEO? Are you using a single database? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Problems with Zope 3.2.0b3 on Linux
Florent Guillaume wrote: This might, or might not, be related to a problem I discussed in the context of Zope 2 recently on the zodb-dev list. In the case of multidatabases, That's why I asked whether he was using multiple databases. > the initial connection to a secondary database (mountpoints in Zope 2) isn't always joined correctly to the set of connections of the multidatabase, and thus not closed correctly when the main connection is closed. I'm still waiting for feedback about this on zodb-dev. Yeah, I know I need to get to this. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problems with Zope 3.2.0b3 on Linux
Marco Groppo wrote: Il giorno mer, 04/01/2006 alle 19.07 -0500, Jim Fulton ha scritto: Did you have the problem with beta 2? Sorry, I'm an idiot. Yesterday I didn't read the access log, so I didn't notice that the problem was Firefox... The problem was due to a Firefox extension (FasterFox) which I installed sometime ago (I had even forgotten of its existence...). This extension periodically downloads all static pages linked by the current page; since the names of the views usually finish in .html it thinks that they are static pages :-( and when the browser loads the ZMI page it gets in background /@@find.html, /@@grant.html,... and of course: /@@undo.html! I'm really sorry, I should have read the log yesterday :-( (the reason why I didn't notice this problem with previous versions is that probably I didn't have FasterFox enabled...) Of course, this doesn't explain the test failures or the "Shouldn't load state for ... when the connection is closed" errors. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problems with Zope 3.2.0b3 on Linux
Marco Groppo wrote: Il giorno gio, 05/01/2006 alle 09.01 -0500, Jim Fulton ha scritto: Of course, this doesn't explain the test failures or the "Shouldn't load state for ... when the connection is closed" errors. I've reinstalled Zope and now the functional tests pass! And I can't reproduce the other error ("shouldn't load...") anymore, even if I enable FasterFox and "stress" the db with many requests. I don't know what I had done, but I wasn't using multiple DBs... Strange. OK. :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope 3 Ready for Production? Really?
Stephan Richter wrote: On Saturday 14 January 2006 12:27, David Johnson wrote: It has been claimed that Zope 3 is ready for production. I would like to politely disagree, and maybe even suggest that the claim be remoked. I feel bad for people who want to use Zope 3, later finding out that they cannot do what they want, or putting up sites which are unstable, and giving the project a bad reputation. Overall, it's really just a standards thing. Okay, so that's you opinion. Several companies use Zoep 3 very successfully in production, so they clearly have a different opinion. I doubt that you can change the developers' minds about that. To be fair, "ready for producton" is not exactly crisp. People with sufficient knowledge are running it in production, and therefore it's fair to say it is ready. It is still a new and somewhat immature system. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope 3 Capacities
David Johnson wrote: We're looking at 10-100 billion tx per year stored and performed. Partly I'm trying to gauge where the dividing line is between using the ZODB and not, and also estimate how many server instances should be running. I'm not sure any transactional database will handle that sort of rate with a single database. We did some tests 2 years ago and with commodity hardware, we were able to commit around 50 simple transactions per second (tps) to a file storage over ZEO. This is about 60 times slower than you need, assuming 100 billion tx per year or about 3000 tps. I imagine you could do somewhat better than that if you got beefier hardware. A *quick* google on transaction rates yielded a fairly old article: http://www.wintercorp.com/rwintercolumns/ie_9903.html At that time, most of the databases tested on Unix did less that 100 tps. Many of them much less. Of course that was a long time ago. Does anyone know of more recent data? Of course, if you can segregate your data, you can get higher transaction rates by employing multiple database servers, ZODB or otherwise. I've faily confident that this is what you'll need to do. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Zope 3 Capacities
Jeff Rush wrote: ... I've always wondered why ZODB didn't offer an option of storing the object index in a BTREE, but I guess its the performance issue of potential additional disk accesses. This was one of the benefits of the Berkeley DB storage. Sadly, we put a lot of work into the BDB storage and people didn't seem to care that much. That, and the grief we got from Berkeley DB itself made us drop the effort. I do still think it has a lot of potential. We could make the file-storage index management more sophisticated, but I'd really rather find something like the Berkeley database that we could build on. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Please Guido, pick me, pick me!
Jegenye 2001 Bt (Miklós Prisznyák) wrote: > (how many more lame names can we come up with?) Zope 3 / Rebirth is the lame name I'd vote for :) Florent Hm, Zope 3 / Renassaince sounds posh :-) and it's also a good excercise in spelling :p (except for the French-speaking like yourself) Yeah, it's a plot to keep me from talking about releases. ;) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Splitting ZODB ?
Philipp von Weitershausen wrote: Chris Withers wrote: Thierry FLORAC wrote: While using Zope2, I used to "split" my ZODB into several parts, using the "old" DBTab product configuration (which was finally included into Zope2). Can I setup this kind of configuration with Zope3 and, if so, how ? It's all ZODB, I would hope Zope 3's zope.conf would allow this in the same way that Zope 2 does... Actually, DBTab and Zope 2 used to monkey patch the ZODB to allow mount points. The ZODB has recently grown this feature itself and IIRC Zope 2 was fixed (by Theuni?) to use this functionality now. I don't think Zope 3's zope.conf exposes it yet, though. Yes, it does. You can have multiple database sections and database sections can now have a name. The databases are registered as utilities and participate in a ZODB multidatabase. The first database defined is used as the root database. Zope 3 doesn't support mounting, but the same functionality is mostly trivially obtained using the ZODB multi-database APIs. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Splitting ZODB ?
Philipp von Weitershausen wrote: Jim Fulton wrote: Zope 3 doesn't support mounting, but the same functionality is mostly trivially obtained using the ZODB multi-database APIs. Well, ok, then mounting support could a nice sprint topic :) Maybe, I'm not really sure it is necessary. Now you can just grab an object from one database and assign it as an attribute value of an object in another database. Much of the value of the Zope 3 mounting code was in getting around the limitation that cross-database object references weren't supported. BTW, it might be nice to start thinking about having some Foundation sprints. :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Splitting ZODB ?
On Jun 22, 2006, at 2:35 AM, Chris Withers wrote: Jim Fulton wrote: Much of the value of the Zope 3 mounting code was in getting around the limitation that cross-database object references weren't supported. Does Zope 3 still have the idea of "one big tree" of object with path-like unique identifiers? If so, then mounting will probably still be very useful... The default Zope 3 configurations still organizes objects into a tree. Path identifiers are no longer used. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Splitting ZODB ?
On Jun 26, 2006, at 6:17 AM, Chris Withers wrote: Jim Fulton wrote: The default Zope 3 configurations still organizes objects into a tree. Path identifiers are no longer used. How do you now uniquely identify an object? First, you usually don't need an independent unique id for an object, since direct object references work much better in Zope 3 than they do in Zope 2. If you do need a separate identifier of some kind, you can use a key reference or use an integer id from an intid utlity, which simply assigns integers to key references. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Splitting ZODB ?
I expect that these frameworks are documented in the Zope books. Look at the zope.app.keyreference and zope.app.intid packages. (Both of these should eventially be moved out of zope.app and both, sadly, were written before we developed doctest-based testing practices.) Jim On Jun 26, 2006, at 6:59 AM, David Pratt wrote: Hi Jim. Where should this be done (separate identifier). I was thinking of a UUID of some sort when I read this which could be helpful for other things. Regards, David Jim Fulton wrote: If you do need a separate identifier of some kind, you can use a key reference or use an integer id from an intid utlity, which simply assigns integers to key references. -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Security alert: use of Through-the-Web reStructuredText
Recently, a serious security flaw was found in Zope 2 due to it's improper support for allowing reStructuredText to be edited through- the-web. reStructuredText has directives that allow inclusion of any file a Zope process could read and inclusion of data obtained from fetching arbitrary URLs. In a trusted environment, these directives have legitimate uses. The feature of including files and URL results should not be enabled for text entered from untrusted sources, which applies to most through-the-web interactions. The recent hotfix: http://www.zope.org/Products/Zope/Hotfix-2006-07-05/Hotfix-2006-07-05 addresses the problem for Zope 2. It is safe to allow reStructuredText through the web with care. The inclusion of files or URL results can be disabled, but the programmer must explicitly disable the feature. It is not disabled by default. It is also critical that a developer who exposes through-the-web reStructuredText have tests to verify that the file/url inclusion feature has been disabled. Zope 3 itself, as released, doesn't have this problem because it doesn't allow reST entry through the web. There are third-party applications, however, including 2 packages in the Zope 3 subversion tree that do have this problem. I strongly urge you to avoid using any Zope package that allows through-the-web input of reStructuredText unless you can verify that file/url has been properly disabled. The zwiki and bugtracker packages do not currently disable file/url inclusion and should not be used in situations in which users who are not highly trusted have access to these applications. If you are using a Zope 3 checkout, these packages are currently included and enabled. I plan to remove these packages from the Zope 3 repository tree within the next few hours. If you are using a checkout-based Zope 3 installation that exposes these packages to untrusted users, you are strongly urged to disable these packages by removing the following files from your package-includes directory: zwiki-configure.zcml bugtracker-configure.zcml Removing these files will also avoid problems when you update your checkout later, as these will refer to non-existent packages. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
On Jul 8, 2006, at 11:49 AM, David Pratt wrote: Jim Fulton wrote: Recently, a serious security flaw was found in Zope 2 due to it's improper support for allowing reStructuredText to be edited through-the-web. reStructuredText has directives that allow inclusion of any file a Zope process could read and inclusion of data obtained from fetching arbitrary URLs. In a trusted environment, these directives have legitimate uses. The feature of including files and URL results should not be enabled for text entered from untrusted sources, which applies to most through-the- web interactions. Hi Jim. In the case of a wiki, it is the nature of a wiki that folks are able to edit through the web. But a wiki can be edited in other formats that restructured text. (Personally, I think wikis should use tools like Epoz or Kupu to allow direct HTML editing, but that's a different matter. Wouldn't data validation and any necessary alterations to the directives some sense as opposed to removing it from the zope3 mix? Sure, if someone is willing to do it and take responsibility. Note that I'm not removing these from the release, because they've never been in the release. I didn't even remove them from the repository, I just removed them from the Zope 3 tree. I'm convinced that TTW reST can be safe with suitable attention to detail. So far though, that hasn't happened. No one has come forward yet and said "I'll maintain this and be responsible for making sure we're secure wrt reST". The recent hotfix: http://www.zope.org/Products/Zope/Hotfix-2006-07-05/ Hotfix-2006-07-05 addresses the problem for Zope 2. Perhaps. We don't know for sure. We don't have tests. We don't know if it can be defeated using a reload product. It is also a very crude fix. It prevents people from creating add-ons that make legitimate use of file-inclusion or the raw directive. It was a great fix in an emergency -- and this was a serious emergency, but I don't want to use such a fix in Zope 3. It is safe to allow reStructuredText through the web with care. The inclusion of files or URL results can be disabled, but the programmer must explicitly disable the feature. It is not disabled by default. It is also critical that a developer who exposes through-the-web reStructuredText have tests to verify that the file/url inclusion feature has been disabled. Zope 3 itself, as released, doesn't have this problem because it doesn't allow reST entry through the web. There are third-party applications, however, including 2 packages in the Zope 3 subversion tree that do have this problem. I strongly urge you to avoid using any Zope package that allows through-the-web input of reStructuredText unless you can verify that file/url has been properly disabled. The zwiki and bugtracker packages do not currently disable file/ url inclusion and should not be used in situations in which users who are not highly trusted have access to these applications. Can you be explicit about the process of disabling file/url inclusion for zope3 (if this is the critical point you are making ). The use of restructured text is valuable in zope and obviously it is important to understand security measures that would allow its continued use. The reStructuredText documentation gives instructions for disabling it. But something this risk needs people to be responsible. I'm not seeing that. I expect someone to come forward eventually. Part of being responsible is writing reasonably extensive tests. If this can be done, why remove the products from the repository tree? Would it not be better to apply the necessary fixes? Many thanks. Because their presence in the Zope 3 tree put people at serious risk. If someone wants to work on them, great, and they can release them as add-on packages. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
On Jul 18, 2006, at 2:55 PM, David Pratt wrote: Hi Jim. I was noticing a 0.4.0-zope in distutils I don't know what you mean by this. that looks patched with NotImplementedErrors for the offending code in docutils.parsers.rst.directives.misc. Can you when this will land in the Zope3 trunk? If you mean patching the docutils, then as far as I'm concerned, it will never land in the Zope 3 trunk. The right solution to this problem is to write applications that use docutils correctly, not to patch docutils. I can understand why this solution was used for Zope 2, at least in the short run. I don't think it's a good long-ter solution. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
On Jul 19, 2006, at 8:35 AM, David Pratt wrote: Benji York wrote: David Pratt wrote: You are probably right but just the same I'd rather see the patched version for z3 also since I am certain this will become less obvious over time if it is left the way it is. Instead of maintaining a fork of docutils, Zope 3 should (and may already, I haven't been keeping up with this issue) include tests to make sure we're using docutils appropriately. Best of both worlds: we have continued assurance we don't regress, and we don't have to maintain a fork/patches. Hi Benji. Fair enough. What about the idea of maintaining a text file in the distribution specific to possible security issues. Is this worth considering for historical purposes so they do not get lost over time or implicitly understood by only a handful of people. Many thanks. Docutils already provides such a document. It's there documenation. Whoever made reST available TTW didn't read it. Providing another document that people won't read won't help the situation. Whenever we reuse 3rd-party code or write, we need be aware of security issues. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
On Jul 19, 2006, at 8:47 AM, Benji York wrote: David Pratt wrote: What about the idea of maintaining a text file in the distribution specific to possible security issues. Is this worth considering for historical purposes so they do not get lost over time or implicitly understood by only a handful of people. Exactly. Any package that needs security-related things verified should have a test (doctest in a text file) describing the problem and verifying that it has been fixed. Of course, that, by itself, doesn't solve the problem. docutils may introduce a new feature in the furture that shouldn't be exposed through the web. Whenever we integrate a new version, we need to review it to make sure there aren't new security issues. This is especially true of anything that is exposed TTW. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Editing a Page on zope.org
On Aug 11, 2006, at 11:34 AM, Philipp von Weitershausen wrote: FB wrote: I wrote some some howtos and receipes about Zope3 and would like a link on http://www.zope.org/DevHome/Wikis/DevSite/Projects/ ComponentArchitecture/FrontPage to point to those pages. I got an account for zope.org, I logged in but I don't know how to edit this page. Is this a permission problem? Yes. This wiki isn't open to everyone with a zope.org account, due to spam problems in the past I believe. Yes, but access is pretty easy to get. Just ask me. :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] "So you've just downloaded Zope 3.3...."
Jeff Shell wrote: ... now what? I just tried moving some work over to Zope 3.3. Already things are blowing up. What do you mean by blowing up? We certainly tried to make 3.3 backward compatible. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] make check [OSX v3.3.0]
Robert Hicks wrote: I get the following error and it is the only one: Error in test checkVerificationInvalidationPersists (ZEO.tests.testConnection.MappingStorageConnectionTests) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/unittest.py", line 260, in run testMethod() File "/usr/local/src/Zope-3.3.0/build/lib.macosx-10.4-fat-2.4/ZEO/tests/ConnectionTests.py", line 534, in checkVerificationInvalidationPersists self._storage = self.openClientStorage('test') File "/usr/local/src/Zope-3.3.0/build/lib.macosx-10.4-fat-2.4/ZEO/tests/ConnectionTests.py", line 186, in openClientStorage realm=realm) File "/usr/local/src/Zope-3.3.0/build/lib.macosx-10.4-fat-2.4/ZEO/ClientStorage.py", line 321, in __init__ self._wait(wait_timeout) File "/usr/local/src/Zope-3.3.0/build/lib.macosx-10.4-fat-2.4/ZEO/ClientStorage.py", line 342, in _wait assert self._connection.is_async() AttributeError: 'NoneType' object has no attribute 'is_async' Is that a big deal? Probably not, butplease submit a collector issue at: http://www.zope.org/Collectors/Zope3-dev Please include information about whether this was a PPC or intel mac and the OS version. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problem with Python 2.4.4
Torvald Bringsvor wrote: I guess this may be a Python problem rather than a zope problem, but I just thought I'd check here. I have set up Zope 3.3.0 with Python 2.4.4, and it didn't quite work. Some operations such as adding a content object provoked an error from cgi.py line 716, this line reads: line = self.fp.readline(1<<16) and then Python reacts that readline should have max one argument, but it gets two. By correcting it to line = self.fp.readline() everything works well. Have anybody else had this problem? You should report this in the Zope 3 collector, http://www.zope.org/Collectors/Zope3-dev. It looks like Zope's file stream object that it passes to the CGI module needs to grow a maximum size. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problem with Python 2.4.4
Marius Gedminas wrote: On Tue, Oct 24, 2006 at 02:00:05PM +0200, Thierry Florac wrote: Le mardi 24 octobre 2006 à 07:51 -0400, Jim Fulton a écrit : Torvald Bringsvor wrote: I have set up Zope 3.3.0 with Python 2.4.4, and it didn't quite work. Some operations such as adding a content object provoked an error from cgi.py line 716, this line reads: line = self.fp.readline(1<<16) and then Python reacts that readline should have max one argument, but it gets two. By correcting it to line = self.fp.readline() everything works well. Have anybody else had this problem? You should report this in the Zope 3 collector, http://www.zope.org/Collectors/Zope3-dev. It looks like Zope's file stream object that it passes to the CGI module needs to grow a maximum size. I had the same problem on Debian GNU/Linux. Problem is due to a security patch applied on "cgi.py" in Debian's unstable release. I've fixed this bug a couple of weeks ago. It was http://www.zope.org/Collectors/Zope3-dev/535 (It's not marked as resolved, because the Zope file stream object discards the maximum size, circumventing the CGI security patch, and that's because Twisted's file stream object doesn't accept a maximum size). I wonder if a newer version of twisted fixes this. I wonder why we aren't using 2.2. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] zope3, site-packages and easy_install
Fred Drake wrote: ... what to do in deployment environment ? - using zope3 deploment with its very own python interpreter - you never now when anyone will add another piece to site-packages Yep. Every deployment gets a private interpreter. The system interpreter can't be trusted since we don't know what patches may be been installed, or what might change in updates applied by a sysadmin. Lets not forget: or what might have been left out by the system packager. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Access to persistent Zope tables/classes in ZODB
Rob J Goedman wrote: I'm wondering if there is an easy way to get to persistent objects created in Zope and stored in ZODB from a python program outside Zope. Yup. As an example, I would like to iterate over created 'buddies' in buddydemo. The easiest way is to use zopectl, which takes care of opening the database(s) and loading the Zope configuration for you. Interactively, use "zopectl debug". This will give you an interactive interpreter with an "app" variable set to the top-level folder. Use "zopectl run " to run a script with the same "app" variable set and ready for use. Of course you can use the lower-level ZODB APIs to open the database yourself. Note that you'll want to use ZEO if you want to open the database while the web application is running. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope3 database activity
Thierry Florac wrote: Zope2 provided a nice tool in his control panel to view database activity (objects loads and stores, cache usage...). Yes. This is wildly useful for improving performance. In many applications, a good way to improve performance is to allocate a larger object cache using more physical memory. (Buying more RAM is a very cost effective hardware upgrade.) Two questions : - is there any way to get access to such information with Zope3 ? Zope3 uses the same ZODB that Zope 2 uses, so the necessary infrastructure is there. No one has written the equivalent UI tool AFAIK. - is it possible with Zope3 to setup cache size ?? Of course, using the same option in the zope.conf file. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Access to persistent Zope tables/classes in ZODB
Rob J Goedman wrote: Thanks Jim, I had gotten to the following point (although you have now shown me a better way to get there, I was using FileStorage): {'Application': , 'zope.app.generations': 0x1377db0>} print f1[0].keys()[1] Rob's buddies print f1[0].values()[1] print f1[0].values()[1].__getitem__ > I don't know what to make of the above without any context. That's fine, because I don't really have time to study any specifics. This is where I get stuck. Been going over the sources to figure out how to iterate over these. Understand that this has nothing to do with ZODB. Whatever application objects you use provide whatever api they do indepenent of ZODB. ... I did notice since I did this, bin/runzope acts differently (on this Zope/ZODB?). Differently than what? In any case, I suggested that you use zopectl. runzope is an internal implementation detail of zopectl. > I created a new instance in 121 and transferred all applications and the new instance works fine: Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$ cd ../121/ Robs-Laptop:~/Projects/Zope/Zope3/121 rob$ runzope -- 2006-10-27T14:45:57 INFO root -- HTTP:localhost:9090 Server started. Hostname: localhost Port: 9090 -- 2006-10-27T14:45:57 INFO root Startup time: 9.072 sec real, 8.710 sec CPU ^C But the old instance in One2One now just seem to test: Robs-Laptop:~/Projects/Zope/Zope3/121 rob$ cd ../One2One/ Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$ runzope -- 2006-10-27T14:47:56 WARNING root Developer mode is enabled: this is a security risk and should NOT be enabled on production servers. Developer mode can be turned off in etc/zope.conf Total: 0 tests, 0 failures, 0 errors Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$ Any idea what causes this? No, I have no context to begin to understand it. I don't know what 121 and One2One are. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] getId in zope3?
Fred Drake wrote: On 11/5/06, Stephan Richter <[EMAIL PROTECTED]> wrote: This is officially an implementation detail; zope.traversing.api.getName() is the API call. Interesting; I'd never known it was anything other than __name__. These APIs just keep changing... No, the APIs haven't changed. It's really a question of best practice and that evolves over time. We created a formal API, getName, because we were queasy about exposing __name__. In practice, there is no other implementation and using __name__ is cleaner in a lot of ways, IMO. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users