[Zope-dev] Bug in Traversable.py
Looks like there is a bug in Zope 2.10.2 with OFS/Traversable.py on line 228: if not ok: if (container is not None or guarded_getattr(obj, name, _marker) is not next): raise Unauthorized(name) Here is my debugging session: (Pdb) guarded_getattr(obj, name, _marker) 'Guo Zhonghai' (Pdb) obj Contact at /creme/Contacts/Contact_1125 (Pdb) name 'title' (Pdb) guarded_getattr(obj, name, _marker) 'Guo Zhonghai' (Pdb) p next 'Guo Zhonghai' (Pdb) guarded_getattr(obj, name, _marker) == next True (Pdb) guarded_getattr(obj, name, _marker) is next False (Pdb) type(guarded_getattr(obj, name, _marker)), type(next) (type 'str', type 'str') (Pdb) id(guarded_getattr(obj, name, _marker)) 46912619931440 (Pdb) id(next) 46912619931720 Thus, often string attributes will fail with this check. In my opinion the code should read: if not ok: if (container is not None or guarded_getattr(obj, name, _marker) != next): raise Unauthorized(name) If you agree that his is a bug, I'll log it. -- Roché Compaan Upfront Systems http://www.upfrontsystems.co.za ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Tests: 5 OK
Summary of messages to the zope-tests list. Period Thu Mar 22 12:00:00 2007 UTC to Fri Mar 23 12:00:00 2007 UTC. There were 5 messages: 5 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Thu Mar 22 21:52:36 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007483.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Thu Mar 22 21:54:07 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007484.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Mar 22 21:55:37 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007485.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Mar 22 21:57:07 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007486.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Mar 22 21:58:37 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007487.html ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope] Help me some error when I complie Zope!
I'm using WindowsXP, Python 2.4.3, Visual Studio 2005. When I complie Zope 2.9.6 from source, it alway alert: running build_ext creating zope.proxy copying zope/proxy\proxy.h - zope.proxy error: The .NET Framework SDK needs to be installed before building extensions for Python. NMAKE : fatal error U1077: 'C:\Python24\python.exe' : return code '0x1' Stop. Somebody help me solve this problem. Don't say me install .NET Framework, because I installed VS2005 include .NET Framework(I think so) ___ 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 can I reset zope time???
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23 Mar 2007, at 07:41, Flemming Bjerke wrote: But, now, not only have all my changes the date 12/12-2007 in the undo history, every object I have changed gets this date as well! Apparently, zope won't accept to go backward in time. How do I reset the zope's time? Undo is transactional, meaning an undo is actually a new transaction instead of removing an old transaction. What you are trying to do is not possible, unless you physically truncate the database. I am not absolutely sure I understand you. I succeeded in undoing. My problem is that zope keeps on with the date 12/12-07. The zodb does not seem to accept a timestamp that is earlier than the last That's what I am trying to tell you. Any undo is actually a brand-new transaction that will by definition set the modification time to the current time. You *cannot* get back to the old modification time using Undo. This does not mean that Undo won't work at all, it will. But you will not get back your old modification time. jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFGA4XFRAx5nvEhZLIRAtVgAKCzR9Chwxwne5A0ncA0kyuckiLH4wCgr0oQ 5jNmLYQn4p8fdBzNV3ALU5M= =AbR8 -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 )
Re: [Zope] How can I reset zope time???
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jens Vagelpohl schrieb: On 23 Mar 2007, at 07:41, Flemming Bjerke wrote: But, now, not only have all my changes the date 12/12-2007 in the undo history, every object I have changed gets this date as well! Apparently, zope won't accept to go backward in time. How do I reset the zope's time? Undo is transactional, meaning an undo is actually a new transaction instead of removing an old transaction. What you are trying to do is not possible, unless you physically truncate the database. I am not absolutely sure I understand you. I succeeded in undoing. My problem is that zope keeps on with the date 12/12-07. The zodb does not seem to accept a timestamp that is earlier than the last That's what I am trying to tell you. Any undo is actually a brand-new transaction that will by definition set the modification time to the current time. You *cannot* get back to the old modification time using Undo. This does not mean that Undo won't work at all, it will. But you will not get back your old modification time. jens so it migth be enough, to export the folder(s) with your sites remove the Data.fs to a secure place, restart zope and the reimport your sites. just an idea robert -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFGA4lfGaryJ0T9kUYRAoKMAJ97ooj+qxLZ5yA6kjk++w3iTj1xDgCfReFA 29pvh80BOjil2GPXxXurhdg= =92Fr -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 )
Re: [Zope] How can I reset zope time???
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23 Mar 2007, at 09:01, robert rottermann wrote: I am not absolutely sure I understand you. I succeeded in undoing. My problem is that zope keeps on with the date 12/12-07. The zodb does not seem to accept a timestamp that is earlier than the last That's what I am trying to tell you. Any undo is actually a brand-new transaction that will by definition set the modification time to the current time. You *cannot* get back to the old modification time using Undo. This does not mean that Undo won't work at all, it will. But you will not get back your old modification time. so it migth be enough, to export the folder(s) with your sites remove the Data.fs to a secure place, restart zope and the reimport your sites. No. Import will also generate new database modification times. It will only make things worse. This issue appears when product authors naively use the database modification time instead of defining their own field in which to store modification time data. They would have full control if they used their own time stamps. Most product authors simply don't know what the possible consequences are, or when/how the database modification timestamps are changing. jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFGA4nrRAx5nvEhZLIRAlo3AJ9sAB/CpqgctBryDQD5vSvTjVqLMwCeOmUo AUy0tEmUBi9fmTj5pWEOYm4= =0wAy -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 )
[Zope] Re: Help me some error when I complie Zope!
Duc Toan schrieb: I'm using WindowsXP, Python 2.4.3, Visual Studio 2005. When I complie Zope 2.9.6 from source, it alway alert: running build_ext creating zope.proxy copying zope/proxy\proxy.h - zope.proxy error: The .NET Framework SDK needs to be installed before building extensions for Python. NMAKE : fatal error U1077: 'C:\Python24\python.exe' : return code '0x1' Stop. Somebody help me solve this problem. Don't say me install .NET Framework, because I installed VS2005 include .NET Framework(I think so) The Windows Python binary (2.4 and 2.5) is built with Visual Studio 2003, compiling Zope needs the same compiler. The free VisualC++ Toolkit 2003 is not available for download anymore since mid 2006, its been replaced by the free Visual Studio 2005 Express. What you can do without further problems is: install cygwin (or MingW), compile Python from source with cygwin, finally compile Zope from source under cygwin. This is atm also the only way to get Python eggs with C extensions compiled under Windows. Hth, Michael -- http://www.zope.org/Members/d2m http:/planetzope.org ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How can I reset zope time???
On Fri, 23 Mar 2007 09:03:55 +0100 Jens Vagelpohl [EMAIL PROTECTED] wrote: No. Import will also generate new database modification times. It will only make things worse. This issue appears when product authors naively use the database modification time instead of defining their own field in which to store modification time data. I don't think the zwiki-people know this. They would have full control if they used their own time stamps. Most product authors simply don't know what the possible consequences are, or when/how the database modification timestamps are changing. I am a bit confused. My zopeserver runs fine, and all undos have been erased. What I want is to be able to create an object in the zmi which has the correct creation date (e.g. 23rd March 12.20 pm) in the zmi (and the undo history as well). Is this simply impossible because the timestamp in the zodb is always automatically adjusted to the latest date associated to the objects already created (i.e. 12th December 2007)? Flemming ___ 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: open image in a fitted new window
Thanks Tres and Tino. BTW Tino, what do you mean with ...or uses layers the big view on top with little DOM action (preferred)... something like passing the mouse point over the picture and have the full-size version of the image? Cheers, Alan On 22/03/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Tres Seaver schrieb: ... The only trick here is to get the javascript to include the dynamic URL; everything else is not specific to Zope or ZPT. Here is the hack I usually use for that:: !-- assumes that 'image' is bound to an actual Zope image object -- script type=text/javascript lang=JavaScript tal:define=img_url image/absolute_url tal:content=string:var img_url='${img_url}';/script Your popup javascript can then refer to the 'img_url' JS variable to set the window location. A little bit cleaner approach would be to have an ordinary link: a class=magnify href=path/to/big/imageimg src=path/to/thumbnail width, height ... //a and have a general javascript which scans thru the DOM after load, finds the a-objects with class-attribute magnify and installs an handler for mouse click which overrides the usual link action and either pops up a window or uses layers the big view on top with little DOM action (preferred). You dont even net buzzy Ajax for this. The URL for the big picture is just encoded in the HTML already, so you can use the usual tal: attributes to define in ZPT. The result is clean xhtml code which works in any case and only is improved in case of javascript beeing available. Regards Tino ___ 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 can I reset zope time???
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23 Mar 2007, at 12:20, flem wrote: I am a bit confused. My zopeserver runs fine, and all undos have been erased. What I want is to be able to create an object in the zmi which has the correct creation date (e.g. 23rd March 12.20 pm) in the zmi (and the undo history as well). Is this simply impossible because the timestamp in the zodb is always automatically adjusted to the latest date associated to the objects already created (i.e. 12th December 2007)? You hit the nail on the head. The ZODB timestamp is adjusted whenever the ZODB record for an object is changed and the application code has _no_ control over it. Such change could be effected by a content author editing the object, or by an import, or by an undo operation. jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFGA9BzRAx5nvEhZLIRAtWEAJ0Wi2op0pbepzPUc+z2Njt4hOtImwCffqxA fKsoxuBL4drthkAIkvQz6Dg= =yOWK -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 )
Re: [Zope] Re: mass editing timeout problem
Laurence Rowe wrote: Use Firefox, it won't time out. That depends on the version... I written my code so it informs me on dos command prompt about what picture it is processing and how long it took until starts the next one. The process started fast, but it gradually slows down and I'd bet you're chewing through lots of memory, which is causing swapping, which is why it's slowing down... eventually my web browser (my interface to start the process) timeout but the command prompt is still running. I waited until the command prompt finish all the picture and click open the picture in zope and no action was done on any pictures that was supposely to be resized. That's surprising... I try the same process but targeted only one folder (less pictures)and the process worked fine and all the picture were resized accordingly and the web browser didn't timeout. How come nothing happened when the browser timeout?? A web browser is not the way to drive a batch process like this. I'd suggest you look at stepper: http://www.simplistix.co.uk/software/zope/stepper cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] context.user at ImplPython.py
Hi, Martijn! I think I understand what you say but I have a problem: I don't use any view or object to the render time. Is a method (__call__). Then I can't return the view object at traversal time. How can I then avoid this problem? And If this is correct, why don't work the same with the creation method? If you read the link I put, you could read I can create (with CrearFuncionalidad) but not delete it (with BorrarFuncionalidad) that seems to have the same security necessities Weired think, isn't it? Thank you so much for your help! 2007/3/23, Martijn Pieters [EMAIL PROTECTED]: On 3/22/07, Garito [EMAIL PROTECTED] wrote: I debug ImplPython.py to try to understand why my code don't work ok If you remember my last threat I wonder why some actions marked as Manager execute ok but other not You could refresh your mind about it at: http://archives.free.net.ph/message/20070312.184003.211597ad.en.html When validate (line 237) try to evaluate if the user is autenthicated and has right roles (line 436) the self._authenticated is set to TRUE but context.user is Anonymous User even when I'm authenticated to Garito Is this normal? (this is what causes the error for me) I've seen this happen when creating views in combination with PlonePAS. The issue is that the user authentication hasn't taken place yet at traversal time (when the view is instanciated). Moving the user-dependant code to render time (view.__call__ and methods used in the view template or somesuch) the problem is circumvented. -- Martijn Pieters -- Mis Cosas http://blogs.sistes.net/Garito ___ 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] context.user at ImplPython.py
On 3/23/07, Garito [EMAIL PROTECTED] wrote: I don't use any view or object to the render time. Is a method (__call__). Then I can't return the view object at traversal time. How can I then avoid this problem? At traversal time you indeed cannot rely on the right security context. And If this is correct, why don't work the same with the creation method? The creation happens *after* traversal? If you read the link I put, you could read I can create (with CrearFuncionalidad) but not delete it (with BorrarFuncionalidad) that seems to have the same security necessities Return a callable from your traverser (so return the __call__, don't call it yourself). The publisher will call it for you after the user has been authenticated. -- Martijn Pieters ___ 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] Corrupted ZPT Locks Me Out Of Folder
Somehow a ZPT got corrupted inside one of my Zope 2.62/RedHat 7.3 folders. Now when I try to use the ZMI to open the folder containing the ZPT I get: Site Error An error was encountered while publishing this resource. ImportError Sorry, a site error occurred. Traceback (innermost last): Module ZPublisher.Publish, line 150, in publish_module Module ZPublisher.Publish, line 114, in publish Module Zope.App.startup, line 199, in zpublisher_exception_hook Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec Module App.special_dtml, line 174, in _exec Module DocumentTemplate.DT_In, line 705, in renderwob Module Products.PageTemplates.ZopePageTemplate, line 279, in om_icons Module Products.PageTemplates.PageTemplate, line 169, in _cook Module TAL.TALParser, line 27, in __init__ Module TAL.XMLParser, line 48, in __init__ Module TAL.XMLParser, line 72, in createParser I am able to view the other (non-corrupted) objects in the folder through the web. Now what? How do I delete the corrupted ZPT so I can use the ZMI to get into the folder? ___ 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] Apache-Rewrite - Firewall - Problem
Hi, I'm using an often recommended Apache-Zope rewrite setup to mask the internal folder structure in Zope. The cruxial line in my apache (Debian Etch packaged version 2.2.3) is RewriteRule ^(.*) http://a.b.c.d:9673/VirtualHostBase/http/a.b.c.d:80/myfolder/VirtualHostRoot$1 [P,L] where a.b.c.d is the visible address of the machine from outisde the firewall, myfolder the folder of my Zope application I want to provide under a.b.c.d:80 and as Debian users might are comfortable with 9673 the Zope port (default for Debian). This setup works fine for the old firewall which is not so strict as the new one, that causes the trouble. The new one exclusively enables port 80 (no 22, 25 etc.). If I try the rewrite rule above I get the following line in error.log: [date] [error] (110)Connection timed out: proxy: HTTP: attempt to connect to a.b.c.d:9673 (*) failed access.log says: 194.95.177.123 - - [23/Mar/2007:13:46:58 +0100] GET / HTTP/1.0 503 405 For Debugging purpose I also write a debugging log: (the IP-Adress is replaced by a.b.c.d and the visible DNS name by visible.name) 194.95.177.123 - - [23/Mar/2007:13:46:58 +0100] [visible.name/sid#81869c0][rid#81dc4c0/initial] (2) init rewrite engine with requested uri / 194.95.177.123 - - [23/Mar/2007:13:46:58 +0100] [visible.name/sid#81869c0][rid#81dc4c0/initial] (3) applying pattern '^(.*)' to uri '/' 194.95.177.123 - - [23/Mar/2007:13:46:58 +0100] [visible.name/sid#81869c0][rid#81dc4c0/initial] (2) rewrite '/' - 'http://a.b.c.d:9673/VirtualHostBase/http/a.b.c.d:80/agi/VirtualHostRoot/' 194.95.177.123 - - [23/Mar/2007:13:46:58 +0100] [visible.name/sid#81869c0][rid#81dc4c0/initial] (2) forcing proxy-throughput with http://a.b.c.d:9673/VirtualHostBase/http/a.b.c.d:80/agi/VirtualHostRoot/ 194.95.177.123 - - [23/Mar/2007:13:46:58 +0100] [visible.name/sid#81869c0][rid#81dc4c0/initial] (1) go-ahead with proxy request proxy:http://a.b.c.d:9673/VirtualHostBase/http/a.b.c.d:80/agi/VirtualHostRoot/ [OK] This is exactly the rewrite log I get on the machine that works perfectly behind the old firewall, but the niew one cases the strange error above. When I searched the web with the string in my error.log I stumbled upon the site http://www.dharwadkar.com/weblog/apache_fc6_01 which gives a slight hint, but there is no SELinux on my box at all but there is a hint to the firewall that might cause the problem. I have a vague suspection that this might be very slightly connected with the fact that when I formerly followed the recommendation of http://plone.org/documentation/how-to/plone-with-apache-1.3 to use localhost instead of the IP Adress of the server (or the FQDN) I blatantly failed because the localhost directive was interpreted by my browser that tried to access a local server (that did not existed). So I learned by this that these Rewrite directives are not addressed to the webserver to deliver a different page than requested but to tell the browser to ask for a different page on the server. If I think about this I wonder whether this is a reasonable strategy of redirection and because I do not regard this as reasonable I'm wondering whether there is an option I could change this behaviour in a way that the server directly answers with the result that can be obtained at the rewritten location - which would probably solve my problem. If my suspection that the Browser is advised to obtain the http://a.b.c.d:9673/... something address it is obviouse that this must fail because port 9673 is blocked and there would never be a chance to get any page. Kind regards Andreas. -- http://fam-tille.de ___ 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 can I reset zope time???
On Fri, 23 Mar 2007 14:04:51 +0100 Jens Vagelpohl [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23 Mar 2007, at 12:20, flem wrote: I am a bit confused. My zopeserver runs fine, and all undos have been erased. What I want is to be able to create an object in the zmi which has the correct creation date (e.g. 23rd March 12.20 pm) in the zmi (and the undo history as well). Is this simply impossible because the timestamp in the zodb is always automatically adjusted to the latest date associated to the objects already created (i.e. 12th December 2007)? You hit the nail on the head. The ZODB timestamp is adjusted whenever the ZODB record for an object is changed and the application code has _no_ control over it. Such change could be effected by a content author editing the object, or by an import, or by an undo operation. I think this kind af date-deadlock is a vulnerability of the zope architecture. Is it the same thing with zope3? Isn't it an unnecessary vulnerability that an open zwiki comments field - or any other object making act open to the public where the anyone can set the date - can corrupt the time system irrepairbly. Shouldn't there be some solutions: 1. A script could reset all relevant dates and the timestamp i the zodb. 2. The zope code should be changed so that the timestamp depended directly on the pc-clock notwithstanding the dates of the objects thus allowing for going backward in time. Flemming ___ 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 can I reset zope time???
--On 23. März 2007 16:09:15 +0100 flem [EMAIL PROTECTED] wrote: I think this kind af date-deadlock is a vulnerability of the zope architecture. Is it the same thing with zope3? Isn't it an unnecessary vulnerability that an open zwiki comments field - or any other object making act open to the public where the anyone can set the date - can corrupt the time system irrepairbly. Shouldn't there be some solutions: 1. A script could reset all relevant dates and the timestamp i the zodb. 2. The zope code should be changed so that the timestamp depended directly on the pc-clock notwithstanding the dates of the objects thus allowing for going backward in time. I am not getting the point. What do you want to tell us? -aj pgpcdhZmOtsJZ.pgp Description: 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 )
Re: [Zope] Corrupted ZPT Locks Me Out Of Folder
On 3/23/07, Mark, Jonathan (Integic) [EMAIL PROTECTED] wrote: Module TAL.XMLParser, line 48, in __init__ Module TAL.XMLParser, line 72, in createParser Nothing got corrupted, your python lost it's expat XML parser: def createParser(self, encoding=None): global XMLParseError try: from Products.ParsedXML.Expat import pyexpat XMLParseError = pyexpat.ExpatError return pyexpat.ParserCreate(encoding, ' ') except ImportError: from xml.parsers import expat XMLParseError = expat.ExpatError return expat.ParserCreate(encoding, ' ') In other words, reinstall expat and your ZPT page will reappear. -- Martijn Pieters ___ 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] context.user at ImplPython.py
Please keep the mailing list in the loop, others may have insights too. On 23. mar. 2007, at 15.37, Garito wrote: If you read the link I put, you could read I can create (with CrearFuncionalidad) but not delete it (with BorrarFuncionalidad) that seems to have the same security necessities Return a callable from your traverser (so return the __call__, don't call it yourself). The publisher will call it for you after the user has been authenticated. As Dieter said __bobo_traverse__ can't return strings or ints for that I create (as he tall me, thanks again) a wrapper that returns the rendered code Fine, that's what I ment. But your wrapper should implement a __call__ method. The publisher will call that method at a time where security *has* been set up. Do make sure that you wrap your wrapper in the correct security context though: class Wrapper(Acquisition.Implicit): def __call__(self): # Things that need a security context need to be done here. return getSecurityManager().getAuthenticatedUser().getId() class SomeItem(SimpleItem): def __bobo_traverse__(self, REQUEST, name): if name == 'Wrapper': return Wrapper().__of__(self) else: return getattr(self, name) This way the security policies can still look up the security context. -- Martijn Pieters ___ 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] context.user at ImplPython.py
I don't know if I understand what you say This is the code of one of my wrappers (str one): class WrapperStr(str): __roles__ = None def __bobo_traverse__(self, REQUEST, nombre): obj = getattr(self, nombre, None) if obj is None: return self else: return obj How could be the __call__? like: def __call__(self): return what to return here? Thanks! 2007/3/23, Martijn Pieters [EMAIL PROTECTED]: Please keep the mailing list in the loop, others may have insights too. On 23. mar. 2007, at 15.37, Garito wrote: If you read the link I put, you could read I can create (with CrearFuncionalidad) but not delete it (with BorrarFuncionalidad) that seems to have the same security necessities Return a callable from your traverser (so return the __call__, don't call it yourself). The publisher will call it for you after the user has been authenticated. As Dieter said __bobo_traverse__ can't return strings or ints for that I create (as he tall me, thanks again) a wrapper that returns the rendered code Fine, that's what I ment. But your wrapper should implement a __call__ method. The publisher will call that method at a time where security *has* been set up. Do make sure that you wrap your wrapper in the correct security context though: class Wrapper(Acquisition.Implicit): def __call__(self): # Things that need a security context need to be done here. return getSecurityManager().getAuthenticatedUser().getId() class SomeItem(SimpleItem): def __bobo_traverse__(self, REQUEST, name): if name == 'Wrapper': return Wrapper().__of__(self) else: return getattr(self, name) This way the security policies can still look up the security context. -- Martijn Pieters -- Mis Cosas http://blogs.sistes.net/Garito ___ 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] context.user at ImplPython.py
On 3/23/07, Garito [EMAIL PROTECTED] wrote: I don't know if I understand what you say This is the code of one of my wrappers (str one): class WrapperStr(str): __roles__ = None def __bobo_traverse__(self, REQUEST, nombre): obj = getattr(self, nombre, None) if obj is None: return self else: return obj What kind of object is obj? It should probably be acquisition wrapped (return obj.__of__(self). How could be the __call__? like: def __call__(self): return what to return here? The object returned from __bobo_traverse__ will be called by the publisher, so *it* needs to implement __call__, but index_html and __str__ may also do. -- Martijn Pieters ___ 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] context.user at ImplPython.py
Wow! Now I' more confused than before I create WrapperStr class because the __bobo_traverse__ of my product has problems to return a str But when I try to use it it has an error (I don't remember what, sorry) that dissapears when I create the wrapper's __bobo_traverse__. I copy the behavior from my product's __bobo_traverse__ (I don't know so much what I'm doing I confess) Then my wrapper is an intuitive wrapper Can you lighten about how need to construct a good wrapper? Thanks! 2007/3/23, Martijn Pieters [EMAIL PROTECTED]: On 3/23/07, Garito [EMAIL PROTECTED] wrote: I don't know if I understand what you say This is the code of one of my wrappers (str one): class WrapperStr(str): __roles__ = None def __bobo_traverse__(self, REQUEST, nombre): obj = getattr(self, nombre, None) if obj is None: return self else: return obj What kind of object is obj? It should probably be acquisition wrapped (return obj.__of__(self). How could be the __call__? like: def __call__(self): return what to return here? The object returned from __bobo_traverse__ will be called by the publisher, so *it* needs to implement __call__, but index_html and __str__ may also do. -- Martijn Pieters -- Mis Cosas http://blogs.sistes.net/Garito ___ 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] context.user at ImplPython.py
On 3/23/07, Garito [EMAIL PROTECTED] wrote: But when I try to use it it has an error (I don't remember what, sorry) that dissapears when I create the wrapper's __bobo_traverse__. I copy the behavior from my product's __bobo_traverse__ (I don't know so much what I'm doing I confess) Then my wrapper is an intuitive wrapper We are getting beyond mailing list support capabilities then, at least for me. Hacking about with __bobo_traverse__ and such requires a certain level of insight into the Zope publishing mechanisms that you seem to lack, and take some time to explain. I am not familiar with the contents of Zope books here, so I can't directly recommend anything here either. -- Martijn Pieters ___ 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] context.user at ImplPython.py
Thanks Martijn! I think if I'm not familiar with zope book I can't program what I'm programming But, no problem I try and try to find a solution to my problem Thanks for your clues 2007/3/23, Martijn Pieters [EMAIL PROTECTED]: On 3/23/07, Garito [EMAIL PROTECTED] wrote: But when I try to use it it has an error (I don't remember what, sorry) that dissapears when I create the wrapper's __bobo_traverse__. I copy the behavior from my product's __bobo_traverse__ (I don't know so much what I'm doing I confess) Then my wrapper is an intuitive wrapper We are getting beyond mailing list support capabilities then, at least for me. Hacking about with __bobo_traverse__ and such requires a certain level of insight into the Zope publishing mechanisms that you seem to lack, and take some time to explain. I am not familiar with the contents of Zope books here, so I can't directly recommend anything here either. -- Martijn Pieters -- Mis Cosas http://blogs.sistes.net/Garito ___ 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] V iewlet in rotterdam?
Zope 3.3 I want to add a viewlet to the rotterdam skin. I don't want to create my own skin. is there an accepted way of doing this? I'm surprised that the left sidebar in rotterdam doesn't appear to have a viewlet manager. I have been unable to find any declarations in zcml (grepped for viewletManager through the entire zope source, didn't see anything relevant). It looks like rotterdam makes do with macros, instead of using viewlets. Is there a reason for this? Seems like the left sidebar is perfect for a manager, with a viewlet for navigation and another for the add menu. I am writing a syndication (web feeds: Atom, RSS, etc) package for zope and want to plug my viewlet for accessing feed links directly into rotterdam. Perhaps this isn't the way to do it, but it seems to me that a package like mine that provides general functionality shouldn't define its own skin, but should be usable in other skins. Am I wrong? Thanks, Derek ___ 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] context.user at ImplPython.py
Do you refer something like this?: class WrapperUnicode(unicode): __roles__ = None def __init__(self, cadena): self.cadena = cadena def __bobo_traverse__(self, REQUEST, nombre): obj = getattr(self, nombre, None) if obj is None: return self else: return obj.__of__(self) def __call__(self): return self.cadena def __str__(self): return str(self.cadena.decode('latin-1')) 2007/3/23, Garito [EMAIL PROTECTED]: Thanks Martijn! I think if I'm not familiar with zope book I can't program what I'm programming But, no problem I try and try to find a solution to my problem Thanks for your clues 2007/3/23, Martijn Pieters [EMAIL PROTECTED]: On 3/23/07, Garito [EMAIL PROTECTED] wrote: But when I try to use it it has an error (I don't remember what, sorry) that dissapears when I create the wrapper's __bobo_traverse__. I copy the behavior from my product's __bobo_traverse__ (I don't know so much what I'm doing I confess) Then my wrapper is an intuitive wrapper We are getting beyond mailing list support capabilities then, at least for me. Hacking about with __bobo_traverse__ and such requires a certain level of insight into the Zope publishing mechanisms that you seem to lack, and take some time to explain. I am not familiar with the contents of Zope books here, so I can't directly recommend anything here either. -- Martijn Pieters -- Mis Cosas http://blogs.sistes.net/Garito -- Mis Cosas http://blogs.sistes.net/Garito ___ 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] V iewlet in rotterdam?
Derek Richardson-2 wrote: Zope 3.3 I want to add a viewlet to the rotterdam skin. I don't want to create my own skin. is there an accepted way of doing this? I'm surprised that the left sidebar in rotterdam doesn't appear to have a viewlet manager. I have been unable to find any declarations in zcml (grepped for viewletManager through the entire zope source, didn't see anything relevant). It looks like rotterdam makes do with macros, instead of using viewlets. Is there a reason for this? Seems like the left sidebar is perfect for a manager, with a viewlet for navigation and another for the add menu. I am writing a syndication (web feeds: Atom, RSS, etc) package for zope and want to plug my viewlet for accessing feed links directly into rotterdam. Perhaps this isn't the way to do it, but it seems to me that a package like mine that provides general functionality shouldn't define its own skin, but should be usable in other skins. Am I wrong? From what I understand, Rotterdam is pretty old, and people generally create their own skins from scratch. I don't think a generic component that provides a service (syndication) should be trying to blanket impose a UI. If you want a demo UI, then have a separate package for this, which shows an example UI. The generic component could still have a viewlet, just not wire it up. Martin -- View this message in context: http://www.nabble.com/V-iewlet-in-rotterdam--tf3455247.html#a9639973 Sent from the Zope - General mailing list archive at Nabble.com. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Attribute error
Hi, I'm pretty new to Zope; I inherited the system when I started my new job. We use it to manage a college web site. I noticed yesterday that several pages in our Student Services section will no longer load. Every time I try, I get this: Error Type: AttributeError Error Value: visible And I have no idea what it means or how to fix it. Any suggestions would be much appreciated. You have to start learning about python and zope :) Take a look at site error log (via ZMI) or at event.log in the filesystem to see full error traceback. -- Maciej Wisniowski ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Attribute error
On Fri, Mar 23, 2007 at 02:56:31PM -0500, Catherine E. Reinehr wrote: Hi, I'm pretty new to Zope; I inherited the system when I started my new job. We use it to manage a college web site. I noticed yesterday that several pages in our Student Services section will no longer load. Every time I try, I get this: Error Type: AttributeError Error Value: visible And I have no idea what it means or how to fix it. Any suggestions would be much appreciated. Thanks, Catherine Not enough information... so the first thing to do is go into the zope management interface, click on the /error_log link, and find your error listed there. Click on it to get a more complete traceback. Reply here with that information and you're more likely to get a useful response. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Attribute error
I knew as soon as I asked for help, I would figure it out. Turns out when I added a folder in that section, I forgot to add the attributes visible and order. All better now. Thank you anyway! Catherine - Webmaster Publications Designer Huntingdon College 1500 E. Fairview Ave. Montgomery, AL 36106 (334) 833-4429 / Flowers 103 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Winkler Sent: Friday, March 23, 2007 3:12 PM To: zope@zope.org Subject: Re: [Zope] Attribute error On Fri, Mar 23, 2007 at 02:56:31PM -0500, Catherine E. Reinehr wrote: Hi, I'm pretty new to Zope; I inherited the system when I started my new job. We use it to manage a college web site. I noticed yesterday that several pages in our Student Services section will no longer load. Every time I try, I get this: Error Type: AttributeError Error Value: visible And I have no idea what it means or how to fix it. Any suggestions would be much appreciated. Thanks, Catherine Not enough information... so the first thing to do is go into the zope management interface, click on the /error_log link, and find your error listed there. Click on it to get a more complete traceback. Reply here with that information and you're more likely to get a useful response. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Problem with __before_publishing_traverse__
Peter Bengtsson wrote at 2007-3-23 13:29 +: I have a product that looks like this:: class MyApp(Something): meta_type = 'x' def foobar(self): doc str return xxx def __before_publishing_traverse__(self, object, request=None): print HOUSTON ... When I view objects of this class I'd expect Zope to call the __before_publishing_traverse__ hook and print HOUSTON, but it doesn't :( ... if object.__class__.__name__ == 'MyApp': print object.foobar() print object.foobar print object.__before_publishing_traverse__(object, self) print bpth path = request.path = request['TraversalRequestNameStack'] When I look at the output of this I get: xxx bound method MyApp.foobar of MyApp at /IMS None Maybe, instead of foobar, you should print __before_publishing_traverse__. Five started to fiddle around with __before_publishing_traverse__ (to make Zope 3 traversal available) and maybe this introduced the bug no longer to call the existing __before_publishing_traverse__? -- Dieter ___ 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 )