Re: [Zope-dev] Subversion externals versus mirroring
On Tue, Sep 15, 2009 at 07:56:42AM -0400, Gary Poster wrote: Generally, I'd be surprised to learn that Bzr/Launchpad were alone in supporting this, but they are the only ones I can vouch for. For instance, I'm almost positive that github also allows you to have multiple committers to a single branch, though I don't remember the mechanism. bitbucket and github both support this, yes. (And thus presumably any repository running mercurial or git, though I don't know how to admin them.) -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] maintaining session variables using zeocluster
On Mon, Sep 14, 2009 at 11:39:56AM -0400, Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 nair rajiv wrote: Hellol, We are using a zeocluster with six clients and use pound for load balancing betwwen them. However I am having problems using session variables. I think that session variables are maintained separately for each client i.e a value set to sesssion variable when pound sends a request to one client cannot be retreived when a request is sent to some other client. What can be done in such a situation ? You can either: - Mount the session storage over ZEO (google zeo session storage). - Use a non-ZODB-based sessioning implementation, e.g. the one in mcdutils: http://agendaless.com/Members/tseaver/software/mcdutils/ Or configure Pound for session affinity - send all requests for the same session to the same back-end server. Read the Sessions section of http://www.apsis.ch/pound/ The problem with this approach is that it tends to reduce the effectiveness of load-balancing. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Question about ZSyncer
That is supposed to work, if you enable the relative paths option. In fact, that was how I did most of my testing when I added that feature. But I don't work on ZSyncer at all anymore. If it doesn't work, I can't really help. - PW On Wed, Jul 22, 2009 at 6:20 AM, Ajay Deshpanderiffenst...@gmail.com wrote: Hi All: I would like to know if the ZSyncer product can sync data between two DBs on the same instance rather than two instances themselves. Any help is greatly appreciated. TIA, R -- And the trees are all kept equal By hatchet, axe, and saw ___ Zope maillist - z...@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZSyncer fails to do authenticate under Zope 2.11
Nobody (including me) is maintaining ZSyncer at all. I'll take this opportunity to once again call for volunteers to take up the reins... anybody care enough about ZSyncer to maintain it? - Paul On Wed, Jul 15, 2009 at 06:01:58PM -0700, Dennis Allison wrote: I am getting 401 errors with ZSyncer-0.7.1 using a configuration which worked with Zope 2.9 and an earler version of the ZSyncer product. Both use Python 2.4. Has anyone seen this problem? Can you recommend a fix? Is the CVS version of ZSyncer on Sourceforge a better choice? -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZSyncer fails to do authenticate under Zope 2.11
No, sorry, I have never tried to run it with Zope later than 2.9 and I have zero time to experiment with it. - PW On Thu, Jul 16, 2009 at 09:26:20AM -0600, Dennis Allison wrote: Pleas for assistance aside, any ideas as to what might be broken? We depend upon this Product in our development process. On Thu, Jul 16, 2009 at 8:37 AM, Paul Winkler sli...@gmail.com wrote: Nobody (including me) is maintaining ZSyncer at all. I'll take this opportunity to once again call for volunteers to take up the reins... anybody care enough about ZSyncer to maintain it? - Paul On Wed, Jul 15, 2009 at 06:01:58PM -0700, Dennis Allison wrote: I am getting 401 errors with ZSyncer-0.7.1 using a configuration which worked with Zope 2.9 and an earler version of the ZSyncer product. Both use Python 2.4. Has anyone seen this problem? Can you recommend a fix? Is the CVS version of ZSyncer on Sourceforge a better choice? -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] [Checkins] SVN: zope.app.http/trunk/ - Replacedthedependency on zope.deprecation with BBB imports
On Wed, May 27, 2009 at 02:06:03PM +0200, Roger Ineichen wrote: I think there is something else wrong if someone is using code with deprecation warnings in a production setup. Do you not use any third-party code? Often, the deprecation warnings are emitted by code not under your control. - PW -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Why does restrictedTraverse() in Zope 2 not respect IPublishTraverse adapters?
On Thu, May 14, 2009 at 10:55:40PM +0200, Laurence Rowe wrote: For maximum portability across Z2 / Z3 / BFG, you could just do the same thing and implement __getitem__ on any object you want to be traversable by either the publisher or APIs like (un)restrictedTraverse, and forego the over-complicated component-laden traversal dance. ;) Minimal example demonstrating this with a view in zope2: from zope.component import getSiteManager from Testing.makerequest import makerequest from zope.publisher.browser import IBrowserView from Acquisition import Explicit from zope.component import getSiteManager app = makerequest(app) smgr = getSiteManager() class Foo(Explicit): ... def __init__(self, context, request): ... self.context, self.request = context, request ... def __getitem__(self, key): ... return int(key) ... smgr.registerAdapter(Foo, (None, IRequest), IBrowserView, name='foo') app.unrestrictedTraverse('@@foo/12345') 12345 Thanks for reminding me of this. I keep forgetting that this works! I only add that if you want to use __getitem__ for publishing, the items you return should inherit from Acquisition.(Im|Ex)plicit to make the security machinery happy. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZTK futures: one big package?
On Tue, May 12, 2009 at 03:08:05AM -0400, Chris McDonough wrote: Once we deflate our current set of packages down to a reasonable number, the packages listed in PyPI will immediately start to reflect the state of reality right now. As a result, we'll hopefully be able to get some new blood in the form of new developers that use the smaller bits outside Zope to help us tease the truly independent pieces out of the larger pile. If we do this, at no time after the deflation will PyPI listings ever as badly advertise the state of reality as it is advertised right now, and the community will hopefully again start to grow. I agree with a lot of what you wrote, but I don't understand this last bit. All the currently released packages will continue to live on pypi more or less forever, no? To paraphrase a wise man, Releasing a package means always having to say you're sorry ;-) -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZTK futures: one big package?
On Tue, May 12, 2009 at 12:36:06PM -0400, Chris McDonough wrote: On 5/12/09 12:27 PM, Paul Winkler wrote: I agree with a lot of what you wrote, but I don't understand this last bit. All the currently released packages will continue to live on pypi more or less forever, no? To paraphrase a wise man, Releasing a package means always having to say you're sorry ;-) I don't think so. People would need to change their code to depend on the big package, and the smaller packages would cease to have a life of their own. Having both the smaller packages and some bigger package that also contains it and needing to maintain both truly would be the worst of all possible worlds. I must be dense today because I still don't understand what cease to have a life means. Remove them from pypi? How would you avoid breaking all the current software in the world that currently depends on all those distributions? -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] trying out the buildout-based Zope 2.12...
On Sun, Mar 29, 2009 at 11:47:14AM -0400, Jim Fulton wrote: I think an implementation of a better dependency resolution strategy in buildout would be a good place to start. I think some limited backtracking could go a long way. Anyone interested in working on this? Ian's Pip tool tries to download everything and work out the complete graph before doing any installation; I've no idea if any of that work could be ported to buildout, but it might be worth a look? https://svn.openplans.org/svn/pip/ (If you guys are both still at Pycon, might be worth a face-to-face chat...) -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] trying out the buildout-based Zope 2.12...
On Mon, Mar 30, 2009 at 12:29:16PM -0400, Jim Fulton wrote: On Mar 30, 2009, at 12:08 PM, Paul Winkler wrote: Ian's Pip tool tries to download everything and work out the complete graph before doing any installation; I've no idea if any of that work could be ported to buildout, but it might be worth a look? https://svn.openplans.org/svn/pip/ But this is about determining the complete graph. I don't understand. What did I say that wasn't relevant to that? -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Touching an object / updating the modification time
On Sat, Mar 28, 2009 at 01:02:58PM +0100, Jakob Schou Jensen wrote: Hi Paul, Doing a some_image._p_changed = 1 gives me an error: _p_changed is an invalid attribute name because it starts with _. Do you know what I am doing wrong? Ah, I didn't realize you are doing this in untrusted code. http://docs.zope.org/zope2/zope2book/source/ScriptingZope.html#script-security Another approach would be to just change any (small) attribute of the object. Something like: some_image.title = some_image.title -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] trying out the buildout-based Zope 2.12...
On Fri, Mar 27, 2009 at 04:27:31PM -0500, Chris Withers wrote: Andreas Jung wrote: One last hint: you might try using 'pip' (instead of 'easy_install'). 'pip -v' gives you better information about the dependencies pulled in and where (but it does not tell you why - at least not obviously). Engage brain ;-) I'm not using easy_install, I'm using buildout... (yeah, I know buildout uses easy_install, but...) One possibility: try using http://pypi.python.org/pypi/gp.recipe.pip ? -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] trying out the buildout-based Zope 2.12...
On Fri, Mar 27, 2009 at 04:34:43PM -0500, Chris Withers wrote: Paul Winkler wrote: I'm not using easy_install, I'm using buildout... (yeah, I know buildout uses easy_install, but...) One possibility: try using http://pypi.python.org/pypi/gp.recipe.pip ? I need to be totally upfront about this: I'm interested in finding out why something that *should* work is broken. I worry that there's something not quite right in buildout that's causing that, and that's something I'd like to fix... I'm NOT interested in working around the problem, specifically by trying out weird'n'whacky recipes... Well, yeah. The point of the suggestion was specifically to help you get more info about the dependency chain, since pip is more verbose about that than easy_install is. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Touching an object / updating the modification time
On Fri, Mar 27, 2009 at 07:53:33AM -0500, Andreas Jung wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27.03.2009 7:40 Uhr, Jakob Schou Jensen wrote: Is it possible to update the modification time of an object (in this case an Image object)? The modification date is stored as 'bobobase_modification_date' attribute (DateTime instance). Note though that you can't set it to an arbitrary value, because the ZODB will set it to the current time when the transaction commits. If that's all you want, it's sufficient to do something like: some_image._p_changed = 1 (and then, if you're running in eg. a zopectl debug prompt, import transaction; transaction.commit()) -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Translations for zope packages.
On Tue, Feb 10, 2009 at 01:54:54PM +0100, Martijn Faassen wrote: In my mind, the Zope framework should offer facilities to support translating applications. These applications can be composed out of more than a single package, and we want to support the translation memory usecase for that. If the Zope framework defines messages itself itself, it should offer a way for an application that exposes them to have translations as well. IMO it must also be possible for an application integrator to install a package that selectively overrides the default translations. How can that be done? At TOPP, when we used Plone 2 and PTS, we had a hack that allowed us to do this, see eg. https://svn.openplans.org/svn/sputnik/branches/0.9.8/sputnik/zinit.py This allowed us to provide some different (english) translations for the same message ids on two websites (openplans.org and livablestreets.com), just by having the sputnik package installed on one site. So far, I've been unable to find a way to accomplish the same thing with the zope 3 i18n infrastructure, which is blocking us from moving to plone 3 on the site that needs the overrides. Is this even possible? -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Storing unicode in ZODB objects
On Mon, Dec 15, 2008 at 03:52:35PM -0500, Thibaud Morel l'Horset wrote: That's a great tip about setting the content_type charset correctly. The way I was handling this so far was to specify it in the header of the page that was displaying the text: span tal:content=nocall:python:request.response.setHeader('Content-Type','text/html; charset=UTF-8') tal:omit-tag=/span On a stylistic tangent: combining nocall with python doesn't make any sense, and I don't believe it has any effect. Nocall's purpose is to prevent implicitly calling the object traversed at the end of a *path* expression. Also, don't use tal:content when you don't actually want to insert the result of the expression. The most common idiom I've seen when calling something purely for side effects is to abuse tal:define: span tal:define=dummy python:request.response.setHeader(...) tal:omit-tag= / Or, better, put the define in a tag that actually serves a purpose and you can leave out the omit-tag as well: head tal:define=dummy python:... ... /head -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] TraversalError in custom TALES namespace during Five tests
I've implemented a custom TALES namespace that works fine when tested in the browser, but blows up in doctests. Anybody seen behavior like this? It appears that during the test, my adapter is looked up fine, but later when we try to traverse to the method, we end up with a zope.security._proxy._Proxy wrapper that hides the existence of my methods. Just to reiterate, the same code *works fine* when running Zope for real, and I only see this failure during tests. Here's the tail end of a test / pdb session: 41 def traverse(self, name, furtherPath): 42 - subject = self._subject 43 __traceback_info__ = (subject, name, furtherPath) 44 attr = getattr(subject, name, _marker) 45 if attr is not _marker: 46 return attr 47 if hasattr(subject, '__getitem__'): (Pdb) n /home/pw/builds/slinktopp.openplans.org/builds/20081210/opencore/lib/zope/lib/python/zope/traversing/adapters.py(43)traverse() - __traceback_info__ = (subject, name, furtherPath) (Pdb) n /home/pw/builds/slinktopp.openplans.org/builds/20081210/opencore/lib/zope/lib/python/zope/traversing/adapters.py(44)traverse() - attr = getattr(subject, name, _marker) (Pdb) p subject opencore.tales.utils.OpencoreTales object at 0x9840510 (Pdb) p name 'member_title' (Pdb) p subject.member_title *** AttributeError: exceptions.AttributeError instance at 0x8a02518 This appears to indicate that the OpencoreTales instance itself is fine, but the security wrapper is preventing attribute access. And here's my zcml: adapter for=* provides=zope.traversing.interfaces.IPathAdapter factory=.utils.OpencoreTales name=opencore trusted=true / content class=.utils.OpencoreTales require permission=zope2.View attributes=setEngine pretty_date project_noun member_title / /content And here's the relevant part of the implementation: class OpencoreTales(object): component.adapts(interface.Interface) interface.implements(IPathAdapter) def __init__(self, context): import pdb; pdb.set_trace() self.context = context def member_title(self): return member_title(self.context) ... Thanks for any advice, - Paul Winkler -- http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: Zope/trunk/ Simpler, faster implementation of DocumentTemplate.DT_Var.newline_to_br(), with tests.
Log message for revision 93099: Simpler, faster implementation of DocumentTemplate.DT_Var.newline_to_br(), with tests. Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/DocumentTemplate/DT_Var.py A Zope/trunk/lib/python/DocumentTemplate/tests/test_DT_Var.py -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2008-11-18 20:15:21 UTC (rev 93098) +++ Zope/trunk/doc/CHANGES.txt 2008-11-18 20:27:52 UTC (rev 93099) @@ -520,6 +520,9 @@ - Added lib/python/webdav/litmus-results.txt explaining current test results from the litmus WebDAV torture test. + - DocumentTemplate.DT_Var.newline_to_br(): Simpler, faster implementation. + + Zope 2.10.0 beta 1 (2006/05/30) Restructuring Modified: Zope/trunk/lib/python/DocumentTemplate/DT_Var.py === --- Zope/trunk/lib/python/DocumentTemplate/DT_Var.py2008-11-18 20:15:21 UTC (rev 93098) +++ Zope/trunk/lib/python/DocumentTemplate/DT_Var.py2008-11-18 20:27:52 UTC (rev 93099) @@ -358,8 +358,8 @@ # quoted later on anyway. if isinstance(v, TaintedString): v = v.quoted() v=ustr(v) -if v.find('\r') = 0: v=''.join(v.split('\r')) -if v.find('\n') = 0: v='br /\n'.join(v.split('\n')) +v = v.replace('\r', '') +v = v.replace('\n', 'br /\n') return v def whole_dollars(v, name='(Unknown name)', md={}): Added: Zope/trunk/lib/python/DocumentTemplate/tests/test_DT_Var.py === --- Zope/trunk/lib/python/DocumentTemplate/tests/test_DT_Var.py (rev 0) +++ Zope/trunk/lib/python/DocumentTemplate/tests/test_DT_Var.py 2008-11-18 20:27:52 UTC (rev 93099) @@ -0,0 +1,70 @@ +## +# +# Copyright (c) 2008 Zope Corporation and Contributors. All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +## +Tests for functions and classes in DT_Var. + +$Id$ + + +import unittest, doctest +from DocumentTemplate import DT_Var + +class TestNewlineToBr(doctest.DocTestCase): + +def test_newline_to_br(self): +r +newline_to_br should work identically with either DOS-style or +Unix-style newlines. + + text = ''' +... line one +... line two +... +... line three +... ''' + print DT_Var.newline_to_br(text) +br / +line onebr / +line twobr / +br / +line threebr / +BLANKLINE + + dos = text.replace('\n', '\r\n') + DT_Var.newline_to_br(text) == DT_Var.newline_to_br(dos) +True + + + +def test_newline_to_br_tainted(self): + + text = ''' +... liline one/li +... liline two/li +... ''' + from ZPublisher.TaintedString import TaintedString + tainted = TaintedString(text) + print DT_Var.newline_to_br(tainted) +br / +lt;ligt;line onelt;/ligt;br / +lt;ligt;line twolt;/ligt;br / +BLANKLINE + + + +def test_suite(): +suite = unittest.TestSuite() +suite.addTest(doctest.DocTestSuite()) +return suite + +if __name__ == '__main__': +unittest.main(defaultTest='test_suite') Property changes on: Zope/trunk/lib/python/DocumentTemplate/tests/test_DT_Var.py ___ Added: svn:keywords + Author Date Revision ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope] Displaying PIL Images in Zope Templates
On Thu, Sep 18, 2008 at 08:22:37AM +0200, Nico Grubert wrote: The span renders PIL.Image.Image instance at 0x23b97500. How can I show the image? Call its tag method. span tal:replace=structure item/tag / Hi Paul, how is the susi going? ;-) Ah, I sold mine years ago. Nowadays I mostly just play bass. And you? :) I tried span tal:replace=structure item/tag / but I get the following error: --- Exception TypeTraversalError Exception Value (PIL.Image.Image instance at 0x18e84ad0, 'tag') Whoops, sorry, I didn't realize these were PIL images, I thought they were OFS.Image or some such. But I see you already got the solution. - PW -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Security for objects being called
On Tue, Sep 16, 2008 at 08:55:33AM -0400, Thibaud Morel l'Horset wrote: Thanks for the response Paul. I don't see a Proxy tab on Page Templates though, only DTML methods: do I need to install an additional product for that? or is it configured somewhere else for Templates? Oops, right you are. Templates don't have proxy roles. One obvious workaround: Add a dtml method that consists only of dtml-var test. Make this dtml method anonymously viewable, and give it a proxy role of Authenticated. Then make your real template, and the script it calls, both viewable only by Authenticated. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] documentation for ZCatalog apart from the Zope Book?
On Tue, Sep 16, 2008 at 07:45:45PM +0100, michael nt milne wrote: Hi Is there any in-depth documentation anywhere on the Zope search facility the ZCatalog, how to build indexes and access these. I find that the Zope Book online is ok but not quite enough to really get to grips with it. I assume you are looking at the last version, http://plope.com/Books/2_7Edition/SearchingZCatalog.stx Other than that, there's some .txt files in the source that you might look at. Not sure how helpful they will be, but it's worth a look. Look under lib/python/Products/ZCatalog/ and lib/python/Products/PluginIndexes. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Displaying PIL Images in Zope Templates
On Wed, Sep 17, 2008 at 03:01:55PM +0200, Nico Grubert wrote: Hi there Is it possible to show several PIL.Image.Image instances in a Zope Page without creating a temporary Zope image object? I have an external method that creates a list of PIL.Image.Image instances, e.g. [PIL.Image.Image instance at 0x711fc60, PIL.Image.Image instance at 0x711fc70 ] How can I display all images in a Zope page template? I tried tal:rep tal:repeat=item span tal:replace=item / /tal:rep The span renders PIL.Image.Image instance at 0x23b97500. How can I show the image? Call its tag method. span tal:replace=structure item/tag / -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Security for objects being called
On Mon, Sep 15, 2008 at 07:44:58PM -0400, Thibaud Morel l'Horset wrote: Hello all, I'm trying to figure out how to prevent certain zope objects from being called directly but allow them to be called from another object. Here is an example: You have a ZPT page, let's originally call it 'test' test calls a Script(Python) 'script' I want any anonymous user to be able to call 'test' from the web but not 'script'. However, I want 'test' to call 'script' and render the contents of 'script' to anonymous users through 'test'. I tested this out by making the 'script' View permission only available for Authenticated users, and as anonymous I can neither hit 'test' nor 'script'. Based on my understanding of the Zope security framework I don't think this is possible... hopefully someone can tell me I'm wrong though and show me how to do it :) http://plope.com/Books/2_7Edition/Security.stx#2-62 -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] script calling template
On Wed, Sep 10, 2008 at 07:57:29PM -0700, David Bear wrote: I have a script that calls a template. The template has a tal expressions like this p tal:content=structure here/ploneDoc/getText /p I want my script to call the template in such a way that the string 'ploneDoc' is replaced by a different string. I'm not sure how to go about parameterizing a tales expressions like this. It is possible, by sticking a question mark in front of ploneDoc; but afaict you can only use a variable already in the namespace, i.e. you'd have to define it first. Like so: p tal:define=docname options/ploneDoc tal:content=structure here/?docname/getText /p But I have literally never seen this obscure feature in real use, because nobody seems to know about it (I had forgotten it myself), and because it's not necessary. I'd prefer to have the script just pass in the object you want, as per this document: http://plope.com/Books/2_7Edition/BasicScripting.stx#1-3 So, in your script, something like: doc = context.restrictedTraverse(some_path) return context.mytemplate(mydoc=doc) Then, in your template just do: p tal:content=structure options/mydoc/getText/p -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: Zope/trunk/ Fix for launchpad #267545: DateTime(DateTime()) should preserve the correct hour
Log message for revision 90920: Fix for launchpad #267545: DateTime(DateTime()) should preserve the correct hour Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/DateTime/DateTime.py U Zope/trunk/lib/python/DateTime/tests/testDateTime.py -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2008-09-07 02:49:58 UTC (rev 90919) +++ Zope/trunk/doc/CHANGES.txt 2008-09-07 19:50:10 UTC (rev 90920) @@ -207,6 +207,9 @@ Bugs Fixed + - Launchpad #267545: DateTime(DateTime()) now preserves the +correct hour + - Launchpad #262313: respect the 'Expand macros when editing' flag when editing a page template through the ZMI Modified: Zope/trunk/lib/python/DateTime/DateTime.py === --- Zope/trunk/lib/python/DateTime/DateTime.py 2008-09-07 02:49:58 UTC (rev 90919) +++ Zope/trunk/lib/python/DateTime/DateTime.py 2008-09-07 19:50:10 UTC (rev 90920) @@ -586,11 +586,8 @@ DateTime instance. t = arg.timeTime() -tz = arg.timezone() -ms = (t - math.floor(t)) s,d = _calcSD(t) -yr,mo,dy,hr,mn,sc = gmtime(t)[:6] -sc = sc + ms +yr,mo,dy,hr,mn,sc,tz = arg.parts() elif isinstance(arg, datetime): yr,mo,dy,hr,mn,sc,numerictz,tznaive=self._parse_iso8601_preserving_tznaive(arg.isoformat()) Modified: Zope/trunk/lib/python/DateTime/tests/testDateTime.py === --- Zope/trunk/lib/python/DateTime/tests/testDateTime.py2008-09-07 02:49:58 UTC (rev 90919) +++ Zope/trunk/lib/python/DateTime/tests/testDateTime.py2008-09-07 19:50:10 UTC (rev 90920) @@ -401,8 +401,10 @@ def testCopyConstructor(self): d = DateTime('2004/04/04') self.assertEqual(DateTime(d), d) -d = DateTime('1999/04/12') -self.assertEqual(DateTime(d), d) +self.assertEqual(str(DateTime(d)), str(d)) +d2 = DateTime('1999/04/12 01:00:00') +self.assertEqual(DateTime(d2), d2) +self.assertEqual(str(DateTime(d2)), str(d2)) def testCopyConstructorPreservesTimezone(self): # test for https://bugs.launchpad.net/zope2/+bug/27 @@ -413,8 +415,10 @@ self.assertEqual(DateTime(d).timezone(), d.timezone()) d2 = DateTime('2008/04/25 12:00:00 EST') self.assertEqual(DateTime(d2).timezone(), d2.timezone()) +self.assertEqual(str(DateTime(d2)), str(d2)) d3 = DateTime('2008/04/25 12:00:00 PST') self.assertEqual(DateTime(d3).timezone(), d3.timezone()) +self.assertEqual(str(DateTime(d3)), str(d3)) def testRFC822(self): ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.11/ Fix for launchpad #267545: DateTime(DateTime()) should preserve the correct hour
Log message for revision 90921: Fix for launchpad #267545: DateTime(DateTime()) should preserve the correct hour Changed: U Zope/branches/2.11/doc/CHANGES.txt U Zope/branches/2.11/lib/python/DateTime/DateTime.py U Zope/branches/2.11/lib/python/DateTime/tests/testDateTime.py -=- Modified: Zope/branches/2.11/doc/CHANGES.txt === --- Zope/branches/2.11/doc/CHANGES.txt 2008-09-07 19:50:10 UTC (rev 90920) +++ Zope/branches/2.11/doc/CHANGES.txt 2008-09-07 19:51:10 UTC (rev 90921) @@ -16,6 +16,9 @@ - integrated Hotfix-2008-08-12 + - Launchpad #267545: DateTime(DateTime()) now preserves the +correct hour + - Launchpad #262313: respect the 'Expand macros when editing' flag when editing a page template through the ZMI Modified: Zope/branches/2.11/lib/python/DateTime/DateTime.py === --- Zope/branches/2.11/lib/python/DateTime/DateTime.py 2008-09-07 19:50:10 UTC (rev 90920) +++ Zope/branches/2.11/lib/python/DateTime/DateTime.py 2008-09-07 19:51:10 UTC (rev 90921) @@ -586,11 +586,8 @@ DateTime instance. t = arg.timeTime() -tz = arg.timezone() -ms = (t - math.floor(t)) s,d = _calcSD(t) -yr,mo,dy,hr,mn,sc = gmtime(t)[:6] -sc = sc + ms +yr,mo,dy,hr,mn,sc,tz = arg.parts() elif isinstance(arg, datetime): yr,mo,dy,hr,mn,sc,numerictz,tznaive=self._parse_iso8601_preserving_tznaive(arg.isoformat()) Modified: Zope/branches/2.11/lib/python/DateTime/tests/testDateTime.py === --- Zope/branches/2.11/lib/python/DateTime/tests/testDateTime.py 2008-09-07 19:50:10 UTC (rev 90920) +++ Zope/branches/2.11/lib/python/DateTime/tests/testDateTime.py 2008-09-07 19:51:10 UTC (rev 90921) @@ -401,8 +401,10 @@ def testCopyConstructor(self): d = DateTime('2004/04/04') self.assertEqual(DateTime(d), d) -d = DateTime('1999/04/12') -self.assertEqual(DateTime(d), d) +self.assertEqual(str(DateTime(d)), str(d)) +d2 = DateTime('1999/04/12 01:00:00') +self.assertEqual(DateTime(d2), d2) +self.assertEqual(str(DateTime(d2)), str(d2)) def testCopyConstructorPreservesTimezone(self): # test for https://bugs.launchpad.net/zope2/+bug/27 @@ -413,8 +415,10 @@ self.assertEqual(DateTime(d).timezone(), d.timezone()) d2 = DateTime('2008/04/25 12:00:00 EST') self.assertEqual(DateTime(d2).timezone(), d2.timezone()) +self.assertEqual(str(DateTime(d2)), str(d2)) d3 = DateTime('2008/04/25 12:00:00 PST') self.assertEqual(DateTime(d3).timezone(), d3.timezone()) +self.assertEqual(str(DateTime(d3)), str(d3)) def testRFC822(self): ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/ Fix for launchpad #267545: DateTime(DateTime()) should preserve the correct hour
Log message for revision 90922: Fix for launchpad #267545: DateTime(DateTime()) should preserve the correct hour Changed: U Zope/branches/2.10/doc/CHANGES.txt U Zope/branches/2.10/lib/python/DateTime/DateTime.py U Zope/branches/2.10/lib/python/DateTime/tests/testDateTime.py -=- Modified: Zope/branches/2.10/doc/CHANGES.txt === --- Zope/branches/2.10/doc/CHANGES.txt 2008-09-07 19:51:10 UTC (rev 90921) +++ Zope/branches/2.10/doc/CHANGES.txt 2008-09-07 19:52:37 UTC (rev 90922) @@ -24,6 +24,9 @@ - integrated Hotfix-2008-08-12 + - Launchpad #267545: DateTime(DateTime()) now preserves the +correct hour + - Launchpad #262313: respect the 'Expand macros when editing' flag when editing a page template through the ZMI Modified: Zope/branches/2.10/lib/python/DateTime/DateTime.py === --- Zope/branches/2.10/lib/python/DateTime/DateTime.py 2008-09-07 19:51:10 UTC (rev 90921) +++ Zope/branches/2.10/lib/python/DateTime/DateTime.py 2008-09-07 19:52:37 UTC (rev 90922) @@ -704,11 +704,8 @@ if isinstance(arg, DateTime): Construct a new DateTime instance from a given DateTime instance t = arg.timeTime() -tz = arg.timezone() -ms = (t - math.floor(t)) s,d = _calcSD(t) -yr,mo,dy,hr,mn,sc = gmtime(t)[:6] -sc = sc + ms +yr,mo,dy,hr,mn,sc,tz = arg.parts() elif isinstance(arg, (unicode, str)) and arg.lower() in self._tzinfo._zidx: # Current time, to be displayed in specified timezone Modified: Zope/branches/2.10/lib/python/DateTime/tests/testDateTime.py === --- Zope/branches/2.10/lib/python/DateTime/tests/testDateTime.py 2008-09-07 19:51:10 UTC (rev 90921) +++ Zope/branches/2.10/lib/python/DateTime/tests/testDateTime.py 2008-09-07 19:52:37 UTC (rev 90922) @@ -296,8 +296,10 @@ def testCopyConstructor(self): d = DateTime('2004/04/04') self.assertEqual(DateTime(d), d) -d = DateTime('1999/04/12') -self.assertEqual(DateTime(d), d) +self.assertEqual(str(DateTime(d)), str(d)) +d2 = DateTime('1999/04/12 01:00:00') +self.assertEqual(DateTime(d2), d2) +self.assertEqual(str(DateTime(d2)), str(d2)) def testCopyConstructorPreservesTimezone(self): # test for https://bugs.launchpad.net/zope2/+bug/27 @@ -308,8 +310,10 @@ self.assertEqual(DateTime(d).timezone(), d.timezone()) d2 = DateTime('2008/04/25 12:00:00 EST') self.assertEqual(DateTime(d2).timezone(), d2.timezone()) +self.assertEqual(str(DateTime(d2)), str(d2)) d3 = DateTime('2008/04/25 12:00:00 PST') self.assertEqual(DateTime(d3).timezone(), d3.timezone()) +self.assertEqual(str(DateTime(d3)), str(d3)) def testRFC822(self): ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope] TAL conditional expression
On Fri, Sep 05, 2008 at 01:05:23PM -0700, David Bear wrote: Also, I would like to be able to use the same request object in both my template and the macro, but my macro doesn's seem to have access to the same request object. It is the same request. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] manage_cutObjects/manage_pasteObjects problem ...
Just a quick note: On Fri, Jul 25, 2008 at 03:20:23PM +0200, Giampiero Benvenuti wrote: I think the problem is your 4th line: copy_info = obj_parent.manage_cutObjects((context.getId())) copy_info should be the object you want to cut it should be something like this: ... src=context.your_cut_context[obj_id] context.your_cut_context.manage_cutObjects([src]) dst=context.your_paste_context dst.manage_pasteObjects(src) Sorry Giampiero, you're just guessing, and you're guessing wrong. The original poster's code was correct*. Dieter's suggestion is a better approach to troubleshoot this problem. *well, almost correct. There's a common Python mistake on one line: copy_info = obj_parent.manage_cutObjects((context.getId())) You think you're creating a tuple there, but you're not. To create a tuple of size 1, you need a trailing comma: copy_info = obj_parent.manage_cutObjects((context.getId(),)) But that's not causing your problem; manage_cutObjects() helpfully wraps a string argument in a tuple for you. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Problems with buildout and zope.interface
On Fri, Jul 25, 2008 at 02:53:55PM +0200, Christian Scholz wrote: So my main question is probably: Is there a way to automate the process of installing and running virtualenv similar to what bootstrap.py does for buildout so that people do not need to care about the virtualenv part? Yes, you can write a custom virtualenv bootstrap script as documented here: http://pypi.python.org/pypi/virtualenv#creating-your-own-bootstrap-scripts You can then distribute just your bootstrap script, and all somebody has to do is download and run it (assuming they have python). The bootstrapper will then fetch and run virtualenv, install easy_install into the virtualenv, and do anything else you put in your bootstrapper. Personally I've never tried combining virtualenv and buildout. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Deployment Best Practices?
On Sun, Jul 13, 2008 at 01:20:53PM -0400, Philipp von Weitershausen wrote: Jeff McNeil wrote: I'd love to be able to just drop an egg on the file system and tell Zope Here, go load that one now via configuration alone. You could also write your own ZCML directive (+ a handler) that does that. Then you'd only ever have to change your application's site.zcml to load a new plugin. There's also this: http://pypi.python.org/pypi/z3c.autoinclude -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] transaction.doom() and ZPublisher
Hi, I noticed that Zope 2.11 includes a recent version of the transaction module including the transaction.doom() method. But I don't see any check for it in ZPublisher. So, if any code calls transaction.doom(), the publisher will raise a user-visible exception when it tries to call commit(). This seems less than useful :-) In the discussion I've seen of this method, eg. https://bugs.launchpad.net/zope3/+bug/98382 and http://markmail.org/message/3yshpmltvhevnrff it sounds like other people share my expectation... namely, that the developer should not have to do anything special after calling transaction.doom(); the transaction is not committed, and the user won't see an exception. Is that the concensus? If so, there's an easy solution - apply something like the attached patch. Anybody disagree? -- Paul Winkler http://www.slinkp.com --- Zope2/App/startup.py~ 2008-06-14 02:50:23.0 -0400 +++ Zope2/App/startup.py2008-07-10 00:08:02.0 -0400 @@ -267,7 +267,8 @@ transaction.begin() def commit(self): -transaction.commit() +if not transaction.isDoomed(): +transaction.commit() def abort(self): transaction.abort() --- ZPublisher/Publish.py~ 2008-06-14 02:50:48.0 -0400 +++ ZPublisher/Publish.py 2008-07-10 00:08:08.0 -0400 @@ -314,7 +314,8 @@ def begin(self): transaction.begin() def commit(self): -transaction.commit() +if not transaction.get().isDoomed(): +transaction.commit() def abort(self): transaction.abort() def recordMetaData(self, object, request): --- ZPublisher/WSGIPublisher.py~2008-06-14 02:50:48.0 -0400 +++ ZPublisher/WSGIPublisher.py 2008-07-09 23:59:57.0 -0400 @@ -401,7 +401,8 @@ def begin(self): transaction.begin() def commit(self): -transaction.commit() +if not transaction.get().isDoomed(): +transaction.commit() def abort(self): transaction.abort() def recordMetaData(self, object, request): ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Re: Cache
On Wed, Jun 25, 2008 at 07:12:53PM +0100, Miles wrote: Kereoz wrote: On Wed, Jun 25, 2008 at 1:13 PM, Andreas Jung [EMAIL PROTECTED] wrote: As you can see from the HTML code: something like app.Control_Panel.Database.name of storage.manage_minimize() should work. I was thinking about the zope command line tools such as zopectl or so. I don't think doing it in zopectl will do what you want. AFAIK, the cache that method minimizes is the in-memory object cache. zopectl runs in a separate process, which will have its own cache; so calling manage_minimize() in a zopectl script will not affect the running Zope server. Instead you could write a script that uses wget or python's httplib or similar to connect to the running Zope server and send the same request that submitting the form in the ZMI would send. None of this has anything to do with caches on disk, so I may be misunderstanding what you want. The only disk cache I know of that's relevant to ZODB is the ZEO client cache, which I don't believe is affected by manage_minimize(). I don't think there is any API for cleaning stuff out of it. You could also use something like $ PYTHONPATH=/usr/local/Zope-2.9.6/lib/python /usr/local/Zope-2.9.6/bin/zeopack.py -p $PORT -S $STORAGE -d $PACKDAYS That's for packing the storage, which is totally different. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Call for new ZSyncer maintainer
Hi folks, ZSyncer (http://sourceforge.net/projects/zsyncer) is in need of a new maintainer. Once in a while I get a question about ZSyncer. Sadly I have to face the fact that I have not been actively maintaining it for quite some time: I haven't used ZSyncer at all for over a year, have made no commits in that time, and no releases for over two years. So, while I'd be happy to do some paid work on ZSyncer if your employer really needs something done, I've clearly abdicated my leading role in ZSyncer's community (is there one?). Anybody care enough about it to step up? If so, contact me off-list. I would be happy to provide support during a transitional period. Summary of current status: * There are several fixes in CVS that should probably be released as 0.7.2, but I'm not sure if they're adequately tested. * Tests pass under zope 2.9; untested with 2.10 or trunk. * The code is, in my opinion, badly in need of refactoring and cleaning up. * There is a suite of ZopeTestCase tests. Should probably be broken up into smaller cases. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/PageTemplates/PageTemplateFile.py Merge r41209 from trunk (use proper call signature for logging, not zLOG)
Log message for revision 87132: Merge r41209 from trunk (use proper call signature for logging, not zLOG) Changed: U Zope/branches/2.9/lib/python/Products/PageTemplates/PageTemplateFile.py -=- Modified: Zope/branches/2.9/lib/python/Products/PageTemplates/PageTemplateFile.py === --- Zope/branches/2.9/lib/python/Products/PageTemplates/PageTemplateFile.py 2008-06-03 17:42:05 UTC (rev 87131) +++ Zope/branches/2.9/lib/python/Products/PageTemplates/PageTemplateFile.py 2008-06-03 22:15:18 UTC (rev 87132) @@ -149,7 +149,7 @@ self.pt_edit(text, t) self._cook() if self._v_errors: -LOG.error('Error in template', '\n'.join(self._v_errors)) +LOG.error('Error in template %s' % '\n'.join(self._v_errors)) return self._v_last_read = mtime ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope] Re: zope-memory-readings
On Fri, May 30, 2008 at 3:56 PM, Tres Seaver [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter Bengtsson wrote: Check it out http://code.google.com/p/zope-memory-readings/ Perhaps useful Looks really cool. Thanks for releasing it! Yeah. It also looks nicely non-zope-specific. All it really needs to do its job is a PID and a log file in apache's common format. The only zope-specific stuff is just a couple lines of code that uses a path to a Zope instance to find those. -- http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: Products.Five/branches/1.4/CHANGES.txt Fix release dates of 1.4.4 and 1.4.3 in CHANGES.txt. Commit logs reveal that they were off by 1 year
Log message for revision 87037: Fix release dates of 1.4.4 and 1.4.3 in CHANGES.txt. Commit logs reveal that they were off by 1 year Changed: U Products.Five/branches/1.4/CHANGES.txt -=- Modified: Products.Five/branches/1.4/CHANGES.txt === --- Products.Five/branches/1.4/CHANGES.txt 2008-05-29 15:56:39 UTC (rev 87036) +++ Products.Five/branches/1.4/CHANGES.txt 2008-05-29 16:14:45 UTC (rev 87037) @@ -12,7 +12,7 @@ that happened during startup of zope. -Five 1.4.4 (2006-07-31) +Five 1.4.4 (2007-07-31) === Bugfixes @@ -23,7 +23,7 @@ This change requires Zope 2.9.8 or higher. -Five 1.4.3 (2006-06-25) +Five 1.4.3 (2007-06-25) === Bugfixes ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] Status of Better XML support for Page Templates?
Was any action ever taken on this? http://wiki.zope.org/zope3/BetterXMLSupportForPageTemplates I never even realized until today that all my browser:page templates are apparently loaded in HTML mode. (Tested in Zope 2.9.9 / Five 1.4.2 ) -- http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Five registerPackage results in unresolved ConflictError
On Wed, May 21, 2008 at 12:47:58PM +0200, Sasha Vincic wrote: So you run ./zopectl run do_nothing.py before you started each instance? We do it just once, right after building a new instance; the instance starts up fine forever after that. Is that better then my doInstall() check? Well, no, it's just a workaround, so it's certainly not better than a fix to the underlying problem. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-Checkins] SVN: Zope/branches/slinkp-zopectl-exitcode-143813/ Making a branch to fix https://bugs.launchpad.net/zope2/+bug/143813
Log message for revision 85724: Making a branch to fix https://bugs.launchpad.net/zope2/+bug/143813 Changed: A Zope/branches/slinkp-zopectl-exitcode-143813/ -=- Copied: Zope/branches/slinkp-zopectl-exitcode-143813 (from rev 85723, Zope/trunk) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py Fixes bug 143813: zopectl should exit non-zero if child processes fail.
Log message for revision 85725: Fixes bug 143813: zopectl should exit non-zero if child processes fail. Changed: U Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py -=- Modified: Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py === --- Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py 2008-04-25 16:07:13 UTC (rev 85724) +++ Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py 2008-04-25 17:02:19 UTC (rev 85725) @@ -147,6 +147,8 @@ class ZopeCmd(ZDCmd): +_exitstatus = 0 + def _get_override(self, opt, name, svalue=None, flag=0): # Suppress the config file, and pass all configuration via the # command line. This avoids needing to specialize the zdrun @@ -265,7 +267,7 @@ cmd += '[sys.argv.append(x) for x in %s];' % argv cmd += 'import Zope2; app=Zope2.app(); execfile(\'%s\')' % script cmdline = self.get_startup_cmd(self.options.python, cmd) -os.system(cmdline) +self._exitstatus = os.system(cmdline) def help_run(self): print run script [args] -- run a Python script with the Zope @@ -335,10 +337,11 @@ # Parent process running (execv replaces process in child while True: try: -os.waitpid(pid, 0) +pid, status = os.waitpid(pid, 0) except (OSError, KeyboardInterrupt): continue else: +self._exitstatus = status break def help_test(self): @@ -364,6 +367,8 @@ print program:, .join(options.program) c.do_status() c.cmdloop() +else: +return min(c._exitstatus, 1) def _ignoreSIGCHLD(*unused): while 1: @@ -393,4 +398,5 @@ # SIGCHILD is unset, just don't bother registering a SIGCHILD # signal handler at all. signal.signal(signal.SIGCHLD, _ignoreSIGCHLD) -main() +exitstatus = main() +sys.exit(exitstatus) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.11/ Fixes bug 143813: zopectl should exit non-zero if child processes fail.
Log message for revision 85727: Fixes bug 143813: zopectl should exit non-zero if child processes fail. Changed: U Zope/branches/2.11/doc/CHANGES.txt U Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py -=- Modified: Zope/branches/2.11/doc/CHANGES.txt === --- Zope/branches/2.11/doc/CHANGES.txt 2008-04-25 17:07:36 UTC (rev 85726) +++ Zope/branches/2.11/doc/CHANGES.txt 2008-04-25 18:37:03 UTC (rev 85727) @@ -8,6 +8,9 @@ Bugs Fixed + - Launchpad #143813: zopectl now exits non-zero when +child processes fail. + - Products.Five: Resynced browser.adding with zope.app.container. This fixes some minor bugs and removes deprecated code. Modified: Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py === --- Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py 2008-04-25 17:07:36 UTC (rev 85726) +++ Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py 2008-04-25 18:37:03 UTC (rev 85727) @@ -147,6 +147,8 @@ class ZopeCmd(ZDCmd): +_exitstatus = 0 + def _get_override(self, opt, name, svalue=None, flag=0): # Suppress the config file, and pass all configuration via the # command line. This avoids needing to specialize the zdrun @@ -265,7 +267,7 @@ cmd += '[sys.argv.append(x) for x in %s];' % argv cmd += 'import Zope2; app=Zope2.app(); execfile(\'%s\')' % script cmdline = self.get_startup_cmd(self.options.python, cmd) -os.system(cmdline) +self._exitstatus = os.system(cmdline) def help_run(self): print run script [args] -- run a Python script with the Zope @@ -335,10 +337,11 @@ # Parent process running (execv replaces process in child while True: try: -os.waitpid(pid, 0) +pid, status = os.waitpid(pid, 0) except (OSError, KeyboardInterrupt): continue else: +self._exitstatus = status break def help_test(self): @@ -364,6 +367,8 @@ print program:, .join(options.program) c.do_status() c.cmdloop() +else: +return min(c._exitstatus, 1) def _ignoreSIGCHLD(*unused): while 1: @@ -393,4 +398,5 @@ # SIGCHILD is unset, just don't bother registering a SIGCHILD # signal handler at all. signal.signal(signal.SIGCHLD, _ignoreSIGCHLD) -main() +exitstatus = main() +sys.exit(exitstatus) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/slinkp-datetime-200007/ branch for fixing https://bugs.launchpad.net/zope2/+bug/200007
Log message for revision 85733: branch for fixing https://bugs.launchpad.net/zope2/+bug/27 Changed: A Zope/branches/slinkp-datetime-27/ -=- Copied: Zope/branches/slinkp-datetime-27 (from rev 85732, Zope/trunk) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/slinkp-datetime-200007/lib/python/DateTime/ Fix for launchpad #200007: DateTime() surprisingly changes timezone if passed a DateTime instance.
Log message for revision 85734: Fix for launchpad #27: DateTime() surprisingly changes timezone if passed a DateTime instance. Changed: U Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py U Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py -=- Modified: Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py === --- Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py 2008-04-25 20:22:51 UTC (rev 85733) +++ Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py 2008-04-25 20:58:04 UTC (rev 85734) @@ -68,7 +68,7 @@ (?:-? # one optional dash (?: # followed by: (?Pyear_day\d\d\d # three digits year day - (?!\d))# when there's no fourth digit + (?!\d))# when there is no fourth digit |# or: W # one W (?Pweek\d\d) # two digits week @@ -586,12 +586,11 @@ DateTime instance. t = arg.timeTime() -lt = safelocaltime(t) -tz = self.localZone(lt) +tz = arg.timezone() ms = (t - math.floor(t)) s,d = _calcSD(t) -yr,mo,dy,hr,mn,sc=lt[:6] -sc=sc+ms +yr,mo,dy,hr,mn,sc = gmtime(t)[:6] +sc = sc + ms elif isinstance(arg, datetime): yr,mo,dy,hr,mn,sc,numerictz,tznaive=self._parse_iso8601_preserving_tznaive(arg.isoformat()) Modified: Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py === --- Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py 2008-04-25 20:22:51 UTC (rev 85733) +++ Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py 2008-04-25 20:58:04 UTC (rev 85734) @@ -386,6 +386,19 @@ d = DateTime('1999/04/12') self.assertEqual(DateTime(d), d) +def testCopyConstructorPreservesTimezone(self): +# test for https://bugs.launchpad.net/zope2/+bug/27 +# This always worked in the local timezone, so we need at least +# two tests with different zones to be sure at least one of them +# is not local. +d = DateTime('2004/04/04') +self.assertEqual(DateTime(d).timezone(), d.timezone()) +d2 = DateTime('2008/04/25 12:00:00 EST') +self.assertEqual(DateTime(d2).timezone(), d2.timezone()) +d3 = DateTime('2008/04/25 12:00:00 PST') +self.assertEqual(DateTime(d3).timezone(), d3.timezone()) + + def testRFC822(self): # rfc822 conversion dt = DateTime('2002-05-02T08:00:00+00:00') ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope-dev] svn.zope.org down?
It's been pretty flaky from here in the US too (at least from NY). But I was eventually able to commit some things yesterday. On Tue, Apr 29, 2008 at 06:07:00PM +0100, Chris Withers wrote: Hey All, Can't contact svn.zope.org, it dead? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope ) -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-Checkins] SVN: Zope/trunk/lib/python/DateTime/ Merged the slinkp-datetime-200007 branch: fix the DateTime(anotherDateTime) constructor to preserve timezones.
Log message for revision 85830: Merged the slinkp-datetime-27 branch: fix the DateTime(anotherDateTime) constructor to preserve timezones. Changed: U Zope/trunk/lib/python/DateTime/DateTime.py U Zope/trunk/lib/python/DateTime/tests/testDateTime.py -=- Modified: Zope/trunk/lib/python/DateTime/DateTime.py === --- Zope/trunk/lib/python/DateTime/DateTime.py 2008-04-28 19:31:09 UTC (rev 85829) +++ Zope/trunk/lib/python/DateTime/DateTime.py 2008-04-28 20:23:11 UTC (rev 85830) @@ -68,7 +68,7 @@ (?:-? # one optional dash (?: # followed by: (?Pyear_day\d\d\d # three digits year day - (?!\d))# when there's no fourth digit + (?!\d))# when there is no fourth digit |# or: W # one W (?Pweek\d\d) # two digits week @@ -586,12 +586,11 @@ DateTime instance. t = arg.timeTime() -lt = safelocaltime(t) -tz = self.localZone(lt) +tz = arg.timezone() ms = (t - math.floor(t)) s,d = _calcSD(t) -yr,mo,dy,hr,mn,sc=lt[:6] -sc=sc+ms +yr,mo,dy,hr,mn,sc = gmtime(t)[:6] +sc = sc + ms elif isinstance(arg, datetime): yr,mo,dy,hr,mn,sc,numerictz,tznaive=self._parse_iso8601_preserving_tznaive(arg.isoformat()) Modified: Zope/trunk/lib/python/DateTime/tests/testDateTime.py === --- Zope/trunk/lib/python/DateTime/tests/testDateTime.py2008-04-28 19:31:09 UTC (rev 85829) +++ Zope/trunk/lib/python/DateTime/tests/testDateTime.py2008-04-28 20:23:11 UTC (rev 85830) @@ -386,6 +386,19 @@ d = DateTime('1999/04/12') self.assertEqual(DateTime(d), d) +def testCopyConstructorPreservesTimezone(self): +# test for https://bugs.launchpad.net/zope2/+bug/27 +# This always worked in the local timezone, so we need at least +# two tests with different zones to be sure at least one of them +# is not local. +d = DateTime('2004/04/04') +self.assertEqual(DateTime(d).timezone(), d.timezone()) +d2 = DateTime('2008/04/25 12:00:00 EST') +self.assertEqual(DateTime(d2).timezone(), d2.timezone()) +d3 = DateTime('2008/04/25 12:00:00 PST') +self.assertEqual(DateTime(d3).timezone(), d3.timezone()) + + def testRFC822(self): # rfc822 conversion dt = DateTime('2002-05-02T08:00:00+00:00') ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/ Merged the slinkp-datetime-200007 branch: fix the DateTime(anotherDateTime) constructor to preserve timezones.
Log message for revision 85837: Merged the slinkp-datetime-27 branch: fix the DateTime(anotherDateTime) constructor to preserve timezones. Changed: U Zope/branches/2.9/configure U Zope/branches/2.9/doc/CHANGES.txt U Zope/branches/2.9/lib/python/DateTime/DateTime.py U Zope/branches/2.9/lib/python/DateTime/tests/testDateTime.py -=- Modified: Zope/branches/2.9/configure === --- Zope/branches/2.9/configure 2008-04-28 21:19:27 UTC (rev 85836) +++ Zope/branches/2.9/configure 2008-04-28 21:22:09 UTC (rev 85837) @@ -12,13 +12,13 @@ # Place the optimal target version number for Zope (as returned by sys.version) # below -TARGET=2.4.4 +TARGET=2.4.5 # Order a list of acceptable python version numbers (as returned by # sys.version) below in best to worst order, not including the # target version. Up to six acceptable python versions are allowed. # Do not include the target version number in this list! -ACCEPTABLE=2.4.2 2.4.3 +ACCEPTABLE=2.4.4 2.4.2 2.4.3 # provide the executable names for all the acceptable versions # (and the target version) below Modified: Zope/branches/2.9/doc/CHANGES.txt === --- Zope/branches/2.9/doc/CHANGES.txt 2008-04-28 21:19:27 UTC (rev 85836) +++ Zope/branches/2.9/doc/CHANGES.txt 2008-04-28 21:22:09 UTC (rev 85837) @@ -8,6 +8,9 @@ Bugs fixed + - Launchpad #27: DateTime(anotherDateTime) now preserves the +timezone. + - Launchpad #143813: zopectl now exits non-zero when child processes fail. Modified: Zope/branches/2.9/lib/python/DateTime/DateTime.py === --- Zope/branches/2.9/lib/python/DateTime/DateTime.py 2008-04-28 21:19:27 UTC (rev 85836) +++ Zope/branches/2.9/lib/python/DateTime/DateTime.py 2008-04-28 21:22:09 UTC (rev 85837) @@ -712,12 +712,11 @@ if isinstance(arg, DateTime): Construct a new DateTime instance from a given DateTime instance t = arg.timeTime() -lt = safelocaltime(t) -tz = self.localZone(lt) +tz = arg.timezone() ms = (t - math.floor(t)) s,d = _calcSD(t) -yr,mo,dy,hr,mn,sc=lt[:6] -sc=sc+ms +yr,mo,dy,hr,mn,sc = gmtime(t)[:6] +sc = sc + ms elif isinstance(arg, (unicode, str)) and arg.lower() in self._tzinfo._zidx: # Current time, to be displayed in specified timezone Modified: Zope/branches/2.9/lib/python/DateTime/tests/testDateTime.py === --- Zope/branches/2.9/lib/python/DateTime/tests/testDateTime.py 2008-04-28 21:19:27 UTC (rev 85836) +++ Zope/branches/2.9/lib/python/DateTime/tests/testDateTime.py 2008-04-28 21:22:09 UTC (rev 85837) @@ -299,6 +299,19 @@ d = DateTime('1999/04/12') self.assertEqual(DateTime(d), d) +def testCopyConstructorPreservesTimezone(self): +# test for https://bugs.launchpad.net/zope2/+bug/27 +# This always worked in the local timezone, so we need at least +# two tests with different zones to be sure at least one of them +# is not local. +d = DateTime('2004/04/04') +self.assertEqual(DateTime(d).timezone(), d.timezone()) +d2 = DateTime('2008/04/25 12:00:00 EST') +self.assertEqual(DateTime(d2).timezone(), d2.timezone()) +d3 = DateTime('2008/04/25 12:00:00 PST') +self.assertEqual(DateTime(d3).timezone(), d3.timezone()) + + def testRFC822(self): '''rfc822 conversion''' dt = DateTime('2002-05-02T08:00:00+00:00') ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] Test failure in zope.component on 2.10 branch
Does anybody else see this on a fresh checkout of the zope 2.10 branch? I think it's pretty new; I had a checkout last week where I didn't get any test failures. [EMAIL PROTECTED] ~/tmp/z2branches/2.10 $ python test.py -s zope.component Running tests at level 1 Running unit tests: Running: Failure in test testStandalone (zope.component.tests.StandaloneTests) Traceback (most recent call last): File /usr/lib/python2.4/unittest.py, line 260, in run testMethod() File /home/pw/tmp/z2branches/2.10/lib/python/zope/component/tests.py, line 975, in testStandalone self.fail(''.join(lines)) File /usr/lib/python2.4/unittest.py, line 301, in fail raise self.failureException, msg AssertionError: . -- Ran 1 test in 0.011s OK -- http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Test failure in zope.component on 2.10 branch
False alarm. It turned out to be spew that I've seen before only under certain circumstances: if you're on a gentoo box and your $TERM env. var. is set to xterm, then importing readline causes some non-printable characters to be written to stdout. The test was failing on those, because it expects OK to be the last thing printed by the subprocess. I can make it pass by setting TERM=linux or TERM=xterm-color. I can't reproduce on any other *nix I've tried (ubuntu, OSX). *Shrug* FWIW here's a demo of the garbage output from importing readline: [EMAIL PROTECTED] ~ $ TERM=xterm python -c import readline | od -c 000 033 [ ? 1 0 3 4 h 010 [EMAIL PROTECTED] ~ $ TERM=linux python -c import readline | od -c 000 On Mon, Apr 28, 2008 at 4:50 PM, Tres Seaver [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul Winkler wrote: Does anybody else see this on a fresh checkout of the zope 2.10 branch? I think it's pretty new; I had a checkout last week where I didn't get any test failures. [EMAIL PROTECTED] ~/tmp/z2branches/2.10 $ python test.py -s zope.component Running tests at level 1 Running unit tests: Running: Failure in test testStandalone (zope.component.tests.StandaloneTests) Traceback (most recent call last): File /usr/lib/python2.4/unittest.py, line 260, in run testMethod() File /home/pw/tmp/z2branches/2.10/lib/python/zope/component/tests.py, line 975, in testStandalone self.fail(''.join(lines)) File /usr/lib/python2.4/unittest.py, line 301, in fail raise self.failureException, msg AssertionError: . -- Ran 1 test in 0.011s I don't see that issue. What is the content of the 'lines' local variable there? (Run with '-D' to get a postmortem). Tres. - -- === Tres Seaver +1 540-429-0999 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIFjiO+gerLs4ltQ4RAi0LAJ0Z8w7cExs/I3ujQKm9Y+CR97WFKgCeKUo7 6aEQeB/Iv2evxOkQnD8O7yk= =oRhO -END PGP SIGNATURE- -- http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Test failure in zope.component on 2.10 branch
On Mon, Apr 28, 2008 at 05:26:36PM -0400, Benji York wrote: On Mon, Apr 28, 2008 at 5:09 PM, Paul Winkler [EMAIL PROTECTED] wrote: The test was failing on those, because it expects OK to be the last thing printed by the subprocess. I don't have any idea what you're talking about, so ignore me if I'm totally off-base... but: shouldn't the thing that is running the tests be looking for exit code instead of sniffing for particular output on stdout? Good question. The subprocess that's run is lib/python/zope/component/standalonetests.py which runs a typical unittest.main(). Does that not exit 1 on failures, on all platforms? (What happens on windows?) btw, the calling code (zope/component/tests.py) was made somewhat more robust between 2.10 and 2.11, but it's still sniffing stdout. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] buildbot.zope.org?
This one looks great, thanks Christian. Any idea what's wrong with Zope2.buildout? Looks like Acquisition is not built properly: http://zopebuildbot.whq.gocept.com/builders/Zope2.buildout/builds/75/steps/test/logs/stdio On Sat, Apr 26, 2008 at 08:22:40AM +0200, Christian Theune wrote: Hello Paul, Theuni built a new one: http://zopebuildbot.whq.gocept.com/ But it's down again... It's still what I call experimental. The availability is pretty good in general though, unfortunately it didn't restart when the machine cycled (Thursday?) and I was too lazy/busy to fix it yesterday. The restarts should go normal by now and I don't know any other condition that currently would wrack it. Christian -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] buildbot.zope.org?
What's the story with http://buildbot.zope.org ? It looks like most of the slaves are either disconnected, or failing to build at all, with errors like this: e.g. http://buildbot.zope.org/Zope3%20trunk%202.4%20Windows%202000%20zc-bbwin3/builds/704/svn/0 ... File c:\python24\lib\site-packages\buildbot\slave\commands.py, line 275, in kill self.commandFailed(CommandInterrupted(no process to interrupt)) exceptions.AttributeError: ShellCommand instance has no attribute 'commandFailed' -- http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] comments on DateTime(DateTime()) preserving timezone? (launchpad 200007)
I've got a fix, with tests, for https://bugs.launchpad.net/zope2/+bug/27 checked in at Zope/branches/slinkp-datetime-27 If nobody objects in the next few days, I'd like to merge this to trunk, and the 2.11, 2.10, and 2.9 branches. -- http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: [Checkins] SVN: z3c.formjs/branches/pcardune-extjs/ creating a branch to see what I can do about extjs integration.
Regarding Ext's licensing, I'm told that they are planning to switch to an OSI-approved license in the near future; we're still waiting for more details, but my source is here: http://www.openplans.org/projects/opencore/lists/opencore-dev/archive/2008/04/1208546123405 - PW -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Non-ASCII characters in URLs
On Sun, Apr 06, 2008 at 04:37:22PM -0700, Alexander Limi wrote: Hi, Is there a good technical explanation for why Zope doesn't allow non-ASCII characters in URLs? I suspect it's only for hysterical raisins. The code in question is in OFS/ObjectManager.py, in the checkValidId() function. Non-ASCII characters trigger a match on the bad_id regular expression search. As I recall, if you look at the revision history, that code is very old. There might even be an existing bug filed about this; I don't remember. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] ZSyncer Zope 2.10
On Mon, Mar 31, 2008 at 09:41:11AM -0400, Craig Chasseur wrote: Hello All, We've recently completed an upgrade to Zope 2.10.5 on one of our servers and we've begun to encounter problems with ZSyncer. We use ZSyncer to synchronize objects between this server and another running Zope 2.9.8 (both have ZSyncer 0.7.1 installed). When attempting to put folders from the 2.10 server to the 2.9 server, the process hangs and nothing is transferred. However, when we attempt to put individual objects, we are successful. Does anyone know what might be the cause of this issue? ZSyncer 0.7.1, which is the latest release, claims that it may not be compatible with Zope 2.9 and up, but we were able to use it successfully before this most recent upgrade to 2.10. If anyone is aware of a fix or a workaround, or simply has an insight into why this breaks for us, I would greatly appreciate the help. I've never tried ZSyncer with Zope 2.10; I don't have any guesses what your problem is. Have you tried syncing between two 2.10 instances? In general, you move data from 2.X to 2.X-1 at your own risk, whether using ZSyncer or the import/export tab in the ZMI. I've been the official ZSyncer maintainer for about 5 years now, but honestly I've barely touched it since 2005, since in its current state it works well enough on the rare occasions that I need it. If somebody else cares enough about ZSyncer to maintain it, please contact me. Otherwise, to be crassly honest, I'm unlikely to do any ZSyncer-related work unless somebody pays me to do so. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZSyncer Zope 2.10
On Mon, Mar 31, 2008 at 09:41:11AM -0400, Craig Chasseur wrote: Hello All, We've recently completed an upgrade to Zope 2.10.5 on one of our servers and we've begun to encounter problems with ZSyncer. We use ZSyncer to synchronize objects between this server and another running Zope 2.9.8 (both have ZSyncer 0.7.1 installed). When attempting to put folders from the 2.10 server to the 2.9 server, the process hangs and nothing is transferred. However, when we attempt to put individual objects, we are successful. Does anyone know what might be the cause of this issue? ZSyncer 0.7.1, which is the latest release, claims that it may not be compatible with Zope 2.9 and up, but we were able to use it successfully before this most recent upgrade to 2.10. If anyone is aware of a fix or a workaround, or simply has an insight into why this breaks for us, I would greatly appreciate the help. I've never tried ZSyncer with Zope 2.10; I don't have any guesses what your problem is. Have you tried syncing between two 2.10 instances? In general, you move data from 2.X to 2.X-1 at your own risk, whether using ZSyncer or the import/export tab in the ZMI. I've been the official ZSyncer maintainer for about 5 years now, but honestly I've barely touched it since 2005, since in its current state it works well enough on the rare occasions that I need it. If somebody else cares enough about ZSyncer to maintain it, please contact me. Otherwise, to be crassly honest, I'm unlikely to do any ZSyncer-related work unless somebody pays me to do so. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Re: zope.sendmail Retry fixes and new state machine.
On Tue, Mar 11, 2008 at 09:25:59AM -0400, Jim Fulton wrote: It is certainly straightforward enough to create isolated doctests. For edge cases, I do typically create separate isolated short doctests that deal just with that case. The assertion that doctests don't allow isolation is simply not correct. Can you think of a package offhand that I might look at to see a good example of this? I've got a lot of overgrown, brittle doctests at work that need gradual reorganization, and I'd love to see some good role models. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Managing Zope objects in Subversion
On Mon, Mar 03, 2008 at 12:29:06AM +0100, Martijn Jacobs wrote: Hi Martin. Maybe http://dirstorage.sourceforge.net/index.html is something for you. That's not really relevant to the original post. Think of it as a different database backend that still stores non-human-readable binary data. Regarding Dieter's suggestion: When I remember right, Tres has a product that allows to dump and restore standard Zope objects to/from the file system. I forgot its name but you should be able to find it via your favorite search engine. It's called FSDump. http://www.zope.org/Members/tseaver/FSDump Definitely worth a try. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] When to use a relational database
On Thu, Feb 07, 2008 at 07:14:46PM -0800, Tim Nash wrote: Why does storing a single document lead to close to 120 objects being inserted? I'd bet almost all of that is updates to catalog indexes and metadata. Is it something related to plone or is this the case for all ZPT storing? Is it similarly true for the storing of DTML documents? You're confused. The relative speed of ZPT and DTML have only to do with rendering time. As far as the ZODB is concerned, they are equivalent. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] test, please ignore
I haven't received any mail from zope.org in quite while... -- http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] Re: Hivurt code hosting
On Mon, Nov 12, 2007 at 12:19:20PM -0500, Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul Winkler wrote: On Sun, Nov 11, 2007 at 06:37:22PM -0500, Stephan Richter wrote: Yes, everyone has to sign a contributor agreement, but you do not have to become a Zope Foundation member. I had the impression, from the recent ZF IRC chat, that the process of adding new contributors is currently blocked - but perhaps I misunderstood? We can't move the code ownership yet (from ZC to ZF) because once we *do*, becoming a contributor will be governed by ZF rules, which are currently self-contradictory: at that point, we would be unable to add new committers at all. I see, thanks. What I just can't figure out is: what is the current process of becoming a comitter. http://www.zope.org/DevHome/Subversion/FrontPage still links to http://www.zope.org/DevHome/Subversion/Contributor.pdf which is very old. Is it still used? I probably still have commit access from the pre-ZF days, but the employer information I submitted has changed several times since then. Now that I've started working for a more enlightened employer, I would like to start checking in bugfixes again but I don't know whether I should just use my old keys, or submit a new form, or what. - PW ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Hivurt code hosting
On Sun, Nov 11, 2007 at 06:37:22PM -0500, Stephan Richter wrote: Yes, everyone has to sign a contributor agreement, but you do not have to become a Zope Foundation member. I had the impression, from the recent ZF IRC chat, that the process of adding new contributors is currently blocked - but perhaps I misunderstood? -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Defining a dictionary in ZPT?
On Thu, Nov 01, 2007 at 12:48:04PM +, michael nt milne wrote: Hi I've got this piece of code which is returning a keyerror on 'results' as I haven't set up a dictionary for the variables. (snip) span tal:define=query here/testquery li tal content=results python: query(id='IT') span tal:replace=results/firstnameFirst Name/spannbsp; /li li tal content doesn't make any sense. I suspect you want that to be: li tal:define=results ... -- Paul Winkler ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] storing python objects
On Thu, Oct 25, 2007 at 03:19:10PM -0700, David Bear wrote: but I've never seen this documented anywhere. Is it possible to store basic python objects directly in zodb? http://www.zope.org/Documentation/Books/ZDG/current/Persistence.stx -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to know what are zope doing now?
You might also consider turning on the trace log. I've sometimes done troubleshooting by eyeballing that file and/or using requestprofiler.py. This is useful if some requests are taking so long that zope seems to hang. But DeadlockDebugger might be easier to use. - P On Thu, Sep 20, 2007 at 01:33:55AM +0200, Garito wrote: Hi! Every night my Zope server has 99% cpu usage and, sometimes, the server stops to serve pages There are any way to know what the Zope server is doing in real time? I know I could look at event.log or z2.log but I would like to know the activity in real time Is this posible? How can I know what my server is doing? -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to upgrade Python in older Zope?
On Tue, Sep 11, 2007 at 07:36:18AM -0700, Tit-Liviu Leontin wrote: Folks, I desperately need support for large filesystem so the data.fs file can exceed 2 GB. I can only make minimal changes to the existing set-up, which consists of Zope 2.5.1 (binary release, with Python 2.1.3) on Windows Server 2003 and NTFS. From what I've read, the issue is with the old Python not having LFS enabled, so I thought I'd just upgrade it to 2.2.3 which has LFS enabled. The question is, how do I do that? Windows installer for Python doesn't know what to upgrade in the Zope install, so I'm thinking to copy the right files from the extracted Python 2.2.3 in Zope folders. That sounds like a really bad idea. From the Zope 2.5.1 release notes: * Zope requires Python 2.1 (Python 2.2 is currently *not* supported) You should NOT assume that warning was put there for no reason :-) Also, there's not a whole lot of expertise in this community on building for Windows; we seem to be a linux/unix-heavy crowd. You'd better stick to the binary releases and not mess with them, unless you can find a bona-fide expert to help you. Anyone? :-) Meanwhile you might try migrating a *copy* of your Data.fs to Zope first to Zope 2.6.4 (still uses Python 2.1.x) and then to Zope 2.7.7 (uses Python 2.3.x). FWIW I recall 2.5 to 2.6 being a painless upgrade. I think 2.7 was a little more involved. The most likely problem to watch out for is security-related issues: your code might accidentally rely on a security weakness that was subsequently tightened, so you get permission denied at unexpected times until your code and/or configuration is fixed. Install and turn on VerboseSecurity, it's a big help with things like that. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Deleting a file in Python
On Sat, Aug 25, 2007 at 07:35:06AM -0400, [EMAIL PROTECTED] wrote: but I can't figure out where context.* is documented. It depends what kind of object context is. To find out, you may find this product useful: http://plone.org/products/docfindertab Here is a good start reference for Zope 2 APIs... it was never finished or updated for zope later than 2.7, but it's a lot better than nothing: http://www.plope.com/Books/2_7Edition/AppendixB.stx -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] missing images
Sounds like a previously reported bug, http://sourceforge.net/tracker/index.php?func=detailaid=1352783group_id=28073atid=392340 I think this is fixed in CVS, but the original reporter never replied. Can you try ZSyncer from CVS and let me know? cvs -d:pserver:[EMAIL PROTECTED]:/cvsroot/zsyncer login cvs -z3 \ -d:pserver:[EMAIL PROTECTED]:/cvsroot/zsyncer \ co -P ZSyncer If that doesn't help, unfortunately I am on vacation for the rest of the month so I won't be able to look at this until September at the earliest. -PW On Tue, Aug 07, 2007 at 09:45:28AM -0700, baiewola wrote: I recently installed ZSyncer 0.7.1 in Zope 2.7.2, added a ZSyncer object and configured it. It sync'd perfectly. Today, when I clicked the sync tab to sync, I noticed that all of the images that indicate whether an item is okay, out of date, etc., are showing up as question marks. The only thing that changed is that I put Zope behind Apache Sunday evening. But I can't specifically trace it to that action, because I didn't test ZSyncer right after putting it behind Apache. Has anyone seen this, and if so can you tell me how to resolve it? Thanks! Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. http://farechase.yahoo.com/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Unit Testing DTML and ZPT
On Thu, Jul 26, 2007 at 01:09:54PM +0200, Marco Bizzarri wrote: The problem is what you're trying to test (and, therefore, to assert). Checking for equality is too fine grained, where you would check for the structure of the zpt, for example. A little parser could be useful. testbrowser might come in handy: http://plone.org/documentation/tutorial/testing/functional-tests/view?searchterm=import It's also good to keep the design for testing adage in mind. Keep it granular. Do as much logic and data preparation as possible in product methods or scripts, which can be tested individually. Then your templates simply present this data. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to import a basic class in Script (Python)
On Wed, Jul 18, 2007 at 12:26:06PM +0300, Tudor Gabriel wrote: I've searched Zope Help and it mentions in there that i have to make a new dir in Products called whatever and add to __init__.py the allowimport or something like that, for my package. i tried that too ... same error (haven't restarted zope after... should i?) . Yes. Changes to filesystem code require a restart. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: comments toggling not working for Zope Book etc
Because that version of the book is outdated. Try here: http://www.plope.com/Books/2_7Edition That newer version (2.7) stalled in development a couple years ago, but it's already much improved and extended since the 2.6 version. Many (most?) of the comments from the 2.6 version have been addressed in the text. -PW On Thu, Jun 21, 2007 at 07:49:50PM +0100, michael nt milne wrote: ok, just wondering what the reason for that was? I used to find them very useful especially on install etc. If it is a CSS thing they should still be available via a URL etc.. On 6/20/07, Michael Haubenwallner [EMAIL PROTECTED] wrote: michael nt milne schrieb: Hi Just wondering if the comments toggling is working for the Zope book. Have tried in Internet Explorer and Firefox but they seem to be off permanently. http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ZopeArchitecture.stx You are right, display of comments has been disabled in CSS by the end of December 2006. Hth, Michael -- http://www.zope.org/Members/d2m http:/planetzope.org ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- michael ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] a couple of basic questions
On Wed, Jun 20, 2007 at 10:02:01AM -0400, [EMAIL PROTECTED] wrote: i tryed to call it using sql_do_something = context['db/sql_do_something'] hoping that maybe using aquisition ... i can get the script ... but i get the message that he can't find the object. Maybe context['db']['sql_do_something']. I don't remember. Close but no cigar. Dictionary-style item access does NOT use acquisition: foo['bar']['baz'] works iff bar is in foo and baz is in bar. Object-style attribute access DOES use acquisition: foo.bar.baz works if bar is in (or can be acquired by) foo, and baz is in (or can be acquired by) bar. Finally, restrictedTraverse() is your friend: foo.restrictedTraverse('bar/baz') works like foo.bar.baz -PW -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Creating a ZCatalog to catalog the newly created objects using ZClasses
On Sun, Jun 10, 2007 at 07:19:47PM +0200, Dieter Maurer wrote: kamal hamzat wrote at 2007-6-10 13:21 +0100: ... Instead use either through-the-web scripting with Zope Page Templates, PythonScripts etc. or write a Zope product. Please can somebody point me to How to for any of these new recommended ways. The Zope Developper Guide, although quite old, still contains valuable information about Zope product writing. Here are some other useful links: http://wiki.zope.org/zope2/DiskBasedProduct -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: MemoryError exception when importing a zexp file
On Thu, May 31, 2007 at 09:55:26AM +0200, Sascha Welter wrote: ... Did you verify with plohn people (e.g. on a Plone mailing list) that current plone versions can be imported/exported? (Because the last time I made the mistake to do a project with plone you couldn't import/export a plone site -- or rename it, move it to another instance or anything similar for that matter -- without major pain. It's been a while though, so things could have changed.) I spent several hours recently to import a .zexp of a Plone 2.0 site. Got nowhere. One suggestion I got (which I wasn't able to follow) was the following. If you have access to the original server, try this: 1) Make a full backup of the entire ZODB, eg. using repozo.py. 2) Set up a new Zope instance with all the same products installed, using your new backup copy of the ZODB. 3) Go into the ZMI for this new instance, and delete everythign EXCEPT this plone site. 4) Pack the database to get rid of all the other stuff. Or make a new clean backup. There. You now have a Data.fs that contains only your Plone site. Instead of importing the .zexp, just mount the database at the appropriate path. Disclaimer: I haven't tried this yet. Summary: Go and ask the plone people, if you can't import anyway, the whole exercise is in vain. +1 -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Scaling problems, or something else?
On Wed, May 16, 2007 at 04:24:56PM -0500, Jens Vagelpohl wrote: There's a difference between scaling and making something faster. ZEO makes a single instance slower, right. But you can deal with more requests concurrently using ZEO. That's what I consider scaling. Agreed. But at the same time, I don't think it makes sense to keep deploying more and more badly tuned instances. That's what I consider blind shotgun scaling :) You need to scale, but you also need to tune - and you need to be pragmatic about which is the appropriate approach at any given point in time. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Scaling problems, or something else?
On Wed, May 16, 2007 at 05:13:27PM +0200, Gaute Amundsen wrote: On Wednesday 16 May 2007 07:52, Gerhard Schmidt wrote: All our frontendservers have 8gig ram. Zope gets major performance Problems when it reaches the limit of physical memory. Check your system if the. So having 2 zope Processes on the same system increases the Problem. We do actually, have two. From a time we just hadd to do something! Consolidation time... Well, maybe. Is it an SMP box? You can happily run 1 Zope process per CPU. I'm told that recent versions of Linux should be pretty good at keeping CPU affinity without any special configuration. At some point Varnish url rewriting wil be good enough, and then we can cut apache out of it too.. I highly doubt Apache will become your bottleneck anytime soon :) But of course it's one more thing to admin. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Scaling problems, or something else?
On Tue, May 15, 2007 at 12:00:52PM +0200, Gaute Amundsen wrote: I set cache-size to 1 last night, up from the default. I felt I had to try that before I had a grap in place, so I don't have good numbers to estimate tha change, but with about 20 hits a sec on apache, there was close to 50 loads the last hour, and just 3000 writes. Does that look reasonable? Not really. Too many loads; you're getting a lot of cache misses and blowing out the cache a lot. Keep on doubling the cache size until your whole working set is in RAM all the time. The built in help seems to indicate I should increase the cache until reads approaches zero..? Yeah, for some definition of approaches. I think a more realistic minimum would be number of threads * number of ZODB writes (since each write potentially invalidates one cached object per thread). It's hard to quantify the point at which you're caching enough, but you're not even close. Also, I don't think you've mentioned what sort of app this is. Is it mostly reads or are there lots of writes? Mostly reads is a lot easier to optimize :) Big CMS system with about 70 virtual domains. Based on your activity graph, you do indeed have a lot more reads than writes. What's the CMS based on? Plone? Silva? Chris W. had a good point about the catalog. Do you have blobby data in the ZODB? (large images or files)? Those tend to play havoc with zodb cache activity, since one OFS.Image is stored as an arbitrarily long chain of small persistent objects. So whereas a Plone Document or a Page Template needs only one entry in the cache, an Image might need hundreds. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Scaling problems, or something else?
On Wed, May 09, 2007 at 12:07:54PM +0200, Gaute Amundsen wrote: Just a quick call for ideas on this problem we have... Setup: Zope 2.7.5 (~180 sites) - apache (- varnish for 1 high profile site) Most noticeable symtoms: Takes 30 sec. or more to serve a page, or times out. Sporadic problem, but allways during general high load. Lasts less than 1 hour. Restarting zope does not help. Lots of apache processes in '..reading..' state Apache accesses and volume is down. Server load is unchanged, and 2.0 Apache processes is way up (~250 aganinst 40) Netstat established connections is WAY up (~650 aganist 50) The increase in netstat connections and apache processes indicates lots of simultaneous traffic, but it's interesting that Apache accesses is down. Since hits are logged only on completion, it may be that many of the requests are hung. Is this zope hitting some sort of limit and just letting Apache hang? Would setting up ZEO on the same box make a difference, ZEO doesn't buy you any performance unless you have multiple Zope clients reading from it, and a load balancer in front. This will help IF your application is CPU-bound, which yours is not (I assume by server load you mean CPU). ZEO can actually *hurt* if you're IO-bound, because it adds network overhead to ZODB reads and writes. It's very bad if you have large Image or File objects (which you probably shouldn't have in the ZODB anyway). or would it be better to extend varnish coverage? Probably a good idea anyway... but you want to find out what the problem really is. What would you do to pinpoint the problem? I'd first try hitting Zope directly during the problem to see if the slowdown is there. If so, I'd then try either: - DeadlockDebugger may be informative. http://www.zope.org/Members/nuxeo/Products/DeadlockDebugger - Enable Zope's trace log and use requestprofiler.py to see if there is a pattern to the requests that trigger the problem. Eg. maybe all your zope worker threads are waiting on some slow IO task. See the logger section of zope.conf. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Re: ZClasses Maintenance and Upgrade
On Wed, Apr 18, 2007 at 11:52:03AM +0200, Max M wrote: I wrote this 5 message years ago: http://mail.zope.org/pipermail/zope/2002-May/115427.html I've just added a link to that message on this wiki page: http://wiki.zope.org/zope2/ZClassesAreEvil Max (or anybody), feel free to merge the text of Max's message into the wiki page. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Please Help - Extracting Info From ZEXP File
On Fri, Apr 13, 2007 at 12:36:13PM -0500, s wrote: I just took over a website that was done in Zope/Plone. The person formerly responsible for it was not helpful to the client or me in the transition process. Basically he emailed a ZEXP file to me, told me it contains everything I need, and washed his hands of the whole project. The .zexp cannot contain everything you need. It will contain all the data (assuming he didn't miss anything), but that data can only be loaded if you have a zope system running with all the correct third-party software installed. You should insist on being provided with: - Zope version - Name and version number for every subdirectory of $INSTANCE_HOME/Products/ (including, of course, Plone) ... usually each subdirectory will have a file named version.txt - Name and version number for every add-on Python package installed to the system, if any. Without this information, you will be unable to load the .zexp. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope 2 Development Best Practices
On Fri, Apr 13, 2007 at 03:30:06PM -0600, Edward Pollard wrote: Greetings, A few years back our institution adopted Zope to support some CMS- like development on a zero-dollar budget. We achieved our primary goals in no time at all, and we very happy. Since that time we have used Zope to deliver a number of solutions to our organization. However, as the complexity of our operation increases, it becomes more and more apparent that our coding standards for Zope are very low. We've leaned on the existing Zope community - adopting code, borrowing ideas, trying to learn - but have never seen anything that helps us better understand the philosophy and structure that would underly a strong understanding of Zopishness. For instance, here are a few gems from our playbook. Please note first that everything works to our needs and we are trying to find a way out of the darkness. We're smart folks, but I fear we have strayed far from the path of wisdom and light. - We have never developed a python based product, although we have hung a gigantic amount of external methods off of a half dozen pages to make it go. And yes, we use ZClasses (shock) - We have solved problems by modifying the ZServer source code - We have developed entire database driven products inside external methods. - Every Z SQL Method we have has a python script associated with it to massage input and output (and manually enforces security). Of course, a google of Zope Best Practices just brings me a bunch of Plone development stuff. That is of no use. So where is the knowledge I seek to be found? Understanding that open source products are prone to such abuses, I've not been able to find anything as a starting ground to reform our ways. You might start here: http://wiki.zope.org/zope2/DiskBasedProduct http://wiki.zope.org/zope2/Testing http://wiki.zope.org/zope2/BestPractices -- Paul Winkler http://www.slinkp.com ___ Zope maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Problem with using versions.
On Wed, Apr 11, 2007 at 09:00:12AM -0500, Catherine E. Reinehr wrote: I'm running 2.6.2. What's the most recent stable release? 2.10.3? Yes, but the Version feature was removed after zope 2.7. From the changelog for zope 2.8: * Removed Version objects from the add menu. Versions are agreed to be a feature that should not be used as it is not well implemented and allows for data loss. I hate to say this, but my Zope knowledge is very limited. I'm really only using it because it's what my predecessor used to build the web site in the first place, and she's not a whole lot of help now. That's never a fun situation to be in with any technology... if your budget affords it, it might be cost effective to bring in a consultant for a short time to explore your predecessor's system and get you up to speed on it. To learn about versions, read this: http://www.plope.com/Books/2_7Edition/ZopeServices.stx#1-3 especially note the Caveat: Versions and ZCatalog which might be related to your problems (just guessing... we don't know if you're using a ZCatalog). I went here (http://wiki.zope.org/ZODB/FileStorageBackup) to read up on backups, but I'm afraid it doesn't make a whole lot of sense to me. We can't guess which parts don't make sense to you :) Maybe come back with more specific questions here or on IRC? The #zope channel on irc.freenode.net is often quiet, but there's a lot of knowledgable zope people in #plone and that channel is more active. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] xmlrpc error handling
On Wed, Apr 11, 2007 at 01:38:21PM -0400, Kevin wrote: In order to avoid zodb implosion, is it sufficient to raise an xmlrpclib Fault object from a method where some validation was not successful? yes. Will zope abort transactions yes. and avoid an other avoidable bad things from happening? as long as your application is designed well with regard to transaction boundaries, you'll be fine. Inconsistencies could arise if your app does something weird like manually commit a transaction and start a new one before the exception is raised... Do I have to use fault or can I raise just any error an ZPublisher.xmlrpc will marshall it into fault/fault? The latter. Try it and see :) AFAICT any uncaught exception will be published as an xmlrpc fault. But then I think you don't have control of the fault code, if you care about that. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Problem with using versions.
On Wed, Apr 11, 2007 at 01:53:42PM -0500, Catherine E. Reinehr wrote: I had no idea versions were so buggy; I wouldn't have used them in the first place if I had. :/ Not your fault, all the old documentation encourages people to use them :( -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] VirtualHostBase VHM keyword doesn't work.
On Wed, Apr 11, 2007 at 12:23:14AM -0400, Mark, Jonathan (Integic) wrote: Zope 2.9 says in the Virtual Host Monster About Tab: For example, suppose Zope is running on port 8080 behind an Apache running on port 80. You place a Virtual Host Monster in the Zope root Folder, and use Apache to rewrite /(.*) to http://localhost:8080/VirtualHostBase/http/www.buystuff.com:80/buystuff.com/VirtualHostRoot/$1.; However, the following in my Apache 2.2 httpd file does not work: VirtualHost *:80 RewriteEngine on DocumentRoot /var/www Servername goodbyeken.com RewriteRule /(.*) http://goodbyeken.com:8080/VirtualHostBase/http/www.goodbyeken.com:80/goodbyeken.com/VirtualHostRoot/$1 /VirtualHost The above directive results in a Zope resource not found error. It would be useful if you could tell us WHAT resource is not found. Check your logs. Your zope access log is very useful when trying to configure rewrite rules; you can see exactly what path Apache request. I have a Virtual Host Monster called myVHM in my Zope root directory. myVHM is able to do redirections that do not include the VirtualHostBase keyword. Why doesn't the VirtualHostBase keyword work? It does. My first guess would be that you don't have a folder named goodbyeken.com. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] manipulating zodb from independent database connection
On Tue, Apr 10, 2007 at 10:19:43PM -0700, Tim Nash wrote: Does anybody have a script available that shows how to insert objects into the ZODB root['Application'] from a non-zope process outside the Zope application? Everytime I try to read root['Application'] I get a page template error. I'm using zope 2.5 (matches a book I like) You can do whatever you like, but you're not likely to find many people still running 2.5 on this list... so you might get less useful help than you would like. and doing like so: from ZODB import FileStorage, DB storage = FileStorage.FileStorage('Data.fs') db = DB(storage) connection = db.open() root = connection.root() Also, can the ZODB be altered this way on a running Zope instance? Not with FileStorage. Only one process at a time can open a FileStorage. If you would use ZEO instead, then it would be possible. Your code above would then be modified to use ClientStorage instead of FileStorage. But I don't know exactly what the code would look like in zope 2.5, I haven't run that version in years. I vaguely remember needing a custom_zodb.py file to set up ClientStorage. If you would upgrade to a more recent Zope (2.7 or later), then ZEO is available out of the box just by uncommenting some lines in the example zope.conf. And you would also get a script at bin/zopectl that's perfect for this kind of job. Your own script would be invoked as an argument to zopectl, like: ./bin/zopectl run path/to/my/script ... and you would get the root application automatically set up for you and bound as app. But you still need to use ZEO. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Attribute error
On Fri, Mar 23, 2007 at 02:56:31PM -0500, Catherine E. Reinehr wrote: Hi, I'm pretty new to Zope; I inherited the system when I started my new job. We use it to manage a college web site. I noticed yesterday that several pages in our Student Services section will no longer load. Every time I try, I get this: Error Type: AttributeError Error Value: visible And I have no idea what it means or how to fix it. Any suggestions would be much appreciated. Thanks, Catherine Not enough information... so the first thing to do is go into the zope management interface, click on the /error_log link, and find your error listed there. Click on it to get a more complete traceback. Reply here with that information and you're more likely to get a useful response. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml Z SQL doubt
On Thu, Mar 22, 2007 at 08:11:21AM -0400, Allen Schmidt Sr. wrote: Just use REPLACE instead of INSERT. If REPLACE statement is able to determine a unique value for a row and sees that that unique value exists for a row, the valued will be updated. If it does not exist, a new row will be inserted. This is what I use with MySQL. Or, depending on what you want, the INSERT...ON DUPLICATE KEY UPDATE syntax can be used. http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html Note that both of these idioms are specific to MySQL and not portable to other databases. -PW -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Two mysql / timestamp related fixes
On Thu, Mar 08, 2007 at 02:07:56PM +0100, Gaute Amundsen wrote: this is definitely connected to the timestamp column, because this change fixed it: diff /usr/lib/zope/lib/python/Products/ZMySQLDA/db.py /usr/lib/zope/lib/python/Products/ZMySQLDA/db.py~ 173d172 conv[FIELD_TYPE.TIMESTAMP] = DateTime_or_None I have found no mention of this anywhere? Have anyone else had this problem Yes, I've observed the same thing, and worked around it with a similar patch. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Proposal for optimized Blob handling
On Wed, Mar 07, 2007 at 06:31:25PM +0100, Christian Theune wrote: Am Mittwoch, den 07.03.2007, 14:01 -0300 schrieb Sidnei da Silva: What exactly do you mean by 'link'? As in 'soft links'? The uploaded file usually is a temporary file, so you are saying you would create a soft link on the 'blobs' directory to a file in the $TMP directory? Or maybe the other way around? No, I'd create a new hard link into the blob directory so the link to the temporary file can go away without making the inode go away. For the purposes of storing blobs the TMP directory should be on the same partition as the blobs directory anyway. I like the idea, but what will you do if this fails? (eg. the admin has put TMP on a different mount, or we're running on Windows). -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] Problem On Rebuild
On Mon, Mar 05, 2007 at 02:11:45PM -0500, [EMAIL PROTECTED] wrote: -Original Message- From: [EMAIL PROTECTED] To: zope@zope.org; [EMAIL PROTECTED] Sent: Mon, 5 Mar 2007 2:19 PM Subject: Re: [Zope] Problem On Rebuild I missed the beginning of this thread so i don't know if i missed something relevant, but url rewriting in general is often done within the front-end web server (eg. Apache). Logical, but this isn't done at the Web server. These sites go through Pound, which is a reverse proxy, then are actually served by Zope itself. Then again, perhaps they're rewritten in Zope's Web server! Where would that be, for 2.7.8? Most likely you have a Virtual Host Monster instance, with some configuration on the Mappings tab. See http://www.plope.com/Books/2_7Edition/VirtualHosting.stx -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to create a global variable?
On Thu, Feb 22, 2007 at 11:50:51AM +0100, jerome prudent wrote: Hi! I've a python script which creates a dictionnary each time it's called. This dictionnary is always the same. I would increase the performance if I could generate and cache the dictionnary once, then reuse it. I'm looking for a space like REQUEST.SESSION that is the same for each user of my website (other solutions are welcome). Do you know how to do that? RAM Cache Manager. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to get REST friendly urls from sql database
On Wed, Feb 21, 2007 at 12:32:30PM +0100, Gaute Amundsen wrote: On Tuesday 20 February 2007 17:39, Paul Winkler wrote: snip Another option is that the object at /articles could be an instance of a class that looks something like: class MyArticleContainer(): def __before_publishing_traverse__(self, unused, request): # Save the rest of the path as 'traverse_subpath'. request.set('traverse_subpath', reversed(request['TraversalRequestNameStack'])) # Tell the publisher to stop traversing now. request['TraversalRequestNameStack'][:] = [] def __call__(self, *args, **kw): subpath = self.REQUEST['traverse_subpath'] data = get_data_however_you_like(subpath) return data For background, read the stuff about traversal hooks at http://wiki.zope.org/zope2/ZPublisher Hm.. that looks more like what I had in mind when I posted, but allso quite a bit more overhead than rewriterules. At least for me that has never written a product. Well, it may feel like a lot of work to you the first time :-) I will have to think about that one.. Would you care to elaborate a little bit on what the tradeoffs would be? My approach might be good if: - the logic for looking up articles is more complex than can be comfortably expressed using apache rewrite rules, and/or - the logic for looking up articles requires state that's internal to zope. You could instead follow Andreas' suggestion and use a through-the-web Script. It might look something like: article_id = traverse_subpath[-1] data = context.get_the_data_somehow(article_id) return data Your URLs would then look like: http://example.com/folder_id/script_id/article_id Note that naming the script index_html doesn't really help, because http://example.com/folder_id/article_id wouldn't invoke the script. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to get REST friendly urls from sql database
On Tue, Feb 20, 2007 at 04:37:41PM +0100, Andreas Jung wrote: --On 20. Februar 2007 16:30:43 +0100 Gaute Amundsen [EMAIL PROTECTED] wrote: Hi. Normally a url to an article in our CMS system would look roughly like this: http://www.dom.tld/aritcles/25245 (snip) Anybody have any ideas on how this might be done? How about Apache rewrite rules or a script called index_html that fetches the object by its ID? That's pretty much boring straight-forward stuff :-) Another option is that the object at /articles could be an instance of a class that looks something like: class MyArticleContainer(): def __before_publishing_traverse__(self, unused, request): # Save the rest of the path as 'traverse_subpath'. request.set('traverse_subpath', reversed(request['TraversalRequestNameStack'])) # Tell the publisher to stop traversing now. request['TraversalRequestNameStack'][:] = [] def __call__(self, *args, **kw): subpath = self.REQUEST['traverse_subpath'] data = get_data_however_you_like(subpath) return data For background, read the stuff about traversal hooks at http://wiki.zope.org/zope2/ZPublisher -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Zope 2 and Zope 3
On Thu, Feb 15, 2007 at 11:50:38AM +0100, Philipp von Weitershausen wrote: What's already possible is to have a minimal ZODB with only one persistent object: a SQLObject or SQLAlchemy container. That's a container (e.g. like a folder) whose items aren't persisted in the ZODB but come from a relational database. This works fine in a Zope 2 / Five world too. We have apps that have nothing in the ZODB but a Z*DA instance. Then we have zope 3 views and adapters that acquire that instance and use it to talk to the database, using ZSQL to build the queries. We haven't drunk the ORM cool-aid yet. :) In other words: The ZODB may be there but you can pretty much ignore it if you don't need it :) You seem to already have come to the conclusion that having code live in both the filesystem and the ZODB can be painful. I think a good first step for you would be to migrate your remaining ZODB-based code to the filesystem. That not only makes deployment easier, you're also free to refactor it then (e.g. using Zope 3 idioms). In the long run, this also means saying good-bye to things like External Methods because they require code on the filesystem and configuration in the ZODB. +1 Here's my off-the-cuff attempt at How To Safely Move A Big Legacy App Out of the ZODB. First, get and install FSDump (google for it). Add a Dumper to a folder containing DTML (it works recursively on child folders too), configure the Dumper, click the Save and dump button, and voila, there's your code on the filesystem. It'll store properties too, in files named like *.metadata. Then you need a way to use the stuff from the filesystem. FileSystemSite would be ideal, because it understands those .metadata files: http://www.infrae.com/download/FileSystemSite Using it is a bit non-obvious if you're not familiar with CMF, from which it was extracted. You'll need to create a minimal Product on the filesystem that consists of: - a directory in Products, let's call it Products/mystuff - an __init__.py at Products/mystuff/__init__.py that looks like this: from Products.FileSystemSite.DirectoryView import registerDirectory registerDirectory('mysubdir, globals()) - a subdirectory at Products/mystuff/mysubdir. Put the files and directories you dumped in here. That's it. Restart Zope, add an instance of Filesystem Directory View, and you'll be prompted for the directory to choose; the only choice will be the mysubdir you registered above. Click OK and you're done. Check this new Product into source control and rejoice. One gotcha - files ending in .dtml will be treated as DTML Methods, not DTML Documents. So if you relied on the semantic difference between those, you will have some issues to sort out. Another gotcha - you'll need another plan to deal with those External Methods, since AFAIK neither Dumper nor FileSystemSite will handle them. One expedient if slightly tedious technique would be to just move the External Method files out of Extensions/ and into $INSTANCE_HOME/lib/python/. Then use calls to allow_module() so they can be imported by through-the-web code (google will tell you more about that). Then, delete each external method from the ZMI and in its place add a Script (Python) with the same id. Such a script would have a body something like: from my_ext_method_module import myExternalMethodFunction return myExternalMethodFunction(arguments) Once that's done, those scripts can be Dumped into your filesystem code, and all the DTML that includes calls to them should work. A final gotcha - if you have ZClasses, I can't help you :) At this point, you have the same application you started with, it's just on the filesystem. Not as clean as a rewrite, but a hell of a lot more expedient - faster and less risky. Next you'll want to start adding regression tests to your product (ZopeTestCase and Zelenium might be useful tools). Then you have a safety net so you can confidently start refactoring as needed. *This* is when you can start thinking about rewriting stuff :-) I'd put this email somewhere on zopewiki.org, but it seems to be down at the moment (Bad Gateway). It is certainly possible to execute filesystem-based DTML (using Globals.DTMLFile). Right. But that's a bit of a pain when you have dozens or hundreds of DTML methods and your first priority is just to get stuff out of the ZODB and into source control without breaking anything. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] python script syntax
On Wed, Feb 14, 2007 at 11:42:59PM +, garry saddington wrote: I want to do something like this in a script: forms='7L' context.forms.manage_addFolder('filey') ie. substitute the variable 'forms' for the correct value but I can not get the syntax correct, can anyone help? Look up getattr() in Python's documentation. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Interest in AdvancedQuery and/or ManagableIndex?
On Fri, Feb 02, 2007 at 10:36:37PM +0100, Dieter Maurer wrote: I have no problems to donate AdvancedQuery and/or Managable Index +1 from me. I haven't used Managable Index, but AdvancedQuery is great and more people should be aware of it. to the Zope Foundation *BUT* I will not modify the code to bring it in line with the different style requirements usually applied to Zope components: e.g. * my code uses 2 blank indentation rather than the usual 4 blank (to make it more readable and easier to maintain for me) are you saying you would refuse the donation if somebody else wanted to change it to 4 spaces? -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] debugging a wayward zope process
Google for deadlock debugger and debug spinning zope. -PW On Wed, Jan 24, 2007 at 03:11:52PM -0500, Timothy Ball wrote: I have a zope server (2.7.4) that I maintain and every now and then the python process that's running zope goes heywire and eats all of the cpu resources and basically make my website stop responding. Does anyone have any clues as to how I can debug this problem? I'm not the best python coder but I do know how to use pdb. And I'm looking for sorta where and what pieces would be the best place to start putting the trace() bits. ... but really any sort of guidance would help... here's a small bit from ps aux showing a bit of what I mean, but when it *really* goes heywire it just eats all of my cpu and causes the load to shoot up near the 50s (on a dual opteron 275 processor machine) USER PID %CPU %MEMVSZ RSS TTY STAT START TIME COMMAND zecms 4062 12.6 8.9 830640 718768 ? Sl Jan19 972:32 /thingie/src/bin/python /thingie/src/opt/Zope2/lib/python/Zope/Startup/run.py -C /www/zed/src/var/zope/etc/zope.conf TIA, --timball ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )