[Zope] buildout question
I'm using collective.recipe.patch to patch plone.recipe.zeoserver during a buildout. The problem is that after applying the patch the py file isn't consistently reloaded. If I look at the timestamps, I can see that the pyc file isn't always regenerated after the patch is applied. Is there anyway to force a reload with buildout? If I run buildout a 2nd time it then runs fine. TIA, - Jim parts = patches zeo [patches] recipe = collective.recipe.patch egg = plone.recipe.zeoserver patches = patches\plone.recipe.zeoserver.__init__.py.patch [zeo] recipe = plone.recipe.zeoserver zeo-address = ${buildout:zeo-address} zeo-log = ${buildout:directory}\var\zeoserver\zeoserver.log pid-file = ${buildout:directory}\var\zeoserver\zeoserver.pid socket-name = ${buildout:directory}\var\zeoserver\zeo.zdsock blob-storage = ${buildout:directory}\var\zeoblobstorage An internal error occured due to a bug in either zc.buildout or in a recipe being used: Traceback (most recent call last): File "C:\Python26\lib\site-packages\zc.buildout-1.5.0b2-py2.6.egg\zc\buildout\ buildout.py", line 1660, in main getattr(buildout, command)(args) File "C:\Python26\lib\site-packages\zc.buildout-1.5.0b2-py2.6.egg\zc\buildout\ buildout.py", line 532, in install installed_files = self[part]._call(recipe.install) File "C:\Python26\lib\site-packages\zc.buildout-1.5.0b2-py2.6.egg\zc\buildout\ buildout.py", line 1204, in _call return f() File "c:\zope\buildout\eggs\plone.recipe.zeoserver-1.1a2-py2.6.egg\plone\recip e\zeoserver\__init__.py", line 85, in install self.install_scripts() File "c:\zope\buildout\eggs\plone.recipe.zeoserver-1.1a2-py2.6.egg\plone\recip e\zeoserver\__init__.py", line 333, in install_scripts #extra_paths.append(ws.by_key['zc.buildout'].location) KeyError: 'zc.buildout' C:\Zope\Buildout> ___ 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 )
[Zope] Older Zope w/newer CA packages
We are currently on Zope 2.9.6 and we are working on upgrading but it isn't going to happen anytime soon. I'm trying to use a package that is depending on a few newer component architecture packages; zope.component, zope.interface... Even though zope.component and zope.interface hadn't been egged in 2.9.6, Zope Products seem to import from zope.component in Python lib instead of zope/component in the Zope. Is there any clean way to isolate the newer packages? If its possible this might actually help with a gradual upgrade as well. Any recommendations or techniques would be most useful. TIA, - Jim ___ 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] using formlib for nonclasic content types
I went through the same motions as you in Zope2.12 trying to use Phillkon's book as a guide. I think I ran into the same problem as you. The key is in the package five.localsitemanager. My Site Interface is nothing. class IMySite(Interface): """My Site"" In my site.py I have the following. ... from five.localsitemanager import make_objectmanager_site ... class MySite(Folder): implements(IMySite) def __init__(self, id): setHooks() Folder.__init__(self, id='Mine') make_objectmanager_site(self) <- key to making a OFS folder a site setSite(self) notify(NewMySiteEvent(self) After that you can treat your MySite OFS Folder like a site. Register utilities with it, setHooks, and setSite. Hope this helps, - Jim On Thu, Jan 28, 2010 at 2:40 AM, Roberto Allende wrote: > Hello > > Following example 18.3.1 and 18.3.2 from phillkon's book, i'm trying to > define a MySite class in Zope 2.12, which look like this: > > > class IMySite(IPossibleSite, IContainer): > """ > """ > id = ASCIILine( ... > name = TextLine( ... > > > class MySite(SiteManagerContainer, BTreeContainer): > implements(IMySite) > > So far so good, i've an interface and a class extending > SiteManagerContainer and BTreeContainer. Problem becomes when i want to > define the add form. If i'm not wrong, I cannot use the same machinery > as zope3, so i was trying to use formlib: > > class MySiteAddForm(AddForm): > form_fields=form.Fields(IListo) > > And i doesn't work. The error i'm getting is: > > NotImplementedError: concrete classes must implement create() or > createAndAdd() > > I was looking info about them but i wonder i'm running with a conceptual > gap here, because this is the same problem i had to define MySite > inheriting from Folder. The same problem happened there, i was able to > define the class but when i needed the form i wasn't able to use formlib > and i used old-zope2-like-code. Probably i could try to do smt like > that, but i'm very curious to see how can i use formlib in such cases. > > The question then is, is it possible or would it make sense to do > something like this ?. Do you know about a sample code that could be > helpful ?. > > Any comment or hint would be very appreciated. > > Kind Regards > r. > > -- > http://robertoallende.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 ) > ___ 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 )
[Zope] Five EditFrom and Fields appears broken
Does anyone successfully use zope.formlib.form Fields with Products.Five.formlib.formbase EditForm? I was trying to figure out why my form_fields.omit and custom_widget were being ignored. I followed it up the stack and found the method setUpEditWidgets in zope.app.form.utility never takes Fields into account and just looks at the schema and context to determine the fields. So I was starting to think maybe you don't use Fields with Five forms, but there is a unit test in Products.Five.formlib.tests view.py that actually thinks its using Fields. I don't think this is actually the case though, the test just doesn't touch omit or custom_widget functionality so it passes thinking Fields is working. The /Products/Five/form/__init__.py imports zope.app.form.utility setUpEditWidgets. zope.formlib has a different setUpEditWidgets method in zope/formlib/form.py that actually takes form_fields as the 1st param. So in summary, if you think your using Fields in Five try using omit or custom_widget and see if it works and you actually are really using Fields. If it works maybe I have something messed up on my end. TIA - Jim ___ 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] utilities @ the site level
So createObject does look in the context of the current site. My issue was somewhere else. I'm still interested to know if you can register utilities at the site level in ZCML though. On Wed, Dec 30, 2009 at 3:22 PM, Jim Pharis wrote: > I should clarify that createobject is failing with a ComponentLookupError. > > > On Wed, Dec 30, 2009 at 2:45 PM, Jim Pharis wrote: > >> >> Can I register utilities at the site level in zcml? And once I have the >> local utility registered, how do I pass that site manager context to my >> browser/forms so I can do things like createObject. createObject seems to >> fail because it can't find the utility, but I think that's because its not >> looking for the utililty at the site level. >> >> I'm using Zope2.12 w/five.localsitemanager. >> >> Thanks, >> >> - Jim >> >> > ___ 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] utilities @ the site level
I should clarify that createobject is failing with a ComponentLookupError. On Wed, Dec 30, 2009 at 2:45 PM, Jim Pharis wrote: > > Can I register utilities at the site level in zcml? And once I have the > local utility registered, how do I pass that site manager context to my > browser/forms so I can do things like createObject. createObject seems to > fail because it can't find the utility, but I think that's because its not > looking for the utililty at the site level. > > I'm using Zope2.12 w/five.localsitemanager. > > Thanks, > > - Jim > > ___ 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 )
[Zope] utilities @ the site level
Can I register utilities at the site level in zcml? And once I have the local utility registered, how do I pass that site manager context to my browser/forms so I can do things like createObject. createObject seems to fail because it can't find the utility, but I think that's because its not looking for the utililty at the site level. I'm using Zope2.12 w/five.localsitemanager. Thanks, - Jim ___ 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] Zope2.12
I know of Five but I must admit I'm not that well acquainted with it. On the contrary, I was under the impression that Five was going to be falling out of usefulness as ZTK was being integrated in Z2. Thanks for clearing this up for me. On Fri, Dec 25, 2009 at 9:11 AM, Lennart Regebro wrote: > On Fri, Dec 25, 2009 at 11:47, Jim Pharis wrote: > > What's my use case for developing Zope3ish/ZTKish in Zope2 instead of > just > > using Zope3? All the preceived benefits of Zope3 now available in Zope2 > well > > still being able to use all our Zope 2 Products. I thought basing > Zope2.12 > > on ZTK bridged the 2 worlds. > > Nah, it was bridged before, by Five. Now it's easier to update just > one package and it's dependencies to later versions, and easier to > install and use in buildouts and stuff. A great leap forward. But > using Zope3 stuff in Zope 2 has been possible since Zope 2.8. It's not > completely compatible, but that's not what you are asking for eiher, > if I understand you. > > -- > Lennart Regebro: Python, Zope, Plone, Grok > http://regebro.wordpress.com/ > +33 661 58 14 64 > ___ 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] Zope2.12
So far I had just tried developing a site and allow it to be Added and Viewed in the ZMI. In the Z2.12 instance/etc/site.zcml I have... In the browser dir I put a configure.zcml. ZopeXMLConfigurationError: File "/home/binbrain/Programs/Zope2.12/instance/lib/python/Test/browser/configure.zcml", line 14.2 ConfigurationError: ('Unknown directive', u' http://namespaces.zope.org/browser', u'containerViews') So containerView is declared in ./zope.app.container-3.8.0-py2.6.egg/zope/app/container/browser/meta.zcml and I proceeded to just add it etc/site.zcml. That's when I noticed that the package-includes were by in large missing. At least it looks that way. On Fri, Dec 25, 2009 at 7:56 AM, Jens Vagelpohl wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Pharis wrote: > > Yes, I'm running into missing bits in various places. So even though > Z2.12 > > is based on ZTK eggs, and ZTK eggs are designed using all the CA > goodness, I > > still can't easily develop using those methods. So I'm left leaving this > > conversation thinking that I'm back to developing Products using the > > esoteric manage_* methods, even in 2.12. > > The component architecture is fully entrenched within Zope 2.12 and you > can use it just like you were able to use it in Zope 3. However, since > the ZTK is not Zope 3, you won't have all Zope 3 facilities available, > that's a fact of life. Why you conclude that you're somehow forced to > use "esoteric manage_* methods" I am note sure. > > Maybe someone can help if you mention specific code where you think you > cannot develop the Zope 3 way. > > jens > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.8 (Darwin) > > iEYEARECAAYFAks0tmcACgkQRAx5nvEhZLI5HgCgnxAapQcX6MJtI/Lfuou2CHzZ > IPMAnAvEdcegdQ8TnK1JqKD5w0e4+pLV > =KJ4B > -END PGP SIGNATURE- > ___ > 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 ) > ___ 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] Zope2.12
Yes, I'm running into missing bits in various places. So even though Z2.12 is based on ZTK eggs, and ZTK eggs are designed using all the CA goodness, I still can't easily develop using those methods. So I'm left leaving this conversation thinking that I'm back to developing Products using the esoteric manage_* methods, even in 2.12. On Fri, Dec 25, 2009 at 7:13 AM, Jens Vagelpohl wrote: > -BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jim Pharis wrote: > > I have several existing Z2 Products that aren't going anywhere. I still > need > > these. I can't just move to Z3 and leave our existing Z2 Products behind. > > There seems to be a misunderstanding what the ZTK is and what it isn't. > > The ZTK is *not* Zope 3, it is a bundle of libraries distilled from what > used to be Zope 3. It does not include all of Zope 3, but those bits > that were deemed to be useful for re-use. If there is any expectation > that you can take a Zope 3 application and it will run unter Zope 2.12 > "because it's based on the ZTK" then that's wrong. You will run into > missing bits. > > jens > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.8 (Darwin) > > iEYEARECAAYFAks0rF8ACgkQRAx5nvEhZLJOlQCgtI+U//EjdgSZjqtLqvmBXCrb > ocIAn1gVbBYw7wsPcHSW/CNF9Z55VcZf > =9Yvc > -END PGP SIGNATURE- > ___ > 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 ) > ___ 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] Zope2.12
I have several existing Z2 Products that aren't going anywhere. I still need these. I can't just move to Z3 and leave our existing Z2 Products behind. On Fri, Dec 25, 2009 at 6:40 AM, Andreas Jung wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Pharis wrote: > > > > > > I want to start developing new stuff using CA paradigms in Z2. > > So *why* Zope 2? > > The ZTK/Zope 3 modules provide a much cleaner > basis for new projects than the Zope 2 app-server. So what is > in Zope 3/ZTK missing? Why do you need a cruft of infrastructure > for your new project? > > - -aj > > > > This seems like it should now be possible because Z2.12 itself is > > now built on ZTK. However, I'm running into problems. For example, > > zcml directives such as the one in > > zope.app.container-3.8.0-py2.6.egg/zope/app/container/browser/meta.zcml: > > > > > name="containerViews" aren't wired into Z2.12 it seems. Trying to > > use > That's just 1 example. Well I could start wiring all this stuff > > myself, it seems like that should be done already. > > > > - Jim > > > > On Fri, Dec 25, 2009 at 5:51 AM, Andreas Jung > <mailto:li...@zopyx.com>> wrote: > > > > Jim Pharis wrote: > >> What's my use case for developing Zope3ish/ZTKish in Zope2 > >> instead of just using Zope3? All the preceived benefits of Zope3 > >> now available in Zope2 well still being able to use all our Zope > >> 2 Products. I thought basing Zope2.12 on ZTK bridged the 2 > >> worlds. > > > > > > Do you want to develop a minimal ZTK/Zope-3 based application? So > > you don't deal with the 10-year old code cruft of Zope 2 - or? What > > is in the Zope 3/ZTK modules not missing? > > > > -aj > > - -- > ZOPYX Ltd. & Co KG \ zopyx group > Charlottenstr. 37/1 \ The full-service network for your > D-72070 Tübingen \ Python, Zope and Plone projects > www.zopyx.com, i...@zopyx.com \ www.zopyxgroup.com > - > E-Publishing, Python, Zope & Plone development, Consulting > > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAks0pMgACgkQCJIWIbr9KYzuNgCfaDpgqWOzvZNeAkHUdq6I8K5D > FA4An1O5WO5982rIdmBMb8NOGPrRJ4Yp > =Xapn > -END PGP SIGNATURE- > > ___ 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] Zope2.12
So developing in Z3 had several perceived benefits no? The problem is that in many cases existing projects couldn't just move to Z3 and start using the CA. From Z3 development was born ZTK, a modular CA implementation that Z2 could now leverage, and I thought in theory all the Z3 CA goodness was now brought to us in Z2 development. I have several existing Z2 Products that aren't going anywhere. Now I want to start developing new stuff using CA paradigms in Z2. This seems like it should now be possible because Z2.12 itself is now built on ZTK. However, I'm running into problems. For example, zcml directives such as the one in zope.app.container-3.8.0-py2.6.egg/zope/app/container/browser/meta.zcml: name="containerViews" aren't wired into Z2.12 it seems. Trying to use wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Pharis wrote: > > What's my use case for developing Zope3ish/ZTKish in Zope2 instead > > of just using Zope3? All the preceived benefits of Zope3 now > > available in Zope2 well still being able to use all our Zope 2 > > Products. I thought basing Zope2.12 on ZTK bridged the 2 worlds. > > > > Do you want to develop a minimal ZTK/Zope-3 based application? > So you don't deal with the 10-year old code cruft of Zope 2 - > or? What is in the Zope 3/ZTK modules not missing? > > - -aj > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAks0mU0ACgkQCJIWIbr9KYzAtQCgkX3rQrzfRHg80z9ny4MDDAIp > T+0An3TuQMzvQ2V2MEWbXzSQ1barzs8W > =q+u9 > -END PGP SIGNATURE- > > ___ 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] Zope2.12
So the line you reference in site.zcml is the same for me, and it says look in package-includes/*-configure.zcml. That child dir wasn't actually created though so theres nothing in it. On Fri, Dec 25, 2009 at 4:47 AM, Lennart Regebro wrote: > On Fri, Dec 25, 2009 at 01:28, Jim Pharis wrote: > > I'm trying to wrap my head around what the changes in Zope2.12 can mean > for > > how I develop in Zope2 now. I've developed things in Zope3 and am getting > > stuck attempting the same methods in Zope2.12. So I see now that etc/ now > > has a site.zcml. But what is missing is the package-includes directory > that > > provides the wiring to zcml directives in the varies packages. Why are > those > > configurations missing from Zope2.12.2 etc/? > > They are? > > $ /opt/python26/bin/virtualenv z12 > $ cd z12 > $ bin/easy_install Zope2 > $ bin/mkzopeinstance -d testinst > $ cd testinst > $ more etc/site.zcml > > ... > > > ... > > Looks like it's there. OK, so the directory doesn't exist, but you can > create it. > > Most people today develop using buildout, where the zope instance > recipe will create the snippets for you. But that's a different topic, > really. > > -- > Lennart Regebro: Python, Zope, Plone, Grok > http://regebro.wordpress.com/ > +33 661 58 14 64 > ___ 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] Zope2.12
What's my use case for developing Zope3ish/ZTKish in Zope2 instead of just using Zope3? All the preceived benefits of Zope3 now available in Zope2 well still being able to use all our Zope 2 Products. I thought basing Zope2.12 on ZTK bridged the 2 worlds. On Fri, Dec 25, 2009 at 2:10 AM, Andreas Jung wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Pharis wrote: > > Perhaps I'm misunderstanding the implications of basing Zope2.12 > > on ZTK eggs. I was under the impression it would allow sites to be > > developed in a similar way to how its done in Zope3, ie placing > > your site in instance/lib/python/ and wiring it all together > > using the site.zcml now present in the Zope2.12 instance/etc dir. > > It seems like it should be possible, but maybe not. > > > Please describe you usecase for using Zope 2 for building a Zope3/ZTK-ish > application and not using the related Zope 3/ZTK components? > > - -aj > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAks0ZUwACgkQCJIWIbr9KYwSPgCgtNHieCrAndDIbqY6JryzfZKc > CNwAoLiO16+PUGpsrtH/VhogQctGDzvP > =hhFu > -END PGP SIGNATURE- > > ___ 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] Zope2.12
Perhaps I'm misunderstanding the implications of basing Zope2.12 on ZTK eggs. I was under the impression it would allow sites to be developed in a similar way to how its done in Zope3, ie placing your site in instance/lib/python/ and wiring it all together using the site.zcml now present in the Zope2.12 instance/etc dir. It seems like it should be possible, but maybe not. On Thu, Dec 24, 2009 at 11:20 PM, Andreas Jung wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Pharis wrote: > > I'm trying to wrap my head around what the changes in Zope2.12 can > > mean for how I develop in Zope2 now. I've developed things in > > Zope3 and am getting stuck attempting the same methods in Zope2.12. > > So I see now that etc/ now has a site.zcml. But what is missing is > > the package-includes directory that provides the wiring to zcml > > directives in the varies packages. Why are those configurations > > missing from Zope2.12.2 etc/? > Sorry, I can not follow - but Zope 2 and Zope 3 are not compatible in > any way. > - -aj > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAks0PYwACgkQCJIWIbr9KYxAPACffzJnlM2SFGU2I2a0FbVnICbn > e6wAoKNXl3YrvBU7wMrRE/aMnatb+FT+ > =0ADb > -END PGP SIGNATURE- > > ___ 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 )
[Zope] Zope2.12
I'm trying to wrap my head around what the changes in Zope2.12 can mean for how I develop in Zope2 now. I've developed things in Zope3 and am getting stuck attempting the same methods in Zope2.12. So I see now that etc/ now has a site.zcml. But what is missing is the package-includes directory that provides the wiring to zcml directives in the varies packages. Why are those configurations missing from Zope2.12.2 etc/? I am trying to make it so a site can be added the same it is added in the Web Component Development with Zope 3 book and finding that the browser directives that declare the menu item and container view are missing from the wiring. Overall, it would be helpful for the Zope2.12 documentation to give a better idea about how to develop in the new ZTK way. I'm sure someone is working on it though. Thanks, - Jim ___ 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] Zope and wxPython interface
Lumír Jasiok wrote: > David Bear wrote: >> What do you gain by doing this? >> >> On Wed, Aug 12, 2009 at 2:50 PM, Lumir Jasiok > <mailto:lumir.jas...@vsb.cz>> wrote: >> >> Hi, >> >> I need to write an application which will be based on MVC design and >> will have both web interface and desktop GUI based on wxPython. It is >> possible to write such an application as standard Zope app and use >> zope.interfaces package for defining wxPython GUI as other view >> (I hope >> that it's called view, I am not sure - I am new in Zope >> programming)? Or >> am I totally wrong? >> >> Best Regards >> >> Lumir Jasiok >> >> -- >> Lumír Jasiok >> VSB-TU Ostrava - Computer centre >> Tel: +420 59 732 3189 >> E-mail: lumir.jas...@vsb.cz <mailto:lumir.jas...@vsb.cz> >> http://www.vsb.cz >> >> >> > I want to have an application with common code for both web and > desktop application, so data and business logic will be common and > only thing which will be different will be a view (web page or desktop > application GUI). So users will have choice what interface they want > to use, data will be same. > > As programmer I want to have common code for business logic, because > of simplicity. I don't want to have two trunks, two business logics etc. > Hi, Lumir You might take a look at pyjamas (http://pyjs.org). Using pyjamas, you can have common code for business logic and also for the GUI on web and desktop. The main data transfer/persistence mechanism in pyjamas is JSON-RPC, so that part of the model can be zope or anything that can do JSON-RPC. If you like wxPython GUI code, pyjamas code is very similar, and there are examples using PureMVC (http://puremvc.org) in the repository. You cannot, at present, use zope.interface to do automatic widget generation in pyjamas. On the other hand, it is really easy to do custom widgets and client-side display logic. You write your widgets and their behavior in python, not in HTML and javascript. Styling, however, can be done with css. In the eight months since I first experimented with pyjamas (http://www.mail-archive.com/zope@zope.org/msg31618.html), it has improved substantially. Fewer gotchas. More joy. Worth a look. - Jim Washington ___ 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] [Zope-dev] Zope 4.0, maybe not such a bad idea...
On Apr 2, 2009, at 4:17 PM, Chris Withers wrote: > Jim Fulton wrote: >>> What Martijn has announced and is already being worked on >>> extensively. >>> >>> - Zope A 4.0 >>> >>> What was to be Zope 2.12 >>> >>> - Zope B 4.0 >>> >>> Whatever the next pending release of the Zope 3 appserver stuff >>> was to >>> be. (Need to keep the Canonical and ZC guys happy afterall ;-) ) >>> >>> www.zope.org could then just be a radically cut down link portal to >>> a.zope.org, b.zope.org and framework.zope.org, which I'd imagine >>> to be >>> brochurewear, download and/or KGS sites for each of the above. >>> >>> I'd suggesting splitting the svn access stuff out to dev.zope.org >>> because it transcends all three. >>> >>> docs.zope.org could hoover up the rest, with any remaining stuff >>> being >>> humanely dispatched. >>> >>> Seriously, how do people feel about this? >> I don't think we need A&B. Maybe just "Zope" and "Zope Framework". > > Unfortunately, as we discovered at the BOF, and what is currently a > significant cause of confusion, is that the "Zope" bit isn't just > one thing, we basically have two app-server projects named Zope > right now: > > - Zope 2 > > Used by Plone, and a few die-hard stragglers and unfortunate > passerby's who get sucked in by the rubbish on www.zope.org > > - Zope 3 > > Use by Canonical for Launchpad and (well, was suspected anyway) by > ZC. I'm sure there are more. We and canonical use the Zope Framework. We don't use an application. Zope (aka Zope 2) is an extensible application. We (ZC and Canonical and others) assemble components from the Zope Framework to build our own applications. Jim -- Jim Fulton Zope Corporation ___ 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] [Zope-dev] Zope 4.0, maybe not such a bad idea...
On Apr 2, 2009, at 3:57 PM, Chris Withers wrote: > Remember this: > > http://www.perl.com/pub/a/2001/04/01/parrot.htm > > Well, that lead to this: > > http://www.parrot.org/ > > One of the reasons I got suckered into replying was that I thought > this > might be the result of some stuff a few of us had talked about at the > Zope BOF at PyCon. > > I actually think having a 4.0 release of Zope that unifies things > could > be used to make things a lot clearer... > > - Zope Framework 4.0 > > What Martijn has announced and is already being worked on extensively. > > - Zope A 4.0 > > What was to be Zope 2.12 > > - Zope B 4.0 > > Whatever the next pending release of the Zope 3 appserver stuff was to > be. (Need to keep the Canonical and ZC guys happy afterall ;-) ) > > www.zope.org could then just be a radically cut down link portal to > a.zope.org, b.zope.org and framework.zope.org, which I'd imagine to be > brochurewear, download and/or KGS sites for each of the above. > > I'd suggesting splitting the svn access stuff out to dev.zope.org > because it transcends all three. > > docs.zope.org could hoover up the rest, with any remaining stuff being > humanely dispatched. > > Seriously, how do people feel about this? I don't think we need A&B. Maybe just "Zope" and "Zope Framework". I like the idea of using a number larger than 3. (I've suggested 5 in the past.) Overall +1. Jim -- Jim Fulton Zope Corporation ___ 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] Experiment: Pyjamas with Zope
Quick note. I found that The "fix pyjamas" question in my previous note could be handled with a ~100 line python module that makes a new class descending from pyjamas.HTTPRequest.HTTPRequest, but overriding asyncPostImpl with a supported content-type, e.g., "application/json". The module is mostly copy-paste from pyjamas.JSONService and pyjamas.HTTPRequest, but I'll provide it to anyone interested. It was really simple to do. Kudos to pyjamas for making fixes easy. - Jim Washington ___ 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] Experiment: Pyjamas with Zope
So, I have a need to put together a more elaborate web page. Lots of pop-up dialog boxes and dynamically-updated choice lists. How to do that? I take a look at Pyjamas http://pyjs.org. Pretty cool. Here's the theory. Write fancy application web page in python using the Pyjamas/GWT API, then "compile" it to javascript. Serve it through zope, which will handle auth/auth. Client-server communication flows through json-rpc calls. What could possibly go wrong? First-off, just a simple test-of-concept. Edit the JSONRPCExample.py file in the examples/jsonrpc folder that came with pyjamas. I'll locate the jsonrpc service in zope's containment root, so I change the uri in EchoServicePython from "/services/EchoService.py" to "/". That's all I need to change. Compile it using the handy "build.sh" that's in the same folder. Look in the "output" folder and see what we got. Wow. a bunch of files. JSONRPCExample.IE6.cache.html Mozilla.cache.html OldMoz.cache.html Opera.cache.html Safari.cache.html JSONRPCExample.html JSONRPCExample.nocache.html corner_dialog_bottomleft.png corner_dialog_bottomleft_black.png corner_dialog_bottomright.png corner_dialog_bottomright_black.png corner_dialog_edge.png corner_dialog_edge_black.png corner_dialog_topleft.png corner_dialog_topleft_black.png corner_dialog_topright.png corner_dialog_topright_black.png history.html pygwt.js tree_closed.gif tree_open.gif tree_white.gif I'm lazy, so instead of doing a bunch of resource or view directives in ZCML, I let my paste.ini do the handling. [app:pyjs1] use=egg:Paste#static document_root=/home/jwashin/projects/pyjamas/pyjamas-0.4/examples/jsonrpc/output then, I link that in with the composite app. [composite:Paste.Main] use = egg:Paste#urlmap / = zope /images = images /pyjs1 = pyjs1 Now, to get to JSONRPCExample.html, I need to go to http://website/pyjs1/JSONRPCExample.html But first, I need to actually handle the json-rpc requests in zope. Make a servicetest.py. Almost exactly similar to EchoService.py in the output/services folder. from zif.jsonserver.jsonrpc import MethodPublisher class Services(MethodPublisher): def echo(self, msg): return msg def reverse(self, msg): return msg[::-1] def uppercase(self, msg): return msg.upper() def lowercase(self, msg): return msg.lower() Now, a ZCML incantation. Start zope, and go to http://website/pyjs1/JSONRPCExample.html Nice page. Click the "Send to Python Service" button. Server Error or Invalid Response: ERROR 0 - Server Error or Invalid Response Damn. Pull up tcpwatch and see what we are getting. Aha. pyjamas app is sending jsonrpc with a content-type of application/x-www-form-urlencoded, so zope is not handing it off to zif.jsonserver for handling. Fix pyjamas or let zif.jsonserver handle this content-type? In zif.jsonserver's configure.zcml, in the "publisher" directive, add application/x-www-form-urlencoded to mimetypes. Restart zope. Go to http://website/pyjs1/JSONRPCExample.html It works. Change permissions in the jsonrpc:view directive. Restart zope. Go to the page. Page loads. Push the button, and I get a Basic HTTP Authentication dialog. Nice. Overall Results: So far, so good. :) - Jim Washington ___ 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] Re: [Zope3-Users] is it possible to copy object b/w two zodb Database
On Jun 11, 2008, at 10:36 AM, rahul bhaskar wrote: Hi, I am facing some problem with merging two zodb file. is it possible to open two zodb Database at a time and copy object from one to another. Yes, using the export/import mechanism. Jim -- Jim Fulton Zope Corporation ___ 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] Re: Hooking persistent.Persistent.__setstate__ was Re: [ZODB-Dev] Analyzing a ZODB.
On Apr 5, 2008, at 6:30 PM, Alan Runyan wrote: Here is something more ZODB and less Zope related (kinda). I was talking with Benji a few weeks ago about a problem that should be easy to debug but was not. Here is the scenerio: - Customer has software on a remote machine. They are seeing unnecessary transaction commits. Just like the guy 'Analyzing a ZODB'. - Customer is completely incapable of doing anything other than putting a script on the filesystem. - Benji and I thought about it and he proposed 'the simplest thing that c/should work, monkey patch persistent.__setstate__' so that I could see what objects were being mutated. That doesn't show you which objects are being mutated. It only shows you which objects are being loaded. If you want to see what objects are actually being mutated, it would be better, IMO, to set up some sort of event channel on object invalidations. If you want to see what code is mutating objects, it would be better to set breakpoints in Connection.register. - Unfortunately ZODB 3.x does not have a Python fallback of persistent.Persistent -- its in C. The customer did not have a C compiler on their box. IIRC how I solved it was increase ZEO event log to see the oid's. Then I walked him through loading the oid up to see what object was being mutated. It was more painful than it should have been. Yup, but automating something like this might have been informative without being painful. Question: Is it possible for ZODB 3.9 to have a pure python implementation of persistent.Persistent? Probably. Maybe this would be a good ZODB GSOC project? The current C-level persistence implementation is rather nasty because of the close coupling with the persistent cache implementation. My goal is to come up with a new persistence implementation that is much simpler and more flexible with both Python and C implementations. I haven't had time to work on this though. :( If someone wanted to work on this, I'd be happy to go into more detail. ... - increasing zeo server log level and watching oid's being changed is sort-of the equivalent of turning on RDBMS logging to see SQL stmt's being executed. Unfortunately I believe without having a hook in persistent.Persistent we can never really get that level of granularity (i.e. __getattribute__ is only accessible in client) with only ZEO server logs. Regardless of whether it's implementation is in C or Python, the current implementation is complex and highly coupled. A more flexible system that I envision, would make it easier to experiment with alternate cache implementations and would also make it easier to substitute implementations that did more logging for debugging purposes. This is a transparent plea for a "new feature". But I believe it would significantly help people writing ZODB applications. Maybe people should always have a base class that you override those methods which delegate to persistent.Persistent. i.e. class MyMixin(persistent.Persistent) and mixin MyMixin instead of mixin persistent.Persistent directly? Then you can instrument the MyMixin with the logging? That would introduce lots of overhead and complexity that I don't think is warranted. Jim -- Jim Fulton Zope Corporation ___ 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] Re: [ZODB-Dev] Analyzing a ZODB.
On Apr 5, 2008, at 12:09 PM, Manuel Vazquez Acosta wrote: In a development environment, set a breakpoint (e.g. add "import pdb; pdb.set_trace()" in ZODB.Connection.Connection.register. You'll be able to see exactly what is causing object changes. I recommend doing this in the zope debugger, which makes it easy to run one request at a time. Dear Mr. Fulton, Thanks for your quick response By the zope debugger you mean this: http://www.simplistix.co.uk/software/zope/zdb ?? No, I mean the built-in debugger you get when you run: zopectl debug Get someone familiar with Zope to explain it to you. Jim -- Jim Fulton Zope Corporation ___ 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] Re: [ZODB-Dev] Analyzing a ZODB.
On Apr 5, 2008, at 11:49 AM, Manuel Vazquez Acosta wrote: Hi all, Recently I was appointed to improve a Plone's performance, and I have the following issue: I see too many transactions made by the anonymous user. I can reproduce this behaviour: just watching the home page produces a transaction at /index by None. I wonder if there's a way to actually see what objects (or object types) are modified by those transactions. So I can go directly to the source of the (surely innecesary) transaction. I tried analyze.py but I don't grasp the output accurately. In a development environment, set a breakpoint (e.g. add "import pdb; pdb.set_trace()" in ZODB.Connection.Connection.register. You'll be able to see exactly what is causing object changes. I recommend doing this in the zope debugger, which makes it easy to run one request at a time. Jim -- Jim Fulton Zope Corporation ___ 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] zip files corrupted with IE when opened, fine when downloaded
Jim Washington wrote: robert rottermann wrote: Hi there, we have a problem with an intranet that runs using plone 2.5.3 when users using IE want to open a zip file from the intranet by using the "open" option from the download dialog they get winzip complaining that the file is corrupted. if they select "save" from the same dialog they can open the zip archive without problem. does anyone know a solution for this or give me an idea where to look for one? I had a similar problem with pdf files, and googling indicated that IE might be deleting the cached copy of the document before the opening application can get to it. I have had some success setting cache control to "private". Something like: request.response.setHeader('cache-control','private') "private,must-revalidate" may also be a good value, depending on your situation. I Googled back through and found that the problem usually manifests when you have a 'cache-control':'no-cache' header. The above explanation was not quite right. Anyway, either removing the "no-cache" header or using one that allows the local machine to keep a copy should work, if the problem is in fact a 'no-cache' header. - Jim Washington ___ 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] zip files corrupted with IE when opened, fine when downloaded
robert rottermann wrote: Hi there, we have a problem with an intranet that runs using plone 2.5.3 when users using IE want to open a zip file from the intranet by using the "open" option from the download dialog they get winzip complaining that the file is corrupted. if they select "save" from the same dialog they can open the zip archive without problem. does anyone know a solution for this or give me an idea where to look for one? I had a similar problem with pdf files, and googling indicated that IE might be deleting the cached copy of the document before the opening application can get to it. I have had some success setting cache control to "private". Something like: request.response.setHeader('cache-control','private') "private,must-revalidate" may also be a good value, depending on your situation. It's worth a try... - Jim Washington ___ 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] ANNOUNCE: zif.sedna-0.9beta
The Zif Collective is proud to announce yet another confusing option for your applications. Sedna is a "native" XML database, open source, licensed under Apache 2.0 license. See http://modis.ispras.ru/sedna/ for features and download. zif.sedna communicates with Sedna. zif.sedna provides a dbapi-like interface (connections and cursors). zif.sedna provides a zope(3) database adapter and connection pooling (thanks to some code from sqlalchemy). It is provisionally thread-safe. zif.sedna is pure python. XQuery can be cool. zif.sedna is now available at the cheese shop. http://pypi.python.org/pypi/ The readme came out a bit funny there. I know there were some < and > in the document when I wrote it, so you will have to use your imagination a bit to read the blurb. Or easy_install it and read the docs as they were intended. -Jim Washington ___ 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] suddenly confused
David Bear wrote: > I'm doing my first zeo setup, and suddenly I'm not sure about my > products directory. Do I put all products in a products directory of > the zeo server or in each zope instance? > > IIRC, Products go in each zope instance. The zeo instance gets the ZODB. -Jim Washington ___ 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] repozo.py problems
I'm going to dig up something that's really troubling me today, and a "Martin Koekenberg" in the past. Martin first posted the following about repozo.py. Traceback (most recent call last): File "C:\Program Files\Plone 3\Zope\bin\repozo.py", line 76, in from ZODB.FileStorage import FileStorage ImportError: No module named ZODB.FileStorage Which, it was noted was a problem with PYTHONPATH not being set. One question I have is why plone3 installlation does not set this variable on installation? So I set it and now have the following problem (note I slightly modified repozo.py to print our sys.path before importing.) C:\Program Files\Plone 3\Zope\bin>repozo.py ['C:\\Program Files\\Plone 3\\Zope\\bin', 'c:\\Program Files\\Plone 3\\Zope\\lib \\python', 'C:\\WINNT\\system32\\python25.zip', 'c:\\Python25\\DLLs', 'c:\\Pytho n25\\lib', 'c:\\Python25\\lib\\plat-win', 'c:\\Python25\\lib\\lib-tk', 'C:\\Pyth on25', 'c:\\Python25\\lib\\site-packages', 'c:\\Python25\\lib\\site-packages\\wi n32', 'c:\\Python25\\lib\\site-packages\\win32\\lib', 'c:\\Python25\\lib\\site-p ackages\\Pythonwin'] Traceback (most recent call last): File "C:\Program Files\Plone 3\Zope\bin\repozo.py", line 75, in from ZODB.FileStorage import FileStorage File "c:\Program Files\Plone 3\Zope\lib\python\ZODB\__init__.py", line 20, in from persistent import TimeStamp File "c:\Program Files\Plone 3\Zope\lib\python\persistent\__init__.py", line 1 9, in from cPersistence import Persistent, GHOST, UPTODATE, CHANGED, STICKY ImportError: DLL load failed: The specified module could not be found. >From the following, it's pretty clear that the cPersistence.pyd file is >present. C:\Program Files\Plone 3\Zope\lib\python\persistent>dir Volume in drive C has no label. Volume Serial Number is F07F-A1B8 Directory of C:\Program Files\Plone 3\Zope\lib\python\persistent 11/07/2007 10:26 AM . 11/07/2007 10:26 AM .. 08/17/2007 08:51 AM15,872 cPersistence.pyd 08/17/2007 08:51 AM12,288 cPickleCache.pyd 06/23/2007 02:06 AM 2,826 dict.py 08/23/2007 01:02 PM 2,559 dict.pyc 06/23/2007 02:06 AM10,556 interfaces.py 08/23/2007 01:02 PM10,685 interfaces.pyc 06/23/2007 02:06 AM 2,929 list.py 08/23/2007 01:02 PM 3,431 list.pyc 06/23/2007 02:06 AM 4,193 mapping.py 08/23/2007 01:02 PM 3,148 mapping.pyc 06/23/2007 02:06 AM 738 README.txt 08/23/2007 01:01 PM tests 08/17/2007 08:51 AM 8,704 TimeStamp.pyd 06/23/2007 02:06 AM 8,258 wref.py 08/23/2007 01:02 PM 8,539 wref.pyc 06/23/2007 02:06 AM 1,211 __init__.py 11/07/2007 10:26 AM 793 __init__.pyc 16 File(s) 96,730 bytes 3 Dir(s) 8,482,267,136 bytes free Is there a 'cPersistence.dll' file that is supposed to be somewhere, and maybe I don't have that in my path? Thanks a lot. This is really frustrating. Jim ___ 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] Moving the Zope (2) collector to launchpad.
I'm going to start the process of moving the Zope 2 collector today. It will be impossible to submit issues using the existing collector. We'll announce the availability of the launchpad-based collector soon. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ 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] Serious security problem with Zope 2
We have recently discovered that there are (still) very serious security problems with the integration of reStructured Text (docutils) into Zope 2. We have prepared a hot fix for this problem: http://www.zope.org/Products/Zope/Hotfix-2006-07-05/Hotfix-20060705/ See: http://www.zope.org/Products/Zope/Hotfix-2006-07-05/Hotfix-20060705/ README.txt for installation instructions. It is important to install this hotfix as soon as possible. This fix will disable the reStructuredText 'raw' directive. Much thanks goes to Tres Seaver for analyzing the problem and developing the hotfix! Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ 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] Import Modules
Luiz Fernando B. Ribeiro wrote: > Hello, > > I manage my own servers developing web applications and I would like > to remove the import restrictions of python modules in python scripts. > Is it possible? How can I allow other modules to be imported? I have > been using external modules but it is starting to become nonproductive > since I have to create functions to simple problems like md5, re, etc, > and just using the needed modules would be much simple. > > I use Zope as an application server and my clients do not have access > to the ZMI, so I'm not concerned with protection against misuse by my > clients. > > Thanks in advance, > I recall seeing some documentation about this use case somewhere. I think it was in the folder with the python scripts product. -Jim Washington ___ 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] AJAX and Zope
Lennart Regebro wrote: On 5/24/06, Pascal Peregrina <[EMAIL PROTECTED]> wrote: By Zope objects I meant: You've got a page template for example, and you include such an "AJAX enabled object", basically rendering an HTML fragment, and the resulting page will include the page template code + the fragment (similar to a macro call), but will also include the needed javascript code to handle the asynchronous communication. That is a macro call. There is no difference. It just that the macro includes the HTML needed to suck in the JS library you use. I have been working on a simple WSGI middleware filter that handles js library insertion pretty well, without complicated macros that assure that a javascript library gets included only once. It works by creating a WSGI environ variable for desired includes. Individual widgets ask a utility to register their need for a particular javascript or css resource into that environ variable. After Zope is finished generating the page, the middleware inserts the appropriate
Re: [Zope] REMOTE_USER Security Issue
Lennart Regebro wrote: On 5/18/06, Jim Washington <[EMAIL PROTECTED]> wrote: Completely immutable environ is not a good choice from WSGI point-of-view. environ can be useful for middleware information-passing. WSGI middleware would by definition get the environ and be able to modify it before the request gets it, so that isn't a problem. Yes, not a problem for for middleware -> app communication. But some app -> middleware communication would be impossible if environ is completely read-only. I am assuming that "immutable" here means "read-only". What if a middleware app puts a key in environ specifically for the app to write e.g., post-processing parameters? I have a use case for that. -Jim Washington ___ 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] REMOTE_USER Security Issue
Cliff Ford wrote: This is just to report that this issue is resolved (for me). Tres Seaver kindly provided a patch for HTTPRequest.py that makes the environ dictionary immutable (appended below for those in a similar position). This may have adverse consequences for applications that rely on existing behaviour and Tres has recommended that it would be better to harden the User Folder code. In our case we might also be able to encrypt the remote Username. Once again, thanks to Tres and other list members, who are a wonderful resource. Completely immutable environ is not a good choice from WSGI point-of-view. environ can be useful for middleware information-passing. -Jim Washington ___ 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] Some installation glitches
Andrew Sawyers wrote: I'm running Suse 10 - and I've got both /usr/lib and /usr/lib64 I don't believe that dependency has anything to do with Zope. If I take the zope distribution tarball and do the configure, make, make install dance, I get a 'lib64' directory inside the Zope installation instead of a 'lib' directory. mkzopeinstance has trouble with that configuration. It needs a 'lib' directory instead of a 'lib64' directory, so mkzopeinstance fails unless I do something, like symlinking lib64 to lib. -Jim Washington ___ 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] Some installation glitches
Andrew Sawyers wrote: I've not experienced any build problems running on 64bit machines. I've got a 64bit laptop and 64bit dev desktop machine, not to mention all our production servers are 64bit as well. I've seen the same lib/lib64 problem in Gentoo Linux on Zope 3. To work-around the problem, I make a symlink from lib to lib64 after install, and things work OK. -Jim Washington ___ 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] Zope.org = Zope.com?
Someone fat-fingered the cache configuration. It has been fixed afaik. Jim Chris Withers wrote: Hi Jim, Did anyone ever get to the bottom of this? cheers, Chris Chris Withers wrote: Lennart Regebro wrote: On 4/3/06, Andreas Krasa <[EMAIL PROTECTED]> wrote: it seems that currently all HTTP requests to www.zope.org and dev.zope.org are forwarded to www.zope.com. Seems to work now. At least for me. This is still happening intermittently for some people. Jim has raised it with the guys who host zope.org... cheers, Chris -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.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 )
[Zope] [Fwd: Zope fails on large task?]
-- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org --- Begin Message --- I have a quite complicated data collection and reporting system based on zope2.7 and postgresql. All the postgresql stuff is handled by external scripts. I have used page templates throughout. It is running on a Debian Sarge based system, and uses Apache as a front end. This is my first experience developing with Zope, so I have probably done things oddly, but... I have script that generates a large bundle of data dictionary for each "target entity", which is in this case is a person. I then pass this data to a script that converts it to XML. My template repeats over a list of people, and concatenates and sends the XML for them all to the user, where a bit of XSLT creates a paged report. It works for a few people. If I try too many people it fails with an Error reading from remote server message from the Apache. I cannot find any hints in the apache or zope logs. I have tried to monitor the server to see if any resources are running out, but have not found anything. Can anyone suggest how I try to diagnose this failure. I repeat, I am fairly new to Zope, and so need fairly basic help. Dave --- End Message --- ___ 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] Re: Zope 2.8.4+Latest cygwin installation
I have no idea what the original symptom or situation was, so I can't really comment. I'll note, however, that the error refered to in Pascal's reply results from a wart in Python's type-definition protocols that I thought I had fixed, but maybe I proposed fixing it and didn't get around to it. :( More specific would be helpful. Is a custom C type involved here? Jim Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pascal Peregrina wrote: Ok, in case anyone is interested, this nasty code change made it : In Zope-2.8.4-final/lib/python/ZODB/serialize.py: Change : return klass.__new__(klass, *args) To : try: result=klass.__new__(klass, *args) except TypeError: result=Persistent.__new__(klass, *args) return result I think Jim is the only one who could explain what you see. I can't even find the place in the code which generates that error: $ find . -name "*.py" -o -name "*.c" | xargs grep "is not safe" ./RestrictedPython/RCompile.py:The UNPACK_SEQUENCE opcode is not safe because it extracts ./zope/security/untrustedpython/builtins.py:# It's better to say what is safe than it say what is not safe ./ZODB/tests/testmvcc.py:It is not safe, however, to read the current revision of "a" because $ Pascal -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Pascal Peregrina Envoyé : jeudi 15 décembre 2005 12:51 À : [EMAIL PROTECTED] Objet : RE: [Zope] Zope 2.8.4+Latest cygwin installation Ok, just found it has already been reported several months ago, even with python 2.3.x: http://www.zope.org/Collectors/Zope/1725 Does someone know of any kind of temporary workaround for this ? Thanks ! Pascal -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Pascal Peregrina Envoyé : jeudi 15 décembre 2005 12:25 À : [EMAIL PROTECTED] Objet : [Zope] Zope 2.8.4+Latest cygwin installation Hi, I would like to know if anyone has been able to compile and run Zope 2.8.4 with Cygwin. I just installed cygwin with latest stable packages. I compiled python 2.4.2 (I know, not the supported version, so I am about to try 2.3.5 now) I had issues with the socket module, and from google I applied a workaround that worked fine : in Modules/socketmodule.c Change : #if defined(__sgi) && !defined(INET_ADDRSTRLEN) #define INET_ADDRSTRLEN 16 #endif To : /*#if defined(__sgi) && !defined(INET_ADDRSTRLEN)*/ #define INET_ADDRSTRLEN 16 /*#endif*/ I made several python tests and all looks fine. Then I compiled Zope 2.8.4 without any issue. But when I run it, I get this error: Site Error An error was encountered while publishing this resource. exceptions.TypeError Sorry, a site error occurred. Traceback (innermost last): Module ZPublisher.Publish, line 187, in publish_module_standard Module Products.Localizer, line 58, in new_publish Module ZPublisher.Publish, line 144, in publish Module Zope2.App.startup, line 174, in zpublisher_exception_hook Module App.ZApplication, line 60, in __bobo_traverse__ Module UserDict, line 17, in __getitem__ Module ZODB.Connection, line 704, in setstate Module ZODB.Connection, line 760, in _setstate Module ZODB.serialize, line 495, in setGhostState Module ZODB.serialize, line 488, in getState Module ZODB.serialize, line 436, in _persistent_load Module ZODB.Connection, line 208, in get Module ZODB.serialize, line 482, in getGhost TypeError: Acquirer.__new__(Application) is not safe, use Persistence.Persistent.__new__() Does anyone know what I can do ? Thanks a lot. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDoX+I+gerLs4ltQ4RAnnCAJ93gKFJn8j/BPXK91RuuTMutLzrHACgtB56 NH2tqYHS/JPITSoVefuqkRU= =CCbu -END PGP SIGNATURE- -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.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 )
Re: [Zope] Re: Re: ZAjax anyone?
Greg Fischer wrote: Ah even better! Thanks guys. I was going to reply just to mention I have a "not as cool" way of using Zope with Ajax at my site now too. www.zajax.net <http://www.zajax.net/> Seems every rock I turn over, I find 3 others worth investigating. Lots of cool stuff going on out there. I put up my own demo, but it's not nearly the prefered way of doing things by most people. I myself, prefer DTML over ZPT, so my demo is based on that. I also am using one of the larger client frameworks available, Dojo Toolkit. The js file is around 130k if I remember. The smaller ones are great and do the job, but I wanted something larger and more widely used like Dojo to build off of. I know eventually I'll look at the JSON stuff too. Sound interesting. Hi, Greg Cool! I like the way you do the how-to. Do you plan similar how-tos for other JS libraries/techniques? Would you accept contributions? I find myself looking at mochikit (http://mochikit.com) occasionally. In its ajax-tables demo, it uses a tal(esque) syntax for dom manipulation in client javascript, which could be interesting for fans of page templates. For the future, dare I ask, maybe some zope3 stuff? I think the zope community really needs zope-oriented how-tos and evaluations of the various AJAX libraries. zajax.net has the right name to be a prime focus of such activities, should you be willing to do that. Thanks! -Jim Washington ___ 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] Re: [Zope3-dev] Zope 3.1.0 released!
Stephan Richter wrote: Hello everyone, The Zope 3 development team is proud to announce Zope 3.1.0 final. Zope 3 is the next major Zope release and has been written from scratch based on the latest software design patterns and the experiences of Zope 2. It is in our opinion that Zope 3.1 is more than ready for production use, which is why we decided to drop the 'X' for experimental from the name. We will also continue to work on making the transition between Zope 2 and Zope 3 as smooth as possible. As a first step, Zope 2.8 includes Zope 3 features in the form of Five. Now that we have a release that we would like to declare stable next week, we are looking for translators, who translate Zope 3 into their favorite language! We are utilizing the Rosetta system from Ubuntu for managing those translations. If you are not familiar with Rosetta, please send us a mail to zope3-dev@zope.org and we get you set up. Downloads http://zope.org/Products/Zope3/ This URL is incorrect. The correct URL is: http://zope.org/Products/Zope3 (no trailing slash) Sorry about the confusion. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Re: [Zope3-dev] Zope 3.1.0 RC 3 released!
In this release (and earlier 3.1 releases), there is a zdaemon test failure if you install with Python 2.4 on Unix. This is a spurious failure. The test tries to execute a script (zdaemon/tests/donothing.sh) and the installation process is making this script non-executable. We'll need to look into why the execution permissions are being cleared, or, better yet, rewrite the test to use sh to invoke the script. In the mean time, you should not be alarmed by the failure. Jim Stephan Richter wrote: The Zope 3 development team is proud to announce Zope 3.1.0 candidate 3. Zope 3 is the next major Zope release and has been written from scratch based on the latest software design patterns and the experiences of Zope 2. It is in our opinion that Zope 3.1 is more than ready for production use, which is why we decided to drop the 'X' for experimental from the name. We will also continue to work on making the transition between Zope 2 and Zope 3 as smooth as possible. As a first step, Zope 2.8 includes Zope 3 features in the form of Five. Now that we have a release that we would like to declare stable next week, we are looking for translators, who translate Zope 3 into their favorite language! We are utilizing the Rosetta system from Ubuntu for managing those translations. If you are not familiar with Rosetta, please send us a mail to zope3-dev@zope.org and we get you set up. Downloads http://zope.org/Products/Zope3/ Installation instructions for both Windows and Un*x/Linux are now available in the top level 'README.txt' file of the distribution. The binary installer is recommended for Windows. Zope 3.1 requires Python 2.3.5 or 2.4.1 to run. You must also have zlib installed on your system. Changes Since 3.1.0c2 - Fixed several bugs that were considered critical. * Ported Stuart Bishop's work in ``pytz`` and ``zope.i18n`` to address broken and misleading timezone code (i.e., one issue was broken and another was misleading). * Fixed apidoc to handle extended paths, so that zope packages could be installed in software instances without apidoc losing knowledge of the core zope code. * Added custom ``executemany()`` method for cursors created through GadflyAdapter. See http://www.zope.org/Collectors/Zope3-dev/445 for discussion. - Updated ZODB to 3.5.1b2. Most Important Changes Since 3.0 - New Pluggable Authentication Utility (PAU), which is similar in philosophy to the Zope 2 PAS. The following features are available in the in the basic PAU facility: + Credentials Plugins: Basic HTTP Auth, Session + Authenticator Plugins: Principal Folder, Group Folder For a detailed description of the pluggable authentication utility, see 'zope/app/authentication/README.txt'. - Major simplifications to the component architecture: + Removal of the concept of a service. All outstanding services were converted to utilities: Error Reporting, FSSync, Authentication. + Site Managers are global and local now; adapters and utilties are directly registered with the site manager. Now global and local component registration and lookup behaves very similar. + Local registrations can now only have two states: active and inactive. This simplified the code so much, that 'zope.app.utility', 'zope.app.registration' and 'zope.app.site' were all merged into 'zope.app.component'. + Implemented menus as utilities. The API also supports sub-menus now. + Implemented views as adapters. Skins and layers are now simply interfaces that the request provides. - Added an integer-id facility for assigning integer identifiers to objects. - Added basic catalog and index frameworks. - Added "sources", which are like vocabularies except that they support very large collections of values that must be searched, rather than browsed. - Created a new granting UI that allows advanced searching of principal sources. - Implemented a generic user preferences systsem that was designed to be easily used in TALES expressions and via Python code. Preferences can be edited via 'http://localhost:8080/++preferences++/'. A demo of the preferences can be found at:: http://svn.zope.org/Zope3/trunk/src/zope/app/demo/skinpref/ - ZCML now supports conditional directives using the 'zcml:condition' attribute. The condition is of the form "verb argument". Two verbs, 'have feature' and 'installed module' are currently implemented. Features can be declared via the 'meta:provides' directive. - Improved API doctool: Code Browser now shows interfaces, text files and ZCML files; the new Book Module compiles all available doctext files into an organized book; the new Type Module lets you b
Re: [Zope] how dump Zope database content into a file system directory tree?
[EMAIL PROTECTED] wrote: Possible to dump content in Zope database into a file system tree? Yes. http://www.zope.org/Members/tseaver/FSDump --Jim Washington ___ 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] RFC: Requiring Python 2.4 in Zope 2.9
Alan Milligan wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: Comments are welcome. :) If the work indicated in the security audit does not require additional effort for 2.9, Effort will be needed. > then it would be best to get it into 2.8 ASAP, allowing 2.8 to be run under 2.3 or 2.4 as an 'approved' transitional environment. That is out of scope for the proposal. ... Until then, in the interests of not alienating a large user base, a 2.8.x release approved for 2.4 would be most appreciated. This would require a new 2.8 release and would require a volunteer to make the necessary security changes. If Andreas wants to make another release and there is a volunteer to do the security changes, then it's OK with me, although I'm not sure it's worth the bother. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] RFC: Requiring Python 2.4 in Zope 2.9
Chris Withers wrote: Jim Fulton wrote: At: http://www.zope.org/Wikis/DevSite/Proposals/RequirePython24> Is a proposal to require Python 2.4 for Zope 2.9 (to be released this December). Comments are welcome. :) Well, it'd be nice if Python 2.4 was at least "acceptable" for 2.8.x first, so the 3rd part products have some chance of finding 2.4 bugs... As someone else pointed out, it's usable with Zope 2.7, at least for testing, so someone should certainaly be able to test their products under Zope 2.8 and Python 2.4. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] RFC: Requiring Python 2.4 in Zope 2.9
At: http://www.zope.org/Wikis/DevSite/Proposals/RequirePython24> Is a proposal to require Python 2.4 for Zope 2.9 (to be released this December). Comments are welcome. :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Random Module
You can keep all the modules/types/etc you want Zope to stop hassling you about into a single file, restart Zope, and enjoy life again. create a Product called whatever you like (we called ours 'GlobalModules')... our looks like this: in Products/GlobalModules: __init__.py # Global module assertions for Python scripts from Products.PythonScripts.Utility import allow_module from AccessControl import allow_module, allow_class, allow_type allow_module('re') import re allow_type(type(re.compile(''))) allow_type(type(re.match('x','x'))) allow_module('zipfile') import zipfile allow_class(zipfile.ZipFile) allow_class(zipfile.ZipInfo) END-- For you, obviously, you'll want to allow_module('random'), perhaps declare some of its own special types, etc... hth Jim > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Sam Boggess > Sent: Thursday, August 25, 2005 1:36 PM > To: zope@zope.org > Subject: [Zope] Random Module > > Why won't Zope let me call the random module? It's really > annoying to have to write an external method to call such a > simple tool. Is there a way around this? Thanks. > ___ > 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 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] funny-looking events in the event.log
Just found these in the event log of a relatively low-traffic Zope 2.7.4 instance. Does this just seem like a local network connectivity issue or should I be concerned? (If yes, any advice where to begin diagnosing this kind of a report?) Thanks, Jim 2005-06-08T11:32:55 ERROR(200) ZServer uncaptured python exception, closing chan nel (socket.error:(110, 'Connection timed out') [/usr/local/ Python-2.3.5/lib/python2.3/asynchat.py|handle_read|88] [/home/zope/Zope-2.7.4-0/ lib/python/ZServer/medusa/http_server.py|recv|423] [/usr/local/Python-2.3.5/lib/ python2.3/asyncore.py|recv|356]) -- 2005-06-10T14:14:32 ERROR(200) ZServer uncaptured python exception, closing chan nel (socket.error:(110, 'Connection timed out') [/usr/local/ Python-2.3.5/lib/python2.3/asynchat.py|handle_read|88] [/home/zope/Zope-2.7.4-0/ lib/python/ZServer/medusa/http_server.py|recv|423] [/usr/local/Python-2.3.5/lib/ python2.3/asyncore.py|recv|356]) -- 2005-06-13T11:53:21 ERROR(200) ZServer uncaptured python exception, closing chan nel (socket.error:(110, 'Connection timed out') [/usr/local/ Python-2.3.5/lib/python2.3/asynchat.py|handle_read|88] [/home/zope/Zope-2.7.4-0/ lib/python/ZServer/medusa/http_server.py|recv|423] [/usr/local/Python-2.3.5/lib/ python2.3/asyncore.py|recv|356]) ___ 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] zserver blocking behavior with a slow request
> >I have 8 zserver threads and a ZODB pool size of 10. I'm fairly > >certain I'm not maxing these out. So is this blocking effect just > >expected behavior for zope? > > No, there should be no blocking. > > > Although some colleagues reported similar behaviour with a > (non Zope/ZServer) multithreaded application connecting to Oracle. > > They could not yet find the cause of their problem... > Interesting. Are you aware if your colleagues' was a python(/dcoracle2) app? thx Jim ___ 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] zserver blocking behavior with a slow request
> > I'm finding that once a user requests a page which runs a > particularly slow sql (say up to 5 minutes), > any other > subsequent requests seem to take the hit as well, and return > very slowly. > Take a look at DadlockDebugger product - you'll see what is > happening with your Zope threads. > Thanks, this looks quite handy, I am going to give it a whirl (I assume that threadframe module dependency hasn't yet hosed anyone's Linux machine - funny how a disclaimer can inspire paranoia) > Isn't it better idea to execute long running query outside of > zope - external method or sth, and only check for results > even with simple page reload? We did something like this with > pdf generation and this worked as expected, but of course you > need some additional work to create such thing. > Yes I agree, in my case those SELECTs aren't *supposed* to be taking 5 minutes. That's a separate problem. However when such a problem bites I don't want all of my users to suffer, just the unlucky one who requested the doomed sql to be run. > > So is this blocking effect just expected behavior for zope? > We are using Zope and Oracle too, and even 10 threads... and > I didn't noticed something like this. What is your processor > doing then? What is the CPU(s?) load. The single CPU isn't loaded at all. But if DeadlockDebugger doesn't turn up any good clues I will do some investigating at the system level. Thanks for advice, Jim ___ 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 instruct my Zope to use another pytrhon than the oneit was budled with.
> > I also have another Python version on my system and i was > wondering how could i "tell" Zope to use that one instead of > the one it comes with from the installation executable package. > If you start up using the runzope.bat script in ZOPE_HOME/bin, just edit the value of PYTHON to point to the desired alternate executable. Don't automatically expect things to work smoothly on the first try - watch the output from startup and see if you need to pull missing dependencies into the sys.path (edit the value of PYTHONPATH if this is necessary) - or if the executable is even compatible at all (version, distribution/standard library, etc). Jim ___ 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] zserver blocking behavior with a slow request
Title: zserver blocking behavior with a slow request On a production Zope (2.7.6) running behind apache and connected to an Oracle database, I'm finding that once a user requests a page which runs a particularly slow sql (say up to 5 minutes), any other subsequent requests seem to take the hit as well, and return very slowly. I have 8 zserver threads and a ZODB pool size of 10. I'm fairly certain I'm not maxing these out. So is this blocking effect just expected behavior for zope? One point of note is that the requests passed from apache all bear the remote ip of 127.0.0.1. Could zserver be throttling the incoming requests due to their identical REMOTE_IP (or some other apache configuration detail)? Is there anything else I should investigate? OH btw, I am using my own connection pool and managing db interface / transactions manually, so ZSQL should not be considered a culprit. Furthermore I'm watching the connections/pool themselves and they are not maxed either. Thanks for any help. Jim ___ 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] Re: [Zope3-dev] Zope 3 Bug Day Summary
Stephan Richter wrote: Hello everyone! I just wanted to let everyone know that we had a very successfull Zope 3 Bug Day today! I would like to thank Zope Corporation, POV, Nuxeo and the other community members for supporting this event by providing the manpower we needed! We were able to fix all outstanding bugs that prohibited us from making the first release candidate of Zope 3.1. As a result, I will create the 3.1 branch today, lift the feature freeze, and make a release later this weekend or first thing on Monday. I want to second this thanks. I'm very happy to see 3.1 finally nearing completon. Jim P.S. I'd like to remind everyone that there are just 3 months left before the feature freeze for 3.2. :) -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Puzzling Import/Export problem
A friend in Russia is still using my old ZClasses QSurvey product. He is attempting to copy an installation from one machine to another, and upgrade Zope to 2.6.4. Exporting the product and instances works fine, but some object instances will not import correctly. A product instance is a folderish object that contains other objects. One particular folderish subobject will not import correctly; all the others import fine. The .zexp of the entire product instance, with subitems, etc., imports OK, but the one folderish object shows up as "broken" in the ZMI. Exporting that object as XML and reimporting after correcting the appropriate class ID string results in a "BadPickleGet" error 7. Traceback (innermost last): Module ZPublisher.Publish, line 113, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module OFS.ObjectManager, line 561, in manage_importObject Module OFS.ObjectManager, line 578, in _importObjectFromFile Module ZODB.ExportImport, line 65, in importFile Module OFS.XMLExportImport, line 119, in importXML Module ZODB.ExportImport, line 75, in importFile Module transaction._transaction, line 368, in commit Module transaction._transaction, line 297, in savepoint Module transaction._transaction, line 294, in savepoint Module transaction._transaction, line 656, in __init__ Module ZODB.Connection, line 1034, in savepoint Module ZODB.Connection, line 470, in _commit Module ZODB.ExportImport, line 140, in _importDuringCommit BadPickleGet: 7 I have examined the xml export, and the only thing I can think of that might be a problem is that some of the object IDs for some contained items are base64-encoded and may contain Russian characters. But that does not seem to be the problem, since a similar, smaller import with only ascii characters fails with the same traceback and BadPickleGet:10. I realize that this might be an uninteresting edge-case. My backup plan is to write a script to pull the data out of the XML export and recreate the objects. Does anyone have any pointers on that? I am having trouble figuring out how that file is organized. For completeness, I am using zope-2.8.0, but this happens on 2.7.6 as well. -Jim Washington ___ 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] Searching Content Objects in Zope 3
Hello, I've been working away on an application, and it's now starting to take shape, based around a series of content objects. As recommended on this list I opted for Zope 3 to build my app, and I'm finding it quite powerful. However, I've hit a bit of a brick wall around searching. It seems from the documentation that ZCatalog is the prefered way of doing a search in Zope 2, but that this isn't implemented in Zope 3. I've got Philipp von Weitershausen's (very good!) book, and he doesn't implement a search for his recipe objects. I've also been looking at the PDF of the Zope 3 Book (which I've also found really useful) and I haven't spotted searching of objects mentioned in that. My search tool will need to take various criteria (say, number of bedrooms, maximum rent, areas the property can be located in) and scan through my objects to find all the matches. I think I can work out how to search through the objects themselves in order to find the matches, the real problem is taking in the criteria in the first place. (Although, any tips provided on the searching side of things would certainly be welcome too!) As a 'dummy run' at searching I created a View for my PropertyFolder object that shows properties based on specified criteria - I can get this to work OK, but I have to put the criteria right into the Python code, so clearly that's not acceptable... I would be grateful for anything anyone could point me to that would help me to build a tool to search my content objects. Philipp mentions the use of Utilities for searching, but beyond that, I don't know where to start. Is it possible to use Interfaces to create data entry schemas/forms for Utilities in the same way as for objects? Any help, greatly appreciated. Thanks, Jim ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.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 )
[Zope] Re: Zope Foundation Update
Dave Kuhlman wrote: On Tue, Jul 19, 2005 at 07:07:25PM -0400, Rob Page wrote: [snip] During my stay at EuroPython I learned that eighteen months ago (and without Zope Corporation's knowledge or consent) Zope Europe Association (ZEA) registered a trademark consisting of the Cirlce-Z (the stylized Z surrounded by a circle) followed by the word ZOPE (hereinafter "Circle-Z-Zope"). The mark they registered is identical to the corporate logo used by Zope Corporation. At the Zope Europe Association Web site (http://www.zope-europe.org/), the logo is 3 cubes with a 3-dimensional look. Has Zope Europe Association registered the Circle-Z-Zope trademark but is not using it? Apparently. Go to: http://www.wipo.int/ipdl/en/search/madrid/search-struct.jsp and enter "Zope" in the "Holder Name" field and click "Search". You will see 5 results. The first is for the Zope Corporation registration of the name "Zope", registered in May 2004. The next four results are for ZEA's registrations of the Zope and Plone marks, with logos (2 each, for different sets of countries) registered in July and September of 2004. > Or is there another Zope Europe Association? Nope, the addresses match. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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: ZPT with Zope 3 queries - repeat over contained items
Thanks for that info. I've tried a couple of extra things (below) and if I'm reading the output right I thing you're correct about "items" returning a tuple, and "values" returning the object. When I do the repeat like this: Name The data presented look like this: (u'Property', ) However when I repeat over "values" instead of "items" like this: Name ... they change to this format: So, it looks to me like values is returning the contained item as single item, rather than a tuple of it... However, I still can't drag anything out of it. Having changed the tal:repeat to "item context/values", I have tried item/name, item/Name, item/getName, item/title, item/Title... All return "NotFoundError". I've googled, but am yet to find any Zope 3 specific documentation for ZPT - could anyone point me in the direction of some? (Or am I just doing something wrong that wouldn't have worked in Zope 2 either?!?) Thanks, Jim --- Tres Seaver <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Vine wrote: > > Hello, > > > > Re-reading this, I realised I'd not provided much > > information on the "repeat" problem, so I'm > filling in > > some gaps. > > > > This works as I would expect: > > > > > > > > Number > > > > > > # > > > > > > > > i.e., if it is repeating over a property folder > with > > four objects in it, it produces a table headed > > "Number" and with 4 further rows with numbers 1, > 2, 3, > > and 4 in. > > > > However, as soon as I add any meat to it, e.g.: > > > > > > > > Number > > Name > > > > > > # > > Name > > > > > > > > I get an error which shows up on the error log as: > > > > "TypeError: tuple indices must be integers" > > Likely, 'context' is a dict, or a workalike, whose > 'items' method > returns a sequence of tuples. Therefore, during the > tal:repeat, 'item' > is a tuple, (key, value). > > Try using 'values' instead of 'items'. > > > Tres. > - -- > === > Tres Seaver +1 202-558-7113 > [EMAIL PROTECTED] > Palladion Software "Excellence by Design" > http://palladion.com > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.2.5 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - > http://enigmail.mozdev.org > > iD8DBQFCynuh+gerLs4ltQ4RAl5uAKCRzRzV+g1M8gcbV07jSNfCQbWbhgCg0nL4 > 2POVN4oUQepYUIQ+pR1IPRU= > =fBFx > -END PGP SIGNATURE- > > ___ > 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 ) > ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.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 )
Re: [Zope] ZPT with Zope 3 queries - repeat over contained items
Hello, Re-reading this, I realised I'd not provided much information on the "repeat" problem, so I'm filling in some gaps. This works as I would expect: Number # i.e., if it is repeating over a property folder with four objects in it, it produces a table headed "Number" and with 4 further rows with numbers 1, 2, 3, and 4 in. However, as soon as I add any meat to it, e.g.: Number Name # Name I get an error which shows up on the error log as: "TypeError: tuple indices must be integers" I have tried the second element as all sorts: Name and: Name and: Name and: Name (all of the objects in the PropertyFolder have a "street" attribute) These all give the same error. Since my simple test case works, it seems like I'm setting the loop up correctly, but am asking for the data in the wrong way later on. getId and title certainly look from the Zope 2.6 book like they should work, and I tried the rest as "guesses". Where should I be looking to find the correct information on how to do this in Zope 3? Thanks, Jim > Hello, > > I'm building an application in Zope 3. I have a > container object called a PropertyFolder, which > holds > Property objects. > > * Repeating over contained items. > > I'm trying to create a view which displays a list of > all the Property objects in a property folder. I've > tried doing this as described in the ZPT chapter of > the Zope Book (2.6 edition), using a tal:repeat > statement, but I can't seem to get it working. Has > something changed in Zope 3? I've tried looking in > the > Zope 3 book, but none of the references to > tal:repeat > in there seem to be used for this type of thing. > ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.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 )
[Zope] ZPT with Zope 3 queries - repeat over contained items; accessing adapters
Hello, I'm building an application in Zope 3. I have a container object called a PropertyFolder, which holds Property objects. * Repeating over contained items. I'm trying to create a view which displays a list of all the Property objects in a property folder. I've tried doing this as described in the ZPT chapter of the Zope Book (2.6 edition), using a tal:repeat statement, but I can't seem to get it working. Has something changed in Zope 3? I've tried looking in the Zope 3 book, but none of the references to tal:repeat in there seem to be used for this type of thing. * Accessing adapters in ZPT I've created an adapter that provides a method called getStars that can be used on Property objects. Can I access this directly from my ZPT, as I can any other attribute of a property object? At the moment I've got it implemented via a Python view class, so my ZPT accesses it like: but other attributes can be accessed like: so I guess I want to be able to do: and negate the need for the Python View Class, which only says: def stars(self): """Get the stars for the property""" rate = IPropertyRate(self.context) stars = rate.getStars() return stars Thanks in advance for any tips. Thanks, Jim ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.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 )
Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?
Hi, I hope it's not considered "bad form" to answer ones own questions on this board, but I think I've got it sussed. Reading through the ZWiki source from http://svn.zope.org I noticed the following line in the implementations: from zope.app.container.contained import Contained I added this to mine, and it has cleared up the error a treat. Thanks, Jim PS - In scrabling around the net trying to solve this I read somewhere (I think it was a Python Tutorial) the following advice: "Use the source" (Luke...) I can strongly recommend to any other newbies looking for examples to take a look at to try out ZWiki - it's got a reasonably small number of interfaces and classes, so you can get your head around it, and it covers useful things like containment. --- Jim Vine <[EMAIL PROTECTED]> wrote: > Hello again, > > So, following the recommendations from the board I > have settled on "route 3" - developing a Python > Product, using Zope 3. I've been refering a lot to > the > Zope 3 Book (particularly chapter 13 onwards) and > have > progressed somewhat. > > I've created a "PropertyFolder" class, which can > hold > Property obects, and following the example in the > book > I've been able to make it hold *only* Property > objects. > > My "Property" class is proving a little more > difficult, however. When I've tried to make it along > the same lines as the "message" class in the book, I > run into difficulties - it seems to be some sort of > problem with inheriting from multiple classes / > interfaces. My workaround has been that I can > include > my __setitem__.precondition within the main > IProperty > interface, and make that subclass from IContainer > instead of Interface. This works for me, because I'm > not going to want Property objects to contain other > Property objects, but I really haven't been able to > track down why it should work for the message board, > but not for my classes / interfaces. The errors I > was > getting before my work around seemed to be > indicating > that it wasn't a container, although I was > subclassing > BTreeContainer, and implementing three interfaces > (one > and Interface, one and IContained, and one > IContainer). Mostly this presented itself as Zope > complaining about using __len__ on the object. (As I > say, I have worked around this, and mention it > mostly > in case it sheds any light on the issue below...) > > My current problem, however, is proving harder to > work > around. I want my Property objects to be able to > contain Images, and sets of attributes. (A typical > set > of attributes would describe what is in the > kitchen). > I have created interfaces IAttribSet(Interface), > IAttribSetContainer(IContainer) and > IAttribSetKitchen(IAttribSet); and classes AttribSet > (implements IAttribSet and IAttribSetContained) and > AttribSetKitchen (implements IAttribSetKitchen). I > am > using IAttribSetContained to create a __parent__ > ContainerTypesConstraint. I have wired up the > kitchen > attrib set in .zcml files. > > When I 'turn off' implementing IAttribSetContained, > my > kitchen attrib set is working fine, in that I can > add > it anywhere, and edit it. However, when I try to add > a > condition saying where it can go (i.e. I only want > it > to be within Property objects) it correctly only > appears as an Add-menu item within Property objects, > but on adding it, I get an error, saying > "AttribSetKitchen instance has no attribute > '__parent__'". My Property and PropertyFolder > objects > are implemented as BTreeContainers. > > I'm really quite stumped by this, so I would > appreciate any guidance that could be provided on > tracking down the source of the errors. > > Thanks, > Jim > > > > --- Lennart Regebro <[EMAIL PROTECTED]> wrote: > > > On 6/22/05, Jim Vine <[EMAIL PROTECTED]> > wrote: > > > I think I've convinced myself that the > complexity > > of > > > my app takes it beyond method 1, but I'm > strugling > > to > > > get my head around the implications of selecting > > > method 2 or 3. Am I right in thinking that > either > > of > > > these will result in my building a "Product"? > > > > Yes. > > > > > If I > > > want to add extra feature to my product on the > > > development server and then port them to the > live > > > server (with all the data on the live server > being > > > left in tact), will selection of either of these &g
Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?
Hello again, So, following the recommendations from the board I have settled on "route 3" - developing a Python Product, using Zope 3. I've been refering a lot to the Zope 3 Book (particularly chapter 13 onwards) and have progressed somewhat. I've created a "PropertyFolder" class, which can hold Property obects, and following the example in the book I've been able to make it hold *only* Property objects. My "Property" class is proving a little more difficult, however. When I've tried to make it along the same lines as the "message" class in the book, I run into difficulties - it seems to be some sort of problem with inheriting from multiple classes / interfaces. My workaround has been that I can include my __setitem__.precondition within the main IProperty interface, and make that subclass from IContainer instead of Interface. This works for me, because I'm not going to want Property objects to contain other Property objects, but I really haven't been able to track down why it should work for the message board, but not for my classes / interfaces. The errors I was getting before my work around seemed to be indicating that it wasn't a container, although I was subclassing BTreeContainer, and implementing three interfaces (one and Interface, one and IContained, and one IContainer). Mostly this presented itself as Zope complaining about using __len__ on the object. (As I say, I have worked around this, and mention it mostly in case it sheds any light on the issue below...) My current problem, however, is proving harder to work around. I want my Property objects to be able to contain Images, and sets of attributes. (A typical set of attributes would describe what is in the kitchen). I have created interfaces IAttribSet(Interface), IAttribSetContainer(IContainer) and IAttribSetKitchen(IAttribSet); and classes AttribSet (implements IAttribSet and IAttribSetContained) and AttribSetKitchen (implements IAttribSetKitchen). I am using IAttribSetContained to create a __parent__ ContainerTypesConstraint. I have wired up the kitchen attrib set in .zcml files. When I 'turn off' implementing IAttribSetContained, my kitchen attrib set is working fine, in that I can add it anywhere, and edit it. However, when I try to add a condition saying where it can go (i.e. I only want it to be within Property objects) it correctly only appears as an Add-menu item within Property objects, but on adding it, I get an error, saying "AttribSetKitchen instance has no attribute '__parent__'". My Property and PropertyFolder objects are implemented as BTreeContainers. I'm really quite stumped by this, so I would appreciate any guidance that could be provided on tracking down the source of the errors. Thanks, Jim --- Lennart Regebro <[EMAIL PROTECTED]> wrote: > On 6/22/05, Jim Vine <[EMAIL PROTECTED]> wrote: > > I think I've convinced myself that the complexity > of > > my app takes it beyond method 1, but I'm strugling > to > > get my head around the implications of selecting > > method 2 or 3. Am I right in thinking that either > of > > these will result in my building a "Product"? > > Yes. > > > If I > > want to add extra feature to my product on the > > development server and then port them to the live > > server (with all the data on the live server being > > left in tact), will selection of either of these > > particularly help or hinder me in this? > > I don't know, because when I tried 2., it turned out > to be quite > complicated, and I never understood how to do it. So > I did 3. And > afterwards I have realized that even if you do > understand how to do 2, > the fact that you do most of your stuff in the > restricted python > scripts and dtml or ZPT, means that you have tons of > limitations to go > around. > > In addition to that, you can't easily use any proper > editors to edit > the code, which is very annoying. > > Method 2 (aka ZClasses) simply seem to offer exactly > zero benefits, > and loads of drawbacks. > > Also, as mentioned earlier, unless you want to build > your application > on top of one of the Zope2 content management > systems around (CPS, > Plone, Silva, ...) you probably want too use Zope3 > for your > application development anyway. And then only method > 3 (disk based > development) is available. > > -- > Lennart Regebro, Nuxeo http://www.nuxeo.com/ > CPS Content Management > http://www.cps-project.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/li
RE: [Zope] Sharing global data between threads / locking a method
> A possible solution: create a property field on the folder > where the external methods are stored. Have your external > method update this property field when the external method > starts and again when it exits. This way you can test > whether or not the external method is currently in operation. > You could store this property field on a temp_folder for > faster performance. Curious, - to save variables in this way, must a Folder property be used, or would a class variable set on something that extends Folder work the same? - why does temp_folder perform faster for this technique? Thx Jim ___ 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] merging the contents of two acl_users folders
Title: merging the contents of two acl_users folders Can it be done? If not that, the ability to move selected users from one acl_users to another would be a decent plan B. This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved. Thanks for any help, Jim ___ 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] External editor for ZMI
I do recommend Boa Constructor, which feels the most like you're actually editing source code files (though you're editing the zope objects in place). This program has actually saved my life. Caveats: It has a few dependencies you'll need to track down, and it's a little buggy/quirky. If you're not comfortable with a bit of DIY, or you're relatively new to zope and/or python, it might be more trouble than its worth. The 'upload' mechanism in ZMI for most objects might do OK for you, then you can use whatever editing environment you want. I'm sure a lot of people have solved this particular problem for themselves in different ways, based on their own editing needs/preferences. After a little trial and error, of course. Jim > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of John Poltorak > Sent: Thursday, June 23, 2005 11:28 AM > To: zope@zope.org > Subject: [Zope] External editor for ZMI > > > What alternatives are there to editing objects through ZMI? > > -- > John > > > ___ > 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 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] Newbie Questions - many-many relationships? Zope 2 or 3?
> On 21.Jun 2005 - 21:59:41, Jim Vine wrote: > > Say, for example that my Zope App in some way has > a > > "House" object, which records the address, the > owner, > > and a short description. Later on, I may wish to > add > > further fields to record, say, the number of > bedrooms, > > but the system is already in use - if I've > developed > > in the ZMI, will this make it harder to make an > > upgrade? > > Such a change might not be a problem using ZMI, as > you can freely add > properties to any object. You'd have to supply the > data for all existing > objects though (but you'd need to do that when using > a product too). > OK, so there are (at least) three ways of doing things in Zope: 1. Using the ZMI to build an application using standard objects (classes) 2. Creating new classes to use in your app through the ZMI. 3. Creating new classes to use in your app in Python. Most of the Zope Book concentrates on method 1, and the "Extending Zope" chapter is about method 2 - it mentions method 3, but says that it's beyond the scope of the book. I think I've convinced myself that the complexity of my app takes it beyond method 1, but I'm strugling to get my head around the implications of selecting method 2 or 3. Am I right in thinking that either of these will result in my building a "Product"? If I want to add extra feature to my product on the development server and then port them to the live server (with all the data on the live server being left in tact), will selection of either of these particularly help or hinder me in this? Apologies for asking so many questions, and thanks to those who have helped so far. I guess I'm just keen to start from the right place at the beginning, so save myself headaches further down the line. Thanks, Jim ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.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 )
Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?
Thanks to those who posted suggestions - certainly gave me a few things to think about. Unfortunately I was left with one "use Zope 2", one "use Zope 3" and a "use Plone", but maybe that's just a reflection of the fact that there's more than one Zope way to skin a cat! (yeah, I know I've over-simplified the answers - no offence is meant!) On another thread (http://mail.zope.org/pipermail/zope/2005-June/159738.html), someone said: "The problem is that you develop using the ZMI. It's a bad pattern. Don't do it." but the Zope Book (2.7 version)'s chapter on Creating a Basic Application all seems to be through the ZMI. Now, Zope's original appeal to me was using the graphical interface provided by the ZMI to create a collection of objects which if you wire them up correctly will become an application, a view that I think is supported by the Zope Book. However, this view, and what I've read about Zope 3 seems to indicate that this way of doing things is deprecated. Am I correct here? Particularly, if I am building an app that I think I will want to add extra functionality to after it has been installed and is in use, is this a particular reason to avoid developing with ZMI? Say, for example that my Zope App in some way has a "House" object, which records the address, the owner, and a short description. Later on, I may wish to add further fields to record, say, the number of bedrooms, but the system is already in use - if I've developed in the ZMI, will this make it harder to make an upgrade? Now, if the answer to all of that is "yes", then I think that steers me away from the need for TTW development (TTW = Through The Web = ZMI, yes?) which steers me towards Zope 3. I'm interested by the suggestions on how to handle the relations. > Hmm, what I would start with is an attribute for a > house containing a > list of references to owners. And vice versa, each > owner has a list of > references to houses. I had thought of this, but my concern was about how to make sure that the two records are kept accurate - basically the suggestion is to keep two records saying the same thing, which just triggers alarm bells with me. Another suggestion was: > Nah. You either let every PropertyOwner have a list > of the ids of > HouseProperty objects, or the other way around. Then > you index this is > the catalog so you can search. Tada! I like the sound of this a bit better - just keep records in one place. So, if I've followed, I let the the house "knows" who owns it, and if I go to a certain owner's page and want it to give me a list of all the houses she owns, it would do a search through all the house records to see where she's mentioned. Thanks again for all the help so far - lots of food for thought. Thanks, Jim --- Andreas Pakulat <[EMAIL PROTECTED]> wrote: > On 16.Jun 2005 - 23:17:43, Jim Vine wrote: > > Specifically, I've been scratching my head for a > while > > about how to handle a many-many relationship: a > > property owner may own more than one house; > > conversely, a house may have more than one > co-owner - > > consequently it's not appropriate to have either > > containing the other. I've googled for general > > information about handling many-many relationships > in > > OO, and most of what I've come across has only > > indicated that it can be tricky! > > Hmm, what I would start with is an attribute for a > house containing a > list of references to owners. And vice versa, each > owner has a list of > references to houses. Now in Zope references could > be implemented via > storing the URL of the house and references to Users > could be stored via > the username (the one the user uses to log in). > > > While Im on, Ive noticed that Zope 3 has been > > released. Is this now the recommended development > > environment, or am I better off sticking with Zope > 2 > > for now, and porting my application once Zope 3 is > a > > bit further down the line? > > Read the archive, short answer is: > > If you depend only on Zope, you don't want TTW and > you want to write a > file based product: Zope3 would be possible > > If you need some existing products or if you need > TTW-Code, then you > have to stick to Zope2 > > Andreas > > -- > You're ugly and your mother dresses you funny. > ___ > 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] Newbie Questions - many-many relationships? Zope 2 or 3?
Database Question Hello, I'm a newbie, so this is a newbie question! I am currently preparing to build a web application for property lettings, and I'm very interested in what Zope has to offer. The application will need to recognise a number of different objects, such as "houses", "prospective tenants" and "property owners" (the latter of which I may implement as user types, which would allow these people to log in and amend some of their own information.) I'm very interested in the Object Oriented way of doing things; for example, I'm thinking about implementing houses as a folder-ish object, so it would be able to contain photos of the house in question. The biggest stumbling block I am facing is how to do something "Relational" in an OO environment. Specifically, I've been scratching my head for a while about how to handle a many-many relationship: a property owner may own more than one house; conversely, a house may have more than one co-owner - consequently it's not appropriate to have either containing the other. I've googled for general information about handling many-many relationships in OO, and most of what I've come across has only indicated that it can be tricky! Having a look through past threads on this mailing list I've noticed a few references to mxmRelations (http://www.zope.org/Members/maxm/products/mxmRelations) which seems to match up - have I got the right end of the stick? Before I jump in with this I'd appreciate any advice or guidance you could provide - it'd be greatly appreciated. While I?m on, I?ve noticed that Zope 3 has been released. Is this now the recommended development environment, or am I better off sticking with Zope 2 for now, and porting my application once Zope 3 is a bit further down the line? I?d greatly appreciate any guidance that can be provided on these subjects. Thanks in advance, Jim ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.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 )
RE: [Zope] Exiting a Loop
Did you try around the loop and inside of it? Never done this myself, just a thought. Jim > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of J Cameron Cooper > Sent: Wednesday, June 15, 2005 1:37 PM > To: Asad Habib > Cc: zope@zope.org > Subject: Re: [Zope] Exiting a Loop > > Asad Habib wrote: > > Yes, I should not be doing this but I am using DTML not ZPT > and since > > DTML provides programming functionality and in this case > the ability > > to loop, there should be a way to exit a loop as well. > > DTML is not a complete programming language; it simply provides some > (too-) familiar structures. You may try to treat it as such, > and can get away with it to a certain extent, but you may run > into limitations. > > If you treat it as a templating engine (which it is) you will > find it complete. > > --jcc > -- > "Building Websites with Plone" > http://plonebook.packtpub.com/ > > Enfold Systems, LLC > http://www.enfoldsystems.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 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 question
blast! i'll keep my mouth shut til I get the library memorized. Jim > -Original Message- > From: Tino Wildenhain [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 31, 2005 4:06 PM > To: Jim Abramson > Cc: Kate Legere; Zope > Subject: RE: [Zope] python question > > Am Dienstag, den 31.05.2005, 15:38 -0400 schrieb Jim Abramson: > > sort() on a sequence does not return anything. It operates on the > > [mutable] sequence in place. > > sequence is a module in Zope. So she indeed was right. > > ___ 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 question
sort() on a sequence does not return anything. It operates on the [mutable] sequence in place. You probably want to push this bit into a python script where you have more elbow room, and do this: files.sort(etc,etc) return files[0] hth, Jim > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Kate Legere > Sent: Tuesday, May 31, 2005 3:35 PM > To: Zope > Subject: [Zope] python question > > I may be asking this in the wrong place but I have a tal page > where I want to use python to display only the most recent > addition to a folder of files. > > > I can sort the folder and return all the files easily with: > return sequence.sort(files, (('bobobase_modification_time', 'cmp', > 'desc'),)) > > How do I return just the most recent one? (I tried sorting > and then using return max(files) but that doesn't give me all > the properties and I need them for display) > > Kate > > ___ > 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 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] display object without index_html
Though less elegant, perhaps this will work: dtmlIndex = DTMLFile('dtml/indexHomepage', globals()) def index_html(self): """ docstring! """ return self.dtmlIndex(self,self.REQUEST) hth, Jim > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Christopher Rivard > Sent: Wednesday, May 18, 2005 1:51 PM > To: zope@zope.org > Subject: [Zope] display object without index_html > > i am developing a Zope product (2.7) with a "homepage" > content type and want this object to display as the index of a folder. > for other custom objects, i have display methods that call an > index view ( using DTMLFile) of the object like this: > > #homepage view > index_html = DTMLFile('dtml/indexHomepage', globals()) > > i want this object to display as the index of the folder without: > > folder/index_html/index_html > > however, when i render the object, i get: > > > > remove display: > > http://localhost:8080/www/index_html/index_html has an empty > or missing docstring. Objects must have a docstring to be published. > > how can i ensure that an "homepage" object with an id of > index_html will display as the index of a folder (without > calling folder/index_html/index_html)? > i hope i explained this coherently... > > any insight would be greatly appreciated- > > Thanks, > Chris > > > > > > > > > > > > > ___ > 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 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] the joy of hacking ZPublisher
Title: the joy of hacking ZPublisher In my Zope 2.7 Product, I'm trying to implement a special folder, which intercepts the publishing call to any subobject and wraps the entire call in another. A concrete example: where the default action would be to traverse /MyProduct/SpecialFolder/something, and publish the attr 'something' from SpecialFolder, I want this to happen instead: doSomethingBeforeCallingTheRequestedObj() try: return mapply( something, blahblah...) finally: doSomethingAfterCallingTheRequestedObj() Why? I need to do stuff to the REQUEST before the object is called (this part wasn't difficult), and then do something *after* it's called - no matter what the results were. But only for publishables that live in or beneath the Special Folder. In fact I have something working, but one big problem - it breaks management screens in a bad way. The implementation is pasted below. Is there some much simpler way to accomplish this behavior? And am I short-circuiting security machinery in some dangerous way? class Wrapper(Implicit): """voodoo""" id = meta_type = title = "Wrapper" def __init__(self, publishable): self.pub = publishable def index_html(self): """ render the results to the client """ REQUEST = self.REQUEST print self.__class__.__name__, 'calling', self.pub try: return mapply(self.pub, REQUEST.args, REQUEST, call_object,1, missing_name, dont_publish_class, REQUEST, bind=1) finally: print self.__class__.__name__, 'done' print '' print '' __call__ = index_html Globals.InitializeClass(Wrapper) class SpecialFolder(Folder): def __bobo_traverse__ (self,REQUEST,key): print '__bobo_traverse__', REQUEST.URL, key stack = REQUEST['TraversalRequestNameStack'] target = getattr(self,key) if stack: return target return Wrapper(target).__of__(self) ___ 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] high loads, more threads, spinning wheels
Thanks Stefan & Jens... > > if yes, would upping the number of ZODB connections > effectively raise > > the ceiling - e.g. 12 ZODB connections -> 12 threads should perform > > properly ? Is increasing the number of ZODB cx's > possible, let alone > > advisable? (why the default of 7 - not 6 or 8?) > > > > Upping the number of threads is unlikely to give you better > performance. The only case where this could make sense is if > you had something like a highly saturated RDBMS backend, > tying up your worker threads. > Well this is *exactly* the issue I'm facing. I need to soften the impact of this situation if possible, and it's going to be ZEO in the end, but rolling this out is probably not going to be possible in the very short term. > But - Zope threads don't operate like you probably expect > from knowing Apache and similar models. For one, they *never* > will run in parallel. > Python employs a global interpreter lock (GIL), so there will > only be a single thread "working" at all times. What you want > is to up the number of processes (interpreters) not the > number of threads. Hence ZEO. > So far I've done some very off-the-cuff tests upping the threads/connections to 12/16 and banging on it with jmeter. The results were favorable in comparison to the default config. Could this have been a fluke? Jim ___ 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] custom_zodb.py and Control_Panel
> > v2.7.4 running on Linux - I'm trying to use this (custom_zodb.py in > > INSTANCE_HOME) > > custom_zodb.py is no longer used for Zope 2.7.x. You define > databases in zope.conf. > Ah, OK thanks. Is it for the collector that, aside from messing up the ZMI a bit, the custom_zodb.py approach is still basically effective? Jim ___ 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] custom_zodb.py and Control_Panel
Title: custom_zodb.py and Control_Panel v2.7.4 running on Linux - I'm trying to use this (custom_zodb.py in INSTANCE_HOME) - import os import ZODB.FileStorage import ZODB.DB filename = os.path.join(INSTANCE_HOME, 'var', 'Data.fs') Storage = ZODB.FileStorage.FileStorage(filename) DB = ZODB.DB(Storage, pool_size=10) --- When I do it, zope does start up and run, but I get IOError every time I try to look at the "main" storage in Control_Panel->Database: Traceback (most recent call last): File "", line 1, in ? File "/home/zope/Zope-2.7.4-0/lib/python/Zope/__init__.py", line 51, in app startup() File "/home/zope/Zope-2.7.4-0/lib/python/Zope/__init__.py", line 47, in startu p _startup() File "/home/zope/Zope-2.7.4-0/lib/python/Zope/App/startup.py", line 57, in sta rtup DB = configuration.dbtab.getDatabase('/', is_root=1) File "/home/zope/Zope-2.7.4-0/lib/python/DBTab/DBTab.py", line 96, in getDatab ase db = self._createDatabase(name, is_root) File "/home/zope/Zope-2.7.4-0/lib/python/DBTab/DBTab.py", line 113, in _create Database db = factory.open() File "/home/zope/Zope-2.7.4-0/lib/python/Zope/Startup/datatypes.py", line 172, in open DB = self.createDB() File "/home/zope/Zope-2.7.4-0/lib/python/Zope/Startup/datatypes.py", line 169, in createDB return ZODBDatabase.open(self) File "/home/zope/Zope-2.7.4-0/lib/python/ZODB/config.py", line 97, in open return ZODB.DB(section.storage.open(), File "/home/zope/Zope-2.7.4-0/lib/python/ZODB/config.py", line 128, in open quota=self.config.quota) File "/home/zope/Zope-2.7.4-0/lib/python/ZODB/FileStorage.py", line 232, in __ init__ self._lock_file = LockFile(file_name + '.lock') File "/home/zope/Zope-2.7.4-0/lib/python/ZODB/lock_file.py", line 62, in __ini t__ lock_file(self._fp) File "/home/zope/Zope-2.7.4-0/lib/python/ZODB/lock_file.py", line 42, in lock_ file fcntl.flock(file.fileno(), _flags) IOError: [Errno 11] Resource temporarily unavailable If I remove the custom_zodb.py file, the problem goes away. Why is the file locked to the ZMI when I use custom_zodb.py? ___ 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] high loads, more threads, spinning wheels
Can this be taken to mean that: - the practical maximum number of threads to run your single (non-ZEO) zope instance is {number of zodb connections in pool} else you risk deadlock if yes, would upping the number of ZODB connections effectively raise the ceiling - e.g. 12 ZODB connections -> 12 threads should perform properly ? Is increasing the number of ZODB cx's possible, let alone advisable? (why the default of 7 - not 6 or 8?) More concretely, is there any good way to increase the request-handling capacity of a standalone instance, beyond the limits imposed by the defaults, without deploying ZEO? > > To put it in a very simple way, you should not tweak the > threads setting unless you really know what you are doing. If > your goal is performance the usual way of going about that is > to run ZEO and add ZEO clients as needed. > > You're bumping into the very simple fact that there are two > items interacting badly: Threads and the connections in the > Zope database connection pool. A thread, under normal > circumstances, can only do work if it has a connection to > work with, and wwill only release the connection when the > request is finished. There are 7 connections in the pool by default. > > jens > ___ 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] how to generate debug.log for requestprofiler
Title: how to generate debug.log for requestprofiler At some point btn Zope 2.6.2 and 2.7.4, it seems way you set up a logfile to be used by requestprofiler.py has changed. Now I need "debug.log" - whats the proper way to generate one? I've just been googling and can't find explicit instructions about this. Doing runzope or zopectl with -M aren't working, and there is no obvious directive in zope.conf for it. Unless I am supposed to configure a logger at DEBUG level myself, from the zope.conf and make sure it's called debug.log, but this doesn't seem right.... Any suggestions? Thanks, Jim ___ 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] tuples of length 2 in DTML
Title: tuples of length 2 in DTML Tuples of length 2 just don't seem to work in DTML. I don't know what it is, certainly never seen any documented explanation before. The simple test below explains itself . Can anyone explain why the results are what they are? I'd go to the collector if it didn't seem like such a glaringly obvious quirk. I figure there must be some sensible reason why this happens, but my manual is missing that page. tt: tt[]: Jim ___ 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: Does anyone care whether we deprecate ZClasses?
Florent Guillaume wrote: Chris Withers <[EMAIL PROTECTED]> wrote: Jake wrote: Jim Fulton said: (There are no plans to deprecate DTML. It is even supported in Zope 3.) That is the best news I have heard all day (although, it is early). I will be selling black flags for the mourning of a missed opportunity... DTML is very nice for some things. And for beginners. Only the magic namespaces of DTML are bad, and those are gone in Zope 3. I wish they were gone, but they are still there. Someday, I'd like to se a TALES-based DTML, but I doubt I'll ever have time to do it. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Re: Does anyone care whether we deprecate
Well said. I mostly agree, however, there needs to be a balance. We are introducing a process for orderly deprecation of features. I hope it works. It's mainly useful for changes that are straightforward to recover from. We have to balance lots of different factors taking into account *everybodies* interests, the best we can *together*. Jim Andrew Milton wrote: I think people on this list need to realize that eventually, the direction of any significantly large Open Source project is hijacked by the relatively small number of people actually doing the work. The reasons for this are many-fold, but, normally come down to a lack of communication between the developers and the users, which is realized in a lack of understanding by the developers of what the users want. This for the most part isn't generally a problem, until, the developers start to do things "for the user's own good", like remove features that are "kludgey", or a "hack", or , which generally means either noone wants to work on it, or some other change caused it to break, and noone wants to fix it. Now to the credit of the Zope guys, they actually poll the users to find out, rather than just announce the demise of something. However, in general once you add a feature, you can be guaranteed, that somewhere, someone is using it, so removing it will always cause a problem. So there will always be an uproar when you poll. You're never going to be able to reduce the feature set between point releases without upsetting some group of people. So why don't we stop all this nonsense now, and just agree, that you're never going to do that d8) You have Zope 3 to remove all the stuff you hate d8) In my opinion if you change something, it's your responsibility to fix the resulting breakage. That's part of your responsibiliity to the rest of the community (i.e. the [mostly non-paying] customers). If you don't think you have this responsibility to us, then you should work on your own version of Zope, where you're not impacting anyone else. For the record, I hate ZClasses... d8) -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.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 )
[Zope] Re: Does anyone care whether we deprecate ZClasses?
Jonathan Cyr wrote: Yoohoo, ZClasses are not an expert technology to use, they are an introduction to Zope... Just because I use a thing, doesn't mean I can support/maintain a thing. Exactly. I want you to use Zope even if you aren't in a position to maintain it yourself. > I can read the list, and try to help folks with questions that I've experienced... that's the support that can be offered at my skill level. Which is extremely valuable. If that's not enough... fine... drop ZClasses, then DTML (you know, its next)... and all the folks in this boat with me. (There are no plans to deprecate DTML. It is even supported in Zope 3.) ZC should decide whether the benefits of ZClasses for low-end developers match against the hurdles to keeping it with the newer Zope releases. If they don't see a need for this skill-level type of tool in Zope's feature list, they will pay down the road... Growth is king, even for Zope, who grew this platform? Growth means newbies, right? What elements got Zope to where it is? Could ZClasses be on that list? Why? Vey well said. I think this is, but should not be underestimated. This is something I think about a lot. I think Zope needs to support developers and non developers. Zope 2 was weak in supporting developers. Over the years, new techniques and technologies have evolved to make Zope development better for proffessional developers, but we still need the non-developers. And seeing comments like... - "Move to Zope Python Products" - you cant see the skill differences between OOP & Zope's API vs. ZClasses - "Use the Archetypes/CMF/Plone setup" - UML training? the CMF API and Plone underpinnings, easy? - "Maintain it yourself then" - Update very slick code within Zope's flexible and aging API, with ZODB API too? Maintain it...Yeah sure, hows this afternoon. ... just show me how under-represented that beginner and intermediate Zope developers use this list... and then I think, perhaps there aren't any, just me and a few others... and if that's the case, Zope's screwed, and the horse I rode in on. :) This list is for you. While you shouldn't have to maintain Zope yourself, you *do* need to be vocal about what you want. (Of course, at some point, work needs to get paid for. If someone wants a new feature that the developers don't want to develop out of the goodness of their hearts or even an old feature that no one wants to maintain, someone may have to be willing to fund some development. I'm not asking for this in this case.) And so here's the confession... "Hello, I'm Jon... I've used Zope for 2 years, and I can't help others program high-level Python OOP tools/platform resources in a propriety web content management server. I only can support their efforts when the occasional mailing list opportunities present themselves." And that support is greatly appreciated! Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Re: Does anyone care whether we deprecate ZClasses?
Ausum Studio wrote: ... As for ZC, IMHO the issue should be treated as a matter of understanding the market rather than achieving a milestone. You created stuff that works in some way or another that people embraced. You also changed your company name to the name of the product of yours that people embraced. And no matter how much hype there is on new trends, you should realize that a song is just a song until the market say it's a hit, and that X3 is that song. Shall you start to put Zope2 into pieces before getting to know you already have a hit? :) Well said. I couldn't agree more. That's why ZC continues to spend lots of time maintaining and enhancing Zope 2. It's why I see many Zope 2 releases ahead and why, every time I speak to large groups of people, I tell people not to feel a need to rush to Zope 3. There is absolutely no intention to make the mistakes of other projects to have an untested new version replace an established new version prematurely. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Re: Does anyone care whether we deprecate ZClasses?
Andreas Jung wrote: --On Dienstag, 5. April 2005 16:38 Uhr -0400 Jake <[EMAIL PROTECTED]> wrote: And that is probably the best arguement for keeping them around longer. We should get to the point: if some people depend on ZClasses then they should take over some responsibility in maintaining them in future releases. Be careful here. While there is value in deciding priorities based on willingness of people to help. We want people to use Zope *even* if they can't maintain it. It would be a huge mistake to gibe people the impression that they should only use Zope if they are prepared to maintain it themselves. In other words, the availability of volunteers is a good criteria for selecting *new* features. > It can not be that a "feature" regarded as obsolete (from the majority) and almost unmaintained and untouched since ages holds up further releases. It is being maintained now. I don't think we can choose not to maintain such an important feature. I agree that new features should only be done of there are developers willing to do them. > I agree with Jim that they should be officially deprecated - means they could be removed in Zope 2.10. Whoa, I'm not advocating that. I was asking if anyone cared. I strongly suspected that there would be people who did care. I've gotten a lot of grief because of the effort I've been putting into getting them to work with Zope 2.8 and the effect that that has had on the 2.8 schedule. Many active Zope developers are (understandbly) dismissive of ZClasses, but I think we can't ignore the many people who depend on them. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Re: Does anyone care whether we deprecate ZClasses?
Lennart Regebro wrote: On the Paris sprint, one thing that was noted was how ironic it was that the release of 2.8, which includes support for the new recommended development paradigm, was held up becuase we neeeded to support an old non-recommended one. :-) It boils down to backward compatibility. Backward compatibility is important. People aren't going to use our platform if it keeps changing. in backward incompatible ways without reletively smooth transition tools. We can't simply drop such a critical feature just because we don't want to maintain it. Heck, I'd love to drop version support from ZODB, but I'm not going to until I can offer a replacement to the people who depend on versions today. Anyway, my main question is: You who are using ZClasses, can't you just stay on Zope2.8 or 2.9, if Zope 2.10 would not contain ZClass support? The main features of 2.8 is support for the component architecture, For many people, the main features of 2.8 are multi-version concurrency control and better garbage collection. > and for zope 2.9 and 2.10 this will be even more true: there will most likely be very few new features besides this. I wouldn't assume that. People continue to do interesting things on this platform. In any case, if we put people in the place where they couldn't (in a practical, rather than theoretical sense) migrate from a particular version, then we'd have to consider maintaining that version longer that we otherwise would, if only to give people bug fixes (especially security fixes). > With 2.9 or 2.10 the idea is that you can use both ZClasses, *and* write products that work under Zope3. I'm not even sure there will be a 2.10, and in any case you won't really have much need of it. I'd be very surprised if there was not a Zope 2.10, or even a Zope 2.11. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Re: Does anyone care whether we deprecate ZClasses?
Dieter Maurer wrote: Lennart Regebro wrote at 2005-4-5 11:48 +0200: On the Paris sprint, one thing that was noted was how ironic it was that the release of 2.8, which includes support for the new recommended development paradigm, was held up becuase we neeeded to support an old non-recommended one. :-) "ZClasses" feature prominently in the Zope book. That should probably be fixed. Seems they are more recommended than the new development paradigm (which does not yet feature at all in the Zope book). The new developement paradigm is featured prominantly in 2 new books. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Does anyone care whether we deprecate ZClasses?
Jim Fulton wrote: Jake wrote: My question, since it now seems like I am not the only one using ZClasses I doubt that that is the case. Sorry, I missread your note. I meant to say that I was sure you are *not* the only one using ZClasses. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Does anyone care whether we deprecate ZClasses?
Jake wrote: My question, since it now seems like I am not the only one using ZClasses I doubt that that is the case. is, why not support them? You listed out the reasons why someone wouldn't want to use them going forward, but what are the reasons why not to support them as legacy into 3/2.10? Are you saying you want them in 2.10 but not necessarily beyond that (e.g. 2.11)? Or that you don't see why we don't support them indefinately? It takes effort to support old features. We have to weigh the benefits against the cost of the feature. For example, Zope 2.8 has been delayed substantially due to the effort to keep them going. If people find them useful, then we can keep them, but we don't want to keep them otherwise. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Does anyone care whether we deprecate ZClasses?
Jake wrote: As someone who has at least 5 different products using ZClasses across 10 different websites with millions of hits a month, I am certainly not happy to see them go, but I do understand that their time has come. If they are supported in 2.8 -> 2.9 and gone in 3.0 I guess that is ok. If we deprecated them now, they would be gone in 2.10 (not to be confused with 3.0) too. Again, it is going to take me and others a lot of work to migrate out our data from those products into other vehicles but such is progress. A decision hasn't been made. People who don't use them feel strongly that they should go. I'm trying to get a sense of how widely they are used. I'm trying to understand if people who use ZClasses are a silent majority, minority, or small minority. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Does anyone care whether we deprecate ZClasses?
Allen Schmidt wrote: -l for deprecation ...until we build a replacement anyway... What do you mean by "replacement"? In Zope 3, I plan to provide persistent modules to support prototying new applications through the web. It will be possible to automatically convert these to file-system-based packages once you are ready to move to production and evolutionary development. I expect this capability to appear in Zope 2 eventually. Would this be a suitable replacement? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] Does anyone care whether we deprecate ZClasses?
ZClasses are a feature that support through-the-web development. Many people have found them useful in the past, but they have some significant deficiencies, including: - They can't be managed with file-system tools, especially revision control systems like CVS and subversion. - They don't work well with Python development tools, like profilers and debugger. - They aren't being actively maintained. Most serious Zope developers stopped using them a long time ago and are frustrated that we still expend resources keeping them around. For example, the release of Zope 2.8 has been delayed by the requirement of getting ZClasses working with Zope 2.8. We could choose to deprecate ZClasses. If we deprecated them in Zope 2.8, they would still work in Zope 2.8 and Zope 2.9, but their support would be removed in Zope 2.10. Would anyone be upset if this happened? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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] "Picture of the day" product
Hi, Tim context.ZopeTime() or container.ZopeTime() ZopeTime is not in the PythonScript's namespace. It is available in most (all?) containers, however. -- Jim Washington Timothy Wilson wrote: > > On Mon, 29 Jan 2001, Tres Seaver wrote: > > > > I'd like to grab all instances with a display_date <= today's > > > date. I can't figure out exactly how to do that in DTML or a > > > Python Script. Once I have that list of instances, I'll simply > > > pull off the latest one as you suggested. > > > I don't know where it would be in the book it would be, but > > I do this something like:: > > > > > > > > The expression would be basically the same in a PythonScript:: > > > > return context.theCatalog( meta_type='Photo' > >, display_date=ZopeTime() > >, display_date_usage='range:max' > >, sort_on='display_date' > >, sort_order='reverse' > >) > > Great! The first DTML example works perfectly. The second, however, throws > up an error. In fact, I have yet to figure out how to use ZopeTime() in a > PythonScript. Do I have to pass anything in? > > I get: > > Error Type: NameError > Error Value: ZopeTime > > when I try it. > > -Tim ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] porting from Python Methods to PythonScriptsin2.3.0;LoginManager too
Hi, Fred I discovered another bug in it. Where it changes stuff with "self[", it changes it to "container.", which is wrong, but a simple edit. new code: import string ids = container.objectIds('Python Method') oldscriptsuffix='.old' #replace all self. with the following: #change to context if needed newself = 'container' #for future programmatic use just to be certain no extra dots if string.find(newself,'.') >= 0: newself = string.replace(newself,'.','') for method_id in ids: method_id = string.strip(method_id) #get the Method and its title method = container[method_id] title = method.title #FTPget does not require external method! thebody = method.manage_FTPget() #get the params eop = string.find(thebody,'') params = thebody[8:eop] params = string.replace(params,' ','') params = string.replace(params,'self,','') params = string.rstrip(string.replace(params,'self','')) body = thebody[eop+10:] #get the body newbodylist = [] splitbody = string.split(body,'\n') #do imports as needed #bug: random will be imported if you use whrandom for animport in ['string','whrandom','random','math']: if string.find(body,animport+'.') >= 0: newbodylist.append('import ' + animport) for k in splitbody: #this would be a good place for re newstring = string.replace(k,'self.',newself + '.') #bug: might miss 'self [' wish re were available newstring = string.replace(newstring,'self[', newself + '[') newbodylist.append(string.rstrip(newstring)) body = string.join(newbodylist,'\n') # uncomment to see the raw data # print 'params = "%s"' % params # print 'body is:\n"%s"' % body #rename the old and create the new. don't do more than once. if method_id [-len(oldscriptsuffix):] <> oldscriptsuffix: container.manage_renameObject(method_id,method_id+oldscriptsuffix) container.manage_addProduct['PythonScripts'].manage_addPythonScript(method_id) newscript = container[method_id] newscript.ZPythonScript_setTitle(title) newscript.ZPythonScript_edit(params, body) print 'converted: \t%s' % method_id if len(printed) < 9: print "No methods to convert" return printed Thanks for trying it. Let me know any other bugs, and I may eventually publish a howto. -- Jim > > Jim, > > Thanks for the script. I plan to give it a try. > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] porting from Python Methods to PythonScripts in2.3.0;LoginManager too
The text of an external method for converting Python Methods to Python Scripts was posted to the list a while back. I forget who because I just copied and pasted at the time. Anyway, credit to whoever, and apologies for not having the name. I took that and made something that works for me as a Python Script. (Though my Methods have been rather simple...) Standard caveats, YMMV, etc, but it does a quick pass on the Methods in the folder where it is and makes Scripts from them when you hit the 'test' tab, saving the old ones as methodname.old. It's not perfect (e.g., it will import random if you use whrandom); it's just a bit easier than manually editing (copy, paste, edit) for the same functionality. It would be pretty easy to recurse all folders and change them all, but I am not that bold yet. It seems debugged enough to post. I am sure someone will let me know if otherwise. -- Jim Washington begin code import string ids = container.objectIds('Python Method') #what suffix do we want on the old Methods? oldscriptsuffix='.old' #replace all self. with the following: #change to context if needed newself = 'container' #for future programmatic use just to be certain no extra dots if string.find(newself,'.') >= 0: newself = string.replace(newself,'.','') for method_id in ids: method_id = string.strip(method_id) #get the Method and its title method = container[method_id] title = method.title #FTPget does not require external method! thebody = method.manage_FTPget() #get the params eop = string.find(thebody,'') params = thebody[8:eop] params = string.replace(params,' ','') params = string.replace(params,'self,','') params = string.rstrip(string.replace(params,'self','')) body = thebody[eop+10:] #get the body newbodylist = [] splitbody = string.split(body,'\n') #do imports as needed #bug: random will be imported if you use whrandom for animport in ['string','whrandom','random','math']: if string.find(body,animport+'.') >= 0: newbodylist.append('import ' + animport) for k in splitbody: #this would be a good place for re; put container where self was newstring = string.replace(k,'self.',newself + '.') #bug: might miss 'self [' wish re were available newstring = string.replace(newstring,'self[', newself + '.') newbodylist.append(string.rstrip(newstring)) body = string.join(newbodylist,'\n') # uncomment to see the raw data # print 'params = "%s"' % params # print 'body is:\n"%s"' % body #rename the old and create the new. don't do more than once. if method_id [-len(oldscriptsuffix):] <> oldscriptsuffix: container.manage_renameObject(method_id,method_id+oldscriptsuffix) container.manage_addProduct['PythonScripts'].manage_addPythonScript(method_id) newscript = container[method_id] newscript.ZPythonScript_setTitle(title) newscript.ZPythonScript_edit(params, body) print 'converted: \t%s' % method_id if len(printed) < 9: print "No methods to convert" return printed end code Evan Simpson wrote: > > From: "Fred Yankowski" <[EMAIL PROTECTED]> > > + Don't copy over SiteAccess and PythonMethods. > > + Delete the PythonMethods product from the Control_Panel/Products > > management folder. > > > > Will I have to manually convert each existing Python Method to > > a PythonScript, or are they essentially the same type? > > They are radically different types, and can therefore live in the same Zope, > side-by-side, without conflicting. There is no automatic conversion > process. Simply keep PythonMethods installed, and replace individual > Methods with Scripts as you feel the need. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PythonScripts documentation
The new online help in 2.3 may have some answers to your questions. Do you have that? It's in Zope Help->API Reference->PythonScript -- Jim Washington Gerald Gutierrez wrote: > > Where is the latest documentation for PythonScripts located? The closest I > found is > > http://www.zope.org/Members/4am/PythonMethod > > but it is dated and contains minimal information. > > I'm specifically interested in what I can do with them and what I cannot do > with them. > > Thanks. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClass Adding Magic Needed
Hi, Geoff Your situation looks like application logic confusion enhanced by the weirdness of DTML. Use a Python Script/Method to do the background heavy lifting. If you are using , and REQUEST.set() to access your items, it can be done much more simply and understandably in a Python Script/Method. -- Jim Washington "Geoffrey L. Wright" wrote: > > So: > > I have a odd little problem that I can't seem to solve. I have two > zclasses. We'll call them zclass1 and zclass2. zclass2 lives inside > of zclass1. zclass1 has the following two properties: id and > displayOrder. zclass2 has the four properties: id, displayOrder, > alignment and content. In both cases the id is an automaticly > generated unique number based on ZopeTime. > > My problem is that I need to make a public add method that generates a > new instance of zclass1 with a new instance of zclass2 inside of it. > I also need to be able to control set the displayOrder of zclass1, and > the alignment and content of zclass2 from the same form. The > displayOrder of zclass2 will be static for the time being, but I'll > ultimately need to control that as well. > > I hacked the default add method of zclass1 so that it generates a new > instance of zclass2 each time, and using the Job Board HOWTO I managed > to make a public add method. So far so good. But now I can't for the > life of me figure out how to pass some form variables to one object > and some to the other, especially while they have some identically named > properties. > > Any hints on this one? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClasses meet PythonScripts, sample request
Timothy Wilson wrote: > > On Mon, 15 Jan 2001, Jim Washington wrote: > > > Where is the editFormAction Python Script? It should be in your ZClass's > > /methods. If you are instead acquiring it from a Folder somewhere, you > > will need to use 'context' instead of 'container' inside the Python > > Script. > > I'm not getting any errors now that I've changed the editFormAction to refer > to 'context'. My guy feeling is that these methods should be methods of the > ZClass so I'll probably change that, but for now no errors. > > Unfortunately, however, the instance isn't getting updated either. After > hitting submit I get the red "Your changes have been saved" and the edit > form is visible, but the same old values are there. When I view the instance > after updating I also see the same of values. Apparently either REQUEST > doesn't contain the data it's supposed to or the instance isn't being > properly modified with REQUEST's contents. Any thoughts? I would put the Python Script in the ZClass's /methods and see what happens. -- Jim ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClasses meet PythonScripts, sample request
Hi, Tim What is the name of the propertysheet in your ZClass that these values are on? Is it 'job_info'? Where is the editFormAction Python Script? It should be in your ZClass's /methods. If you are instead acquiring it from a Folder somewhere, you will need to use 'context' instead of 'container' inside the Python Script. -- Jim Washington Timothy Wilson wrote: > > On Mon, 15 Jan 2001, Jim Washington wrote: > > > I have it. > > The Python Script I sent you: > > > > container.propertysheets['job_info'].manage_changeProperties(REQUEST) > > > > needs to be rewritten: > > > > container.propertysheets.job_info.manage_changeProperties(REQUEST) > > Hey Jim, > > I'm getting closer. Now I get the following error and traceback: > > Error Type: AttributeError > Error Value: job_info > > Traceback (innermost last): > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 222, in > publish_module > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 187, in > publish > File /var/lib/zope/2.3.0a2/lib/python/Zope/__init__.py, line 221, in > zpublisher_exception_hook > (Object: Traversable) > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 171, in > publish > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/mapply.py, line 160, in > mapply > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 112, in > call_object > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/OFS/DTMLMethod.py, line 189, in > __call__ > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_String.py, line > 538, in __call__ > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_Util.py, line > 336, in eval > (Object: editFormAction(REQUEST)) > (Info: REQUEST) > File <string>, line 0, in ? > File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line > 325, in __call__ > (Object: editFormAction) > File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line > 354, in _bindAndExec > (Object: editFormAction) > File > /var/lib/zope/2.3.0a2/lib/python/Products/PythonScripts/PythonScript.py, > line 321, in _exec > (Object: editFormAction) > (Info: ({'script': <PythonScript instance at 873fbd8>, > 'context': <JobPosting instance at 86b7dc0>, 'container': <Folder > instance at 87225f0>, 'traverse_subpath': []}, > (<h3>form</h3><table><tr > valign="top" >align="left"><th>posted</th><td>'01/15/2001'</td></tr><tr > valign="top" >align="left"><th>duties</th><td>['asdfasdf\015\012']</td></tr><tr > valign="top" >align="left"><th>position</th><td>'asdfadsfasd'</td></tr><tr > > -- again snipping the rest of REQUEST -- > > File Python Script, line 2, in editFormAction > File /var/lib/zope/2.3.0a2/lib/python/Products/PythonScripts/Guarded.py, > line 272, in __getattr__ > File /var/lib/zope/2.3.0a2/lib/python/Products/PythonScripts/Guarded.py, > line 143, in __careful_getattr__ > (Object: Traversable) > AttributeError: (see above) > > Any ideas? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClasses meet PythonScripts, sample request
Hi, Tim I have it. The Python Script I sent you: container.propertysheets['job_info'].manage_changeProperties(REQUEST) needs to be rewritten: container.propertysheets.job_info.manage_changeProperties(REQUEST) Perhaps someone could explain why the first does not work. One point about your form: You have id as a form variable. You will be disappointed by its behavior. Regards, -- Jim Washington Timothy Wilson wrote: > > Jim (or anyone else who's feeling charitable this morning), > > Thanks for all your help. I really appreciate it. I wonder if you'd have > time to look one more time at the two methods I've got that aren't > working. I've included the actual code for my job posting product. Perhaps > someone will find it instructive. I have a feeling that the remaining > problem is not directly related to the processing of the form by the > PythonScript. I also included the traceback at the end of this message. > > Here are the two methods. I have a table that displays the currently > available jobs and displays two little icons which call the edit or delete > methods on the corresponding instance of the 'Job Posting' class. The edit > icon links to the 'editJobForm' method which in turn calls the > 'editFormAction' method that actually processing the change. > > -- > editJobForm > - > > > > Edit a Job Board Entry > This form allows you to make changes to current postings on the online > job board. You don't needed to fill in every > field on the form. Click on the "Submit Edits" button at the bottom of the > screen to save your changes to the database. > > > > Your changes have been saved > > > > > > Notes > notes> > > Job ID > > > Organization > > > Position > > > Description > name="description:text" rows="10" cols="60" wrap="virtual"> description> > > Pay Offered > > > Line of Authority > > > Function > name="function:text" rows="4" cols="60" wrap="virtual"> function> > > Qualifications > name="qualifications:text" rows="8" cols="60" wrap="virtual"> qualifications> > > > > To create a bullet list of "duties," type each one in the box below and > press the "ENTER" key > between each item in the list. > > > Duties > > duties> > > > > name="duties:list" rows="10" cols="60" wrap="virtual"> > > > Offer Expires > "> > > > Enter the date that the job was officially posted. > > Posted Date > "> > > > > > > > > > > > > > > > > - > editFormAction (with REQUEST as a parameter) > - > > container.propertysheets['job_info'].manage_changeProperties(REQUEST) > > The error I get is: > > Error Type: TypeError > Error Value: sequence index must be integer > > Traceback: > > Traceback (innermost last): > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 222, in > publish_module > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 187, in > publish > File /var/lib/zope/2.3.0a2/lib/python/Zope/__init__.py, line 221, in > zpublisher_exception_hook > (Object: Traversable) > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 171, in > publish > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/mapply.py, line 160, in > mapply > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 112, in > call_object > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/OFS/DTMLMethod.py, line 189, in > __call__ > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_String.py, line > 538, in __call__ > (Object: editJobForm) > File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_Util.py, line > 336, in eval > (Object: editFormAction(REQUEST)) > (Info: REQUEST) > File <string>, line 0, in ? > File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line > 325, in __call__ > (Object: editFormAction) > File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line > 354, in _bindAndExec > (Object: editFormAction) > File > /var/lib/zope/2.3.0a2/lib/python/Products/PythonScripts/PythonScript.py, > line 321, in