Re: [Zope] Zope and security vulnerability: 20121106
Am 13.11.2012 10:05, schrieb johannes raggam: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 from the security announcement page: https://plone.org/products/plone/security/advisories/20121106-announcement "This patch is compatible with all supported Plone versions (i.e. Plone 3 and Plone 4), it may work on earlier versions of Plone, but as these are unsupported they have had less testing done." so probably zope versions from 2.10.11 onwards are supported. see: http://dist.plone.org/release/3-latest/versions.cfg other versions UNSUPPORTED. if you really need to know which versions exactly are affected, you HAVE to find out yourself. either by trying it out in a test environment or by analyzing the whole commit history of affected modules in zope. people reported successful patching of Plone2.1 and i patched a Zope 2.8 instance too. but this is informal, not an official statement. Hi! I successfully applied these hotfixes to Zope 2.13 versions without any problems. What puzzles me though is why was there no announcement for theses fixes here on zope ml? Or are these fixes not critical for pure Zope2 users? Or are these all fixed in the latest version of Zope2? kind regards, Jürgen On 11/13/2012 12:49 AM, Marcus Schopen wrote: Am Montag, den 12.11.2012, 11:13 -0700 schrieb Sean Upton: On Mon, Nov 12, 2012 at 5:31 AM, Marcus Schopen wrote: Am Montag, den 12.11.2012, 12:07 + schrieb Richard Harley: So, to clarify, does this affect plain Zope 2.10, no Plone? That's still the question to me ;) Why not try product installation and running your instance in the foreground. If anything breaks, comment out any specific inapplicable hotfix in __init__.py. A brief look at the source will tell you that it is unlikely you should need to do this, as conditional imports check what to apply. Yes, we all can go the long way of try and error and code inspection ... without knowing anything for sure in the end. Ciao! ___ 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 ) - -- programmatic web development di(fh) johannes raggam / thet python plone zope development mail: off...@programmatic.pro web: http://programmatic.pro http://bluedynamics.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCiDWIACgkQW4mNMQxDgAc/sQCfShPVev83pbsd4KVk/RrVGsxJ GAQAoN5wbj//fgCUXPR8lsI0cBBj06SR =Tk6+ -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 ) -- XLhost.de ® - Webhosting von supersmall bis eXtra Large << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 Web: http://www.XLhost.de ___ 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] RelStorage PosKeyError
Hi! I have a reproducible PosKeyError on RelStorage 1.5.1 with MySQL backend. Traceback comes here: Module Products.BlissNewsCenter.BlissNewsCenter, line 77, in view_editNewsletterForm Module Products.BlissNewsletter.Newsletter, line 82, in getFromEmail Module Products.Relateable.Relateable, line 362, in _initAttribute Module Products.Relateable.MetaManager, line 1144, in attributeDefaultValue Module Products.Relateable.MetaManager, line 1, in Module ZODB.Connection, line 860, in setstate Module ZODB.Connection, line 901, in _setstate Module relstorage.storage, line 470, in load POSKeyError: 0x116994 How do i find out which object is broken or how to fix this? thanks in advance & best regards, Jürgen Herrmann -- XLhost.de ® - Webhosting von supersmall bis eXtra Large << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 Web: http://www.XLhost.de ___ 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] changing permissions on classes/methods at runtime?
Am 06.03.2012 09:02, schrieb Lennart Regebro: On Mon, Mar 5, 2012 at 19:22, Sean Upton wrote: On Wed, Feb 29, 2012 at 7:12 AM, Jürgen Herrmann wrote: hi all! is it possible to change permissions and roles on classes/methods at runtime? normally you'd attach security declarations inline in your class definition code: I don't off-hand know why just monkey-patching the security attribute of your class and then calling InitializeClass() again would not work, but the idea of changing these at runtime after initial zope startup sounds a bit odd, possibly dangerous. What is it that you are trying to do? When I needed this to be dynamic I simply did not have any security declaration and instead tested the permissions the first thing I did in the method. That worked fine. It is however probably ten years ago, and I don't remember or have the code. But it was quite simple, I think. //Lennart Since a long time i have a mechanism in place that scans class-specific directories for page templates, dtml files, images, sql-methods etc. and attaches these to the classes. up to now i did mark everything as protected, with a fixed permission, worked fine for my purposes. now i had a use case where i need to mark some templates and methods as public because they use an internal authentication. best regards, jürgen -- XLhost.de ® - Webhosting von supersmall bis eXtra Large << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 Web: http://www.XLhost.de ___ 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] changing permissions on classes/methods at runtime?
hi all! is it possible to change permissions and roles on classes/methods at runtime? normally you'd attach security declarations inline in your class definition code: from AccessControl import ClassSecurityInfo from AccessControl.class_init import InitializeClass class Cls(): security = ClassSecurityInfo() security.declarePrivate('foo') def foo(self): pass InitializeClass(Cls) now what i tried at runtime is: from mycode import Cls from AccessControl import ClassSecurityInfo security = ClassSecurityInfo() security.declarePublic('foo') security.apply(Cls) but this does not what i want it to, in fact it doesn't seem to do anything yet - probably because i'm using the wrong way :) any hints how to do this correctly would be greatly appreciated. thank you very much in advance and best regards, Jürgen Herrmann -- XLhost.de ® - Webhosting von supersmall bis eXtra Large << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 Web: http://www.XLhost.de ___ 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] long running methods
On Thu, 20 May 2010 18:00:43 -0600, Shane Hathaway wrote: > On 05/20/2010 06:18 AM, Jürgen Herrmann wrote: >> def myLongRunningMethod(self): >> >>BATCH_SIZE = 10 >>MAX_CONFLICTS = 3 >> >>work_items = [some, work, to , do, ...] >># list of persistent objects to be modified in this method >> >>idx = 0 >>while idx< len(work_items): >> conflicts = 0 >> try: >>my_batch = work_items[idx, idx+BATCH_SIZE] >>for work_item in my_batch: >> do_some_work(work_item) >>transaction.commit() >> except ConflicError: >>conflicts += 1 >>if conflicts> MAX_CONFLICTS: >> raise >> else: >>idx += BATCH_SIZE >> >> does this sound like a reasonable approach? > > More than that, it looks nearly finished. ;-) The transaction machinery > does all the heavy lifting, so you don't need to do much. Issues to fix: > > - Your code resets the "conflicts" counter in every iteration. You > obviously didn't intend that. hmm, why not? every batch should be retried up to MAX_CONFLICTS times? > > - You should start each loop with "transaction.begin()" to avoid any > side effects of transactions started before the long running method was > called. cool. > > - Writing thorough tests for this kind of code is very important. If > you don't, it might be a while before you discover that ConflictError > was misspelled. actually python wouldn't compile that code above as ConflicError must resolve to a class at compile time but i get your point, agreed :) > > Shane thanks for your answers and have a nice day everbody. jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ 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] long running methods
On Thu, 20 May 2010 15:59:58 +0200, Patrick Gerken wrote: > On Thu, May 20, 2010 at 14:18, Jürgen Herrmann > wrote: > >> >> hi there! >> >> as our zope2 zodb grows we experience more and more conflicts >> with long running transactions. so i'm going to rewrite these >> methods to commit transactions in batches - here my attempt >> to tackle this problem. the idea is to get a list of objects >> to be modified in this transaction, break it down to batches >> and commit after each batch was processed. to avoid zope's >> retry-on-conflict machinery and still have a chance to retry >> per batch transaction commits, the iteration over one batch >> is guarded by a try:except ConflictError: and a retry logic. >> > > Zope already has its own retry mechanism, maybe you might want to > call your long running method multiple times, each time working on the > next batch. > in fact zope's retry machinery is kicking in too often which is a bad thing if the retried transaction runs for say 30min or so. having to gather the list of objects outside of zope, doing the batching there and calling into zope multiple times - i wanted to avoid that. i'd like to have all the logic contained in one zope method for the sake of simplicity on the caller's side (most of these are kicked off by cron jobs). jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ 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] long running methods
hi there! as our zope2 zodb grows we experience more and more conflicts with long running transactions. so i'm going to rewrite these methods to commit transactions in batches - here my attempt to tackle this problem. the idea is to get a list of objects to be modified in this transaction, break it down to batches and commit after each batch was processed. to avoid zope's retry-on-conflict machinery and still have a chance to retry per batch transaction commits, the iteration over one batch is guarded by a try:except ConflictError: and a retry logic. i wrote some more or less pseudo code to make this clear. def myLongRunningMethod(self): BATCH_SIZE = 10 MAX_CONFLICTS = 3 work_items = [some, work, to , do, ...] # list of persistent objects to be modified in this method idx = 0 while idx < len(work_items): conflicts = 0 try: my_batch = work_items[idx, idx+BATCH_SIZE] for work_item in my_batch: do_some_work(work_item) transaction.commit() except ConflicError: conflicts += 1 if conflicts > MAX_CONFLICTS: raise else: idx += BATCH_SIZE does this sound like a reasonable approach? jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ 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] sharing instance_home?
On Wed, November 4, 2009 15:05, Chris Withers wrote: > Jürgen Herrmann wrote: >> no how can i run 2 zope processes from the same instance >> home with 2 different config files? > > What version of Zope is this? > > Should be fine, provided the instances are configured to use different > pid files, log files, local zodb cache files, etc... > > Chris > - it's zope 2.12.1 . - i configured different log/pid files in the different configs. jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ 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] sharing instance_home?
currently i'm running a single zope2 process with relstorage as storage backend. to improve performance for our end users i'd like to fire up a 2nd zope2 process that will handle all internal background processes and db packing. for simplicity's sake i'd like to share the instance_home directory between these two processes, just use a different config file to enter a different http port for each server. no how can i run 2 zope processes from the same instance home with 2 different config files? modifying $INSTANCE_HOME/zopectl to include a different config file name does not work, as it's also contained in $INSTANCE_HOME/runzope. renaming/modifying runzope does not work either, as it's name is hardcoded somewhere in zopectl. thanks in advance and best regards, jürgen herrmann -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ 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-dev] zope2.12.a04 / relstorage / zodbconvert.py errors
Shane Hathaway wrote: > Jürgen Herrmann wrote: > > ZConfig.SchemaResourceError: import name does not refer to a package > > Package name: 'relstorage' > > File name: 'component.xml' > > Package path: None > > I need to make a new release of RelStorage before this will work. > RelStorage 1.1.3 does not work with ZODB 3.9, but the current RelStorage > trunk does. I intend to package and release a compatible version today > or tomorrow. > > FWIW, I suspect ZConfig is attempting to import relstorage and getting > an ImportError due to the incompatibility, but then ZConfig is > converting the ImportError into a strange SchemaResourceError. It would > be much better if ZConfig just propagated the ImportError. > > Shane hi shane. i tried your 1.2.0beta release today and it works like a charm. python version is now 2.6.2 and zope version 2.12.0b1 thanks for your support! best regards, jürgen herrmann -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] [Zope-dev] zope 2.12.0b1 bug - standard_error_message
On Wed, May 6, 2009 16:41, Chris Withers wrote: > Jürgen Herrmann wrote: >> of course i added a print statement and check if it's called. >> it is. > > You're missing the point: > > That code has always been called when standard_error_message can't be > found, it's a backstop. > > If you want to solve this issue, you need to find out why the > standard_error_message isn't being found... > > Chris > ok, that's interesting to know. maybe i'll dig a bit deeper then today evening... thanks! -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] [Zope-dev] zope 2.12.0b1 bug - standard_error_message
On Wed, May 6, 2009 16:16, Chris Withers wrote: > Jürgen Herrmann wrote: >> 1. standard_error_message is not used, this is due to code in >>ZPublisher/HTTPResponse.py, method _error_html(self,title,body) comment: >> XXX could this try to use standard_error_message somehow? > > The code you're referring to is as old as the hills, so I don't think that's > it. > > Something else is causing standard_error_message not to be used, I've noticed > this too and got bitched at for asking if anyone knew what change had caused the problem. > > Let me know if you get any further and where the issue is in launchpad when > you raise it. > > cheers, > > Chris of course i added a print statement and check if it's called. it is. best regards, jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] [Zope-dev] zope 2.12.0b1 bug - standard_error_message
On Wed, May 6, 2009 16:16, Chris Withers wrote: > Jürgen Herrmann wrote: >> 1. standard_error_message is not used, this is due to code in >>ZPublisher/HTTPResponse.py, method _error_html(self,title,body) comment: >> XXX could this try to use standard_error_message somehow? > > The code you're referring to is as old as the hills, so I don't think that's > it. > > Something else is causing standard_error_message not to be used, I've noticed > this too and got bitched at for asking if anyone knew what change had caused the problem. > > Let me know if you get any further and where the issue is in launchpad when > you raise it. > > cheers, > > Chris i forgot: bugtracker entry is here: https://bugs.launchpad.net/zope2/+bug/372632 best regards, jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] [Zope-dev] zope 2.12.0b1 bugs - "try it" tab broken on scripts
On Wed, May 6, 2009 16:17, Chris Withers wrote: > Jürgen Herrmann wrote: >> 2."Script Python" instances don't execute anymore. not the ones already in >>the db from the zope 2.10 install i used before nor newly created ones. >>traceback: > > Yes they do ;-) > >> * Module ZPublisher.Publish, line 208, in publish_module_standard >> * Module ZPublisher.Publish, line 151, in publish >> * Module Zope2.App.startup, line 249, in __call__ >> * Module ZPublisher.Publish, line 120, in publish >> * Module ZPublisher.mapply, line 77, in mapply >> * Module ZPublisher.Publish, line 43, in call_object >> * Module Shared.DC.Scripts.Bindings, line 324, in __call__ >> * Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec >> * Module App.special_dtml, line 185, in _exec >> * Module DocumentTemplate.DT_In, line 634, in renderwob >> * Module DocumentTemplate.DT_Raise, line 68, in render >>RuntimeError: http://new-manage.xlhost.local/bliss/cms > > The "Try it" tab, however, is broken... My guess is that form that > renders the tab is trying to iterate over something in dtml and getting > something unexpected. > > cheers, > > Chris there were more answers to this topic than the std_err_msg case. launchpad entry is here: https://bugs.launchpad.net/zope2/+bug/372629 best regards, jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] zope2, buildout and relstorage
i want to use relstorage with zope 2.10 and have read about the "fake egg" procedure at http://pypi.python.org/pypi/plone.recipe.zope2install is there any documentation how to use that recipe? i tried downloading and unpacking from http://pypi.python.org/packages/source/p/plone.recipe.zope2install/ but i'm, a bit lost there. from the readme i read that i should run "python2.4 bootstrap.py" first, and then? obviously the shipped buildout.cfg puts a zope2 source tree in parts/zope2 after running bin/buildout. the "eggs" dir contains: plone.recipe.zope~all-3.0-py2.4.egg setuptools-0.6c9-py2.4.egg zc.buildout-1.2.1-py2.4.egg and fake-eggs has: Acquisition/ zope.app.renderer/ ClientForm/zope.app.rotterdam/ DateTime/ zope.app.schema/ docutils/ zope.app.security/ ExtensionClass/zope.app.servicenames/ mechanize/ zope.app.session/ Persistence/ zope.app.site/ pytz/ zope.app.size/ RestrictedPython/ zope.app.skins/ tempstorage/ zope.app.sqlscript/ ZConfig/ zope.app.testing/ zdaemon/ zope.app.tests/ zLOG/ zope.app.timezones/ ZODB3/ zope.app.traversing/ zodbcode/ zope.app.tree/ Zope2/ zope.app.undo/ zope.annotation/ zope.app.wfmc/ zope.app/ zope.app.wsgi/ zope.app.annotation/ zope.app.zapi/ zope.app.apidoc/ zope.app.zopeappgenerations/ zope.app.applicationcontrol/ zope.app.zptpage/ zope.app.appsetup/ zope.cachedescriptors/ zope.app.authentication/ zope.component/ zope.app.basicskin/zope.configuration/ zope.app.broken/ zope.contentprovider/ zope.app.cache/zope.contenttype/ zope.app.component/zope.copypastemove/ zope.app.container/zope.datetime/ zope.app.content/ zope.decorator/ zope.app.content_types/zope.deferredimport/ zope.app.copypastemove/zope.deprecation/ zope.app.datetimeutils/zope.documenttemplate/ zope.app.debug/zope.dottedname/ zope.app.decorator/zope.dublincore/ zope.app.dependable/ zope.event/ zope.app.dtmlpage/ zope.exceptions/ zope.app.dublincore/ zope.filerepresentation/ zope.app.error/zope.formlib/ zope.app.event/zope.hookable/ zope.app.exception/zope.i18n/ zope.app.file/ zope.i18nmessageid/ zope.app.filerepresentation/ zope.index/ zope.app.folder/ zope.interface/ zope.app.form/ zope.lifecycleevent/ zope.app.ftests/ zope.location/ zope.app.generations/ zope.modulealias/ zope.app.http/ zope.pagetemplate/ zope.app.i18n/ zope.proxy/ zope.app.interface/zope.publisher/ zope.app.intid/zope.rdb/ zope.app.introspector/ zope.schema/ zope.app.keyreference/ zope.security/ zope.app.layers/ zope.sendmail/ zope.app.locales/ zope.server/ zope.app.location/ zope.size/ zope.app.mail/ zope.structuredtext/ zope.app.onlinehelp/ zope.tal/ zope.app.pagetemplate/ zope.tales/ zope.app.preference/ zope.testbrowser/ zope.app.preview/ zope.testing/ zope.app.principalannotation/ zope.thread/ zope.app.publication/ zope.traversing/ zope.app.publisher/zope.viewlet/ zope.app.rdb/ zope.wfmc/ how do i move forward from here? how to use that source tree and how to install relstorage into it? thanks in advance and best regards! jürgen -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] relstorage on zope 2.10.5
hi there! today i thought i'ds give relstorage a try, esp. for it's small startup times compared to filestorage. i followed the instructions at http://pypi.python.org/pypi/RelStorage#installation an when calling "python2.4 setup.py install --install-lib=${INSTANCE_HOME}/lib/python" (instance home is set of course) if get: -- snip -- ... Installed /home/xlhost/zope/lib/python/RelStorage-1.1.3-py2.4.egg Processing dependencies for RelStorage==1.1.3 Searching for ZODB3>=3.7.0 Reading http://pypi.python.org/simple/ZODB3/ Reading http://wiki.zope.org/ZODB Reading http://www.zope.org/Products/ZODB3 Reading http://zope.org/Products/ZODB3.2 Reading http://www.zope.org/Products/ZODB3.4 Reading http://zope.org/Products/ZODB3.5 Reading http://www.zope.org/Products/ZODB3.5 Reading http://www.zope.org/Products/ZODB3.6 Reading http://www.zope.org/Products/ZODB3.3 Reading http://zope.org/Products/ZODB3.1 Best match: ZODB3 3.9.0a12 Downloading http://pypi.python.org/packages/source/Z/ZODB3/ZODB3-3.9.0a12.tar.gz#md5=96bc2b1b04baf4ed4713d3715e24dc03 Processing ZODB3-3.9.0a12.tar.gz ... -- snip -- the version of zopdb shipped with zope 2.10.5 is 3.7.1, so why does the command above try to pull an alpha release of zodb? can in "pin" the version of zodb to 3.7.1? my versions used: - (Zope 2.10.5-final, python 2.4.4, linux2) - Python Version 2.4.4 (#1, Aug 8 2007, 09:54:51) [GCC 4.1.2 20070302 (prerelease) (4.1.2-1mdv2007.1)] thanks in advance and best regards, jürgen herrmann -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] RIP Zope 2!
On Fri, April 3, 2009 21:18, Aleksey Tsalolikhin wrote: > Hi. FYI, I have a client using Zope 2 in production. I am migrating > him from Zope 2.7 on SUSE 10.1 to Zope 2.10 on CentOS 5.2. > > He's not using plone. He has a custom Web app. He expects to keep > using Zope 2, and to continue development of our Web application. > hi there. i think it's important for you guys to let you know that xlhost.de is also run completely on a zope backend. we use 100% zodb for all business objects. we were able to jump from release to release starting back then at 2.6 and now latest 2.10 is running since a few days. there were two products that actually broke during this time when moving to a new major zope 2 version: - localfs, as discussed which needed a few minor tweaks to keep it running. i did them myself, primarily because i wanted to keep going on immediately and i didn't want to look or even wait for a fixed version. it wasn't rocket science to make those corrections to the code, so no maintenance nightmare in sight here. - unrestricted pagetemplates, i had to come up with my own solution here, because it broke when moving to 2.8 and had some patches on board that deeply relied on 2.7 interna, as far as i remember. work needed was ~2h, so nothing to worry about either. otherwise the upgrades were always pretty smooth, i like the "big monolythic tarball release" very much, as the upgrade process is very straightforward: download, unpack, build, install. in cannot see this "maintenance nightmare" asf. that certain people on this list proclaim to exist regarding zope2. as long as all those zope3-ish stuff and it's docs (if they really exist) is so scattered across million places, all that stuff is pretty unattractive to "old school" zope users like myself, that have to keep a business running based on zope2. would i have to choose a appserver/db/whatever again for my backend, i'd go for something else, but not zope anymore. reason? well just look at zope.org, enough said. not even a basic version of a new page has made it to life yet - reasons therefor? i don't know. i've been following zope and zope-dev mls for quite some time and over time the tone spoken here has not improved, rather the opposite is true. this is quite contrary to a few other devel mls i'm on! please don't get me wrong, i don't want to piss anybody off here. i'm quite happy to have zope running, and it's running very fine indeed. i can help myself out with almost all problems nowadays, but i have people in mind that are new to zope and want to try it. and if i try to "feel" the situation these folks are in, i'd probably not choose zope for various reasons. seems like more and more things are dying in the zope world :( the only thing i can try to suggest for real improvement is: get things going. try them. don't kill good ideas by bad discussion right from the start. think positive. :) otherwise the zope community will never grow again. everybody can decide for himself it community growth is a good thing for him or not. i think some people are of the latter kind :/ just my two cents, it was time to speak up. in no way did i mean to insult anybody personally here, just in case... best regards and keep up the good work! jürgen herrmann -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] automagic bome header at start of utf16 content?
On Thu, January 8, 2009 11:04, Andreas Jung wrote: > On 08.01.2009 10:33 Uhr, Jürgen Herrmann wrote: >> i already sent the request directly to the zope server >> omitting our apache proxy and monitored traffic with wireshark. the >> com header comes from zope. i did not find anything in zope's code >> that heuristically finds out this is utf16 content and prepends the >> BOM header. so i'm a bit confused where zope takes it's wisdom from :) >> anybody? > > I can not remember having seen any kind of code with the Zope core > setting the BOM. We have code in the pagetemplate implementation > interpreting a BOM but I have doubt that Zope sends a BOM out by itself > (especially not for utf-16). > > Andreas i wrote a small python script to check this out, content: request = container.REQUEST RESPONSE = request.RESPONSE RESPONSE.setHeader('Content-Type', 'x-bom-test') RESPONSE.setHeader('Content-Disposition', 'attachment; filename=bom_test.dat') ustring = u'sgh sdgh\ns\xf6\xe4\xe4gddp\xe4s\n\u8a0a\u4ee5\u53ca\u76f8\u95dc\u7db2\u7d61\u670d\u52d9' return ustring.encode('utf16') here's what wireshark captured: 00 16 17 1e 26 c6 00 1d 09 b8 cf cb 08 00 45 00 &... ..E. 0010 01 46 93 51 40 00 40 06 21 f6 c0 a8 01 79 c0 a8 @.@. !y.. 0020 01 a1 1f 91 0d 2f a9 b9 5b 33 55 8e 5f 1f 50 18 ./.. [3U._.P. 0030 1d 50 d1 0b 00 00 48 54 54 50 2f 31 2e 31 20 32 .PHT TP/1.1 2 0040 30 30 20 4f 4b 0d 0a 53 65 72 76 65 72 3a 20 5a 00 OK..S erver: Z 0050 6f 70 65 2f 28 5a 6f 70 65 20 32 2e 31 30 2e 35 ope/(Zop e 2.10.5 0060 2d 66 69 6e 61 6c 2c 20 70 79 74 68 6f 6e 20 32 -final, python 2 0070 2e 34 2e 34 2c 20 6c 69 6e 75 78 32 29 20 5a 53 .4.4, li nux2) ZS 0080 65 72 76 65 72 2f 31 2e 31 0d 0a 44 61 74 65 3a erver/1. 1..Date: 0090 20 54 68 75 2c 20 30 38 20 4a 61 6e 20 32 30 30Thu, 08 Jan 200 00a0 39 20 31 30 3a 32 30 3a 34 35 20 47 4d 54 0d 0a 9 10:20: 45 GMT.. 00b0 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 Content- Length: 00c0 36 30 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 60..Cont ent-Type 00d0 3a 20 78 2d 62 6f 6d 2d 74 65 73 74 0d 0a 43 6f : x-bom- test..Co 00e0 6e 74 65 6e 74 2d 44 69 73 70 6f 73 69 74 69 6f ntent-Di spositio 00f0 6e 3a 20 61 74 74 61 63 68 6d 65 6e 74 3b 20 66 n: attac hment; f 0100 69 6c 65 6e 61 6d 65 3d 62 6f 6d 5f 74 65 73 74 ilename= bom_test 0110 2e 64 61 74 0d 0a 0d 0a ff fe 73 00 67 00 68 00 .dat ..s.g.h. 0120 20 00 73 00 64 00 67 00 68 00 0a 00 73 00 f6 00.s.d.g. h...s... 0130 e4 00 e4 00 67 00 64 00 64 00 70 00 e4 00 73 00 g.d. d.p...s. 0140 0a 00 0a 8a e5 4e ca 53 f8 76 dc 95 b2 7d 61 7d .N.S .v...}a} 0150 0d 67 d9 52.g.R look at offset 0x0119... ok, time to look at repr(ustring.encode('utf16')): '\xff\xfes\x00g\x00h\x00 \x00s\x00d\x00g\x00h\x00\n\x00s\x00\xf6\x00\xe4\x00'\ '\xe4\x00g\x00d\x00d\x00p\x00\xe4\x00s\x00\n\x00\n\x8a\xe5N\xcaS\xf8v\xdc\x95'\ '\xb2}a}\rg\xd9R' bam! i din't exepct that encoding in utf16 would add a bom header by itself... sorry for posting so lenghty, thought that it might be interesting for people having to deal with utf16... best regards, jürgen herrmann -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] automagic bome header at start of utf16 content?
On Thu, January 8, 2009 11:04, Andreas Jung wrote: > On 08.01.2009 10:33 Uhr, Jürgen Herrmann wrote: >> i already sent the request directly to the zope server >> omitting our apache proxy and monitored traffic with wireshark. the >> com header comes from zope. i did not find anything in zope's code >> that heuristically finds out this is utf16 content and prepends the >> BOM header. so i'm a bit confused where zope takes it's wisdom from :) >> anybody? > > I can not remember having seen any kind of code with the Zope core > setting the BOM. We have code in the pagetemplate implementation > interpreting a BOM but I have doubt that Zope sends a BOM out by itself > (especially not for utf-16). > > Andreas > dammit, i couldn't imagine zope doing such myself. i will investigate further :/ thanks for your reply! -- >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Boelckestrasse 21, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.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] automagic bome header at start of utf16 content?
hello! i'm debugging a problem with our licence generation application. it spits out a ini file for our actual licence generator program (windows exe). to maintain backwards compatibility with an older version i try to encode the content windows-1252 if possibly, utf16 otherwise. on top of the method id do somthing like this: REQUEST.RESPONSE.setHeader('Content-Type', 'x-limiall-ini') REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment; filename=bla.blub') lines is a list of unicode strings. then i do: try: return '\r\n'.join(lines).encode('windows-1252') except UnicodeEncodeError: return '\r\n'.join(lines).encode('utf16') if there are unicode chars in the strings, that cannot be encoded in windows-1252, i get a file with a correct BOM header at the start ('\xFF\xFE'), which is exactly what we need. but i wonder where it comes from. i already sent the request directly to the zope server omitting our apache proxy and monitored traffic with wireshark. the com header comes from zope. i did not find anything in zope's code that heuristically finds out this is utf16 content and prepends the BOM header. so i'm a bit confused where zope takes it's wisdom from :) anybody? best regards, jürgen herrmann ___ 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] Error starting zope - undefined symbol: PyUnicodeUCS2_AsEncodedString
On Thu, June 21, 2007 11:02, John Schinnerer wrote: > > > John Schinnerer wrote: >> >> >> Andreas Jung wrote: >>> >>> >>> --On 20. Juni 2007 21:58:18 -1000 John Schinnerer >>> <[EMAIL PROTECTED]> wrote: >>>> Thanks...I have no idea how to do that unfortunately. >>>> This is the first time I've built python from source. I just followed the >>>> build instructions in the tarball and "it worked." At least, I have a >>>> working python 2.3 in the location I specified for "--with-python" when building zope. >>>> From various list messages about this same error message I get that >>>> there is some mismatch involving UCS2 vs. UCS4 compiled pieces - if I grok >>>> correctly...? >>> >>> Right. >>> >>> If you install Python using >>> >>> configure --prefix=/opt/python-2.4; make;make install >>> >>> and configure Zope using >>> >>> configure --with-python=/opt/python-2.4/bin/python2.4; make; make >>> install >>> >>> you should never get into such trouble. Somehow your environment or setup >>> must be broken. Possibly you're installing Zope over an existing Zope installation with possibly old zopectl/runzope files inside the 'bin' folder >>> which won't be replaced by "make install". So check the "python" >>> configuration within your bin/zopectl|runzope files. >> >> Thanks again - the above is what I thought I did (matching the --prefix and >> the --with-python) - however somewhere I blew it somehow as the control files point to the wrong python. >> I'll try again and hopefully get it right. Thanks for the extra assist. > > Well, I'm not crazy. I just rebuilt it all and triple checked that I gave the > matching --with-python when configuring the zope build. I did. And, it did not get used...the zopectl and runzope files were created with the default path (to the wrong python) anyhow! did you really delete the existing files in your bin folder before installing zope again? these files are NOT recreated! regards, jürgen > > So I fixed that manually, and now (after fixing some perms issues) it starts > up OK. > > thanks again, > John S. > > -- > John Schinnerer, MA WSD > -- > - Eco-Living - > Whole Systems Design Services > People - Place - Learning - Integration > [EMAIL PROTECTED] > http://eco-living.net > ___ > 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 ) > ___ >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Konrad Adenauer Allee 43, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: [EMAIL PROTECTED] ___ >> XLhost.de - eXperts in Linux hosting ® << XLhost.de GmbH Jürgen Herrmann, Geschäftsführer Konrad Adenauer Allee 43, 93051 Regensburg, Germany Geschäftsführer: Volker Geith, Jürgen Herrmann Registriert unter: HRB9918 Umsatzsteuer-Identifikationsnummer: DE245931218 Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)700 XLHOSTDE [0700 95467833] WEB: http://www.XLhost.de IRC: [EMAIL PROTECTED] ___ 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] Apache2 Rewrite: Too much traffic OR nothing
you should set "ProxyRequests Off"... regards, jürgen herrmann On Wed, November 22, 2006 13:42, Flemming Bjerke wrote: > Does anyone know what to do??? > > The following rewrite rule works fine: > > > ServerName www.it-pol.dk > UseCanonicalName Off > ServerSignature On > RewriteEngine On > ProxyVia On > RewriteLog "/var/log/apache2/rewrite_log" > RewriteLogLevel 9 > RewriteRule ^/(.*)$ > http://localhost:8080/VirtualHostBase/http/itpol.dk:80/vh/itpol/VirtualHostRoot/$1 > [L,P] > > > The rule works fine when proxy.conf is like this: > > > Allow from localhost > > > But, this opens for a LOT of traffic. > > The problem is that I cannot get the rewrite rule to work without allowing > the all this unwanted traffic. For instance, the following directives give a 403 forbidden. > > > Order Deny,Allow > Allow from localhost > Deny from all > > > or > > > Allow from localhost > Deny from all > > > Instead of localhost, I have tried IP-address and domain-name. The same > problem! > > I run Apache2.0.54 on a Debian Sarge server. > > Flemming > > From apache error.log: > > What I don't like: > [Wed Nov 22 13:33:01 2006] [error] [client me] client denied by server > configuration: > proxy:http://localhost:8080/VirtualHostBase/http/www.itpol.dk:80/vh/itpol/VirtualHostRoot/ > > What I like:[Wed Nov 22 13:40:26 2006] [error] [client 222.82.159.40] client > denied by server configuration: proxy:http://log.cpc.sohu.com:90/?pv.png, referer: > http://adsence.sogou.com/index.html?pid=jinwutuan&ww=145&dc=1&dir=0&num=5&color=4&charset=gb > > > ___ > 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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] storing persisten object in python dictionaries
On Thu, October 26, 2006 16:03, Jürgen Herrmann wrote: > > > On Thu, October 26, 2006 15:25, Jürgen Herrmann wrote: >> >> On Thu, October 26, 2006 15:00, Marco Bizzarri wrote: >>> On 10/26/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >>>> >>>> On Thu, October 26, 2006 14:53, Marco Bizzarri wrote: >>>> > Storing persistent object in object outside of ZODB can incur in the >>>> > problem of passing > object(s) between threads, and, therefore, passing one object which is > related to a > connection on the ZODB to another context with a different connection. >>> >>>> ok, this is probably the problem here, so would haveing a cache dict for >>>> each thread help? > there are only about 50-100 containers so the memory overhead would be > neglible compared to > the performance gained. >>> >>> Yes, this should probably resolve your issue. >>> >> ok, just reimplemented my _classContainer(className) method as follows: >> >> def _classContainer(self, className): >> """ return the instances folder for className """ >> thread = currentThread() >> containerDict = getattr(thread, '_relClsContainerDict', None) if >> containerDict is None: >> containerDict = {} >> thread._relClsContainerDict = containerDict >> container = containerDict.get(className, None) >> if container is None: >> container = >> self.unrestrictedTraverse(self._classContainerPath(className)) > containerDict[className] = container >> return container >> >> it seems to work fine, all tests pass, though i have a somewhat bad feeliong >> of setting an > attribute on the thread object directly. >> comments? >> > uhm, ran some more tests, seems this works fine for the first thread but not > for the others, i get > an error when loading a framed page > for example (obviously the browser sends two concurrent requests). > > the error is as follows: > ... > * Module Products.Relateable.Relateable, line 96, in relatedObjectIDs * > Module > ZODB.Connection, line 729, in setstate > > ConnectionStateError: Shouldn't load state for 0x010f98 when the connection > is closed > > the above code can obvioulsy only work if there is exactly one single > connection tied to one > thread and it's not closed while the thread is alive. > > anybody have suggestions on how to tackle this? > > best regards, jürgen herrmann seems i can answer my quesitons for myself today :) i figured if it's a per-connection problem - why not store the dict at the connection... the code now reads as follows: def _classContainer(self, className): """ return the instances folder for className """ conn = self._p_jar containerDict = getattr(conn, '_relClsContainerDict', None) if containerDict is None: containerDict = {} conn._relClsContainerDict = containerDict container = containerDict.get(className, None) if container is None: container = self.unrestrictedTraverse(self._classContainerPath(className)) containerDict[className] = container return container we'll see if this throws up other problems... best regards, jürgen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] storing persisten object in python dictionaries
On Thu, October 26, 2006 15:25, Jürgen Herrmann wrote: > > On Thu, October 26, 2006 15:00, Marco Bizzarri wrote: >> On 10/26/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >>> >>> On Thu, October 26, 2006 14:53, Marco Bizzarri wrote: >>> > Storing persistent object in object outside of ZODB can incur in the >>> > problem of passing object(s) between threads, and, therefore, passing one object which is related to a connection on the ZODB to another context with a different connection. >> >>> ok, this is probably the problem here, so would haveing a cache dict for >>> each thread help? there are only about 50-100 containers so the memory overhead would be neglible compared to the performance gained. >> >> Yes, this should probably resolve your issue. >> > ok, just reimplemented my _classContainer(className) method as follows: > > def _classContainer(self, className): > """ return the instances folder for className """ > thread = currentThread() > containerDict = getattr(thread, '_relClsContainerDict', None) if > containerDict is None: > containerDict = {} > thread._relClsContainerDict = containerDict > container = containerDict.get(className, None) > if container is None: > container = > self.unrestrictedTraverse(self._classContainerPath(className)) containerDict[className] = container > return container > > it seems to work fine, all tests pass, though i have a somewhat bad feeliong > of setting an attribute on the thread object directly. > comments? > uhm, ran some more tests, seems this works fine for the first thread but not for the others, i get an error when loading a framed page for example (obviously the browser sends two concurrent requests). the error is as follows: ... * Module Products.Relateable.Relateable, line 96, in relatedObjectIDs * Module ZODB.Connection, line 729, in setstate ConnectionStateError: Shouldn't load state for 0x010f98 when the connection is closed the above code can obvioulsy only work if there is exactly one single connection tied to one thread and it's not closed while the thread is alive. anybody have suggestions on how to tackle this? best regards, jürgen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] storing persisten object in python dictionaries
On Thu, October 26, 2006 15:00, Marco Bizzarri wrote: > On 10/26/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> >> On Thu, October 26, 2006 14:53, Marco Bizzarri wrote: >> > Storing persistent object in object outside of ZODB can incur in the >> > problem of passing object(s) between threads, and, therefore, passing >> > one object which is related to a connection on the ZODB to another >> > context with a different connection. > >> ok, this is probably the problem here, so would haveing a cache dict >> for each thread help? there are only about 50-100 containers so the >> memory overhead would be neglible compared to the performance gained. > > Yes, this should probably resolve your issue. > ok, just reimplemented my _classContainer(className) method as follows: def _classContainer(self, className): """ return the instances folder for className """ thread = currentThread() containerDict = getattr(thread, '_relClsContainerDict', None) if containerDict is None: containerDict = {} thread._relClsContainerDict = containerDict container = containerDict.get(className, None) if container is None: container = self.unrestrictedTraverse(self._classContainerPath(className)) containerDict[className] = container return container it seems to work fine, all tests pass, though i have a somewhat bad feeliong of setting an attribute on the thread object directly. comments? best regards, jürgen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] storing persisten object in python dictionaries
On Thu, October 26, 2006 15:00, Marco Bizzarri wrote: > On 10/26/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> >> On Thu, October 26, 2006 14:53, Marco Bizzarri wrote: >> > Storing persistent object in object outside of ZODB can incur in the >> > problem of passing object(s) between threads, and, therefore, passing >> > one object which is related to a connection on the ZODB to another >> > context with a different connection. > >> ok, this is probably the problem here, so would haveing a cache dict >> for each thread help? there are only about 50-100 containers so the >> memory overhead would be neglible compared to the performance gained. > > Yes, this should probably resolve your issue. > >> > >> > Also, AFAIK, keep in mind _v_ attributes are not involved in >> > transaction machinery of Zope. This means that if you have an error >> > inside you transaction after you modified the _v_ cache, you will have >> > the cache modified even tough the transaction has been aborted. >> not a real problem as class instance containers are very static. > > I understand, we hit this problem while caching object obtained from > database rows... and in case of failure cache became unreliable. > > I'm keeping the answer on the ML, if you don't mid. of course, my failure while responding. > > -- > Marco Bizzarri > http://iliveinpisa.blogspot.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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] storing persisten object in python dictionaries
hi! i have a writeen am framework where objects have unique ids and instances are stored in btreefolders, one per class. if i want to retrieve an instance based on id, i lookup it's class name and the get the class' container path from my metadata manager (f.ex. "/app/data/Appointments/instances"). now i traverse to this container and get the object with given id from there. the process of traversing to the class' container folder is done on each object get. a cool optimization for me would be to cache class container folders in a python dictionary (much faster than traversal), but this doesn't work. the main problem is that objects retrieved from these cached folders have broken acquisition. actually i asked a similar question some time ago and was told: "don't store persistent objects in python dicts." i changed my code back to traversal and everything works, but now i finally reached the optimization stage and profiling indeed shows a huge improvement in object lookup with class container caching enabled. so can anybody tell me why this doesn't work, or what to respect to make it working? btw. the cache dict is implemented as a volatile attribute (_v_classContainerDict) of a singleton object in the db. best regards, jürgen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Konrad Adenauer Allee 43, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] global name 'context' not defined in TrustedFSPageTemplate
On Thu, June 1, 2006 18:13, Jürgen Herrmann wrote: > > On Thu, June 1, 2006 18:08, Jonathan wrote: >> >> - Original Message - >> From: "Jürgen Herrmann" <[EMAIL PROTECTED]> >> To: >> Sent: Thursday, June 01, 2006 11:51 AM >> Subject: [Zope] global name 'context' not defined in TrustedFSPageTemplate >> >> >>> hi! >>> >>> i get the following error in one of my trusted page template files: >>> >>> 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 Shared.DC.Scripts.Bindings, line 311, in __call__ >>>* Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec >>>* Module Products.CMFCore.FSPageTemplate, line 195, in _exec >>>* Module Products.TrustedExecutables.TrustedFSPageTemplate, line 31, in >>> pt_render >>>* Module Products.PageTemplates.PageTemplate, line 104, in pt_render >>> >>>* Module TAL.TALInterpreter, line 238, in __call__ >>>* Module TAL.TALInterpreter, line 281, in interpret >>>* Module TAL.TALInterpreter, line 507, in do_setLocal_tal >>>* Module Products.PageTemplates.TALES, line 221, in evaluate >>> URL: >>> file:/home/bliss/zope/Products/BlissCalendar/www/BlissCalendar/show_content_week.xpt >>> Line 3, Column 0 >>> Expression: >> cmp(context.utils.text2date(a), >>> context.utils.text2date(b)))> >>> Names: >>> >>> {'container': , >>> 'context': , >>> 'default': >> 0xb703850c>, >>> 'here': , >>> 'loop': >> 0xb5d9426c>, >>> 'modules': >>> >> 0xb6fa1b8c>, >>> 'nothing': None, >>> 'options': {'args': ()}, >>> 'repeat': >> 0xb5d9426c>, >>> 'request': >> URL=https://bliss.local/BlissCalendar/show_content_week>, >>> 'root': , >>> 'template': >> /bliss/BlissCalendar/show_content_week>, >>> 'traverse_subpath': [], >>> 'user': >> /bliss/acl_users>} >>> >>>* Module Products.PageTemplates.PythonExpr, line 70, in __call__ >>> __traceback_info__: dates.sort(lambda a,b: >>> cmp(context.utils.text2date(a), >>> context.utils.text2date(b))) >>>* Module , line 2, in f >>>* Module , line 2, in >>> >>> NameError: global name 'context' is not defined >> >> Just a guess (the python gurus could answer this for sure), but lambda >> functions have access to variables in the containing scope, which in your >> case is the date.sort function. Does date.sort provide access to 'context'? >> >> A quick test would be to get rid of the lambda function and create a named >> function and see if that works. >> > i have to add that this was a "normal" page template file before, just > converted i to a trusted one. in the "normal" page template file this > expression just worked. > > i'll dig a bit deeper tomorrow if nothing comes up here. > going home now, my brain refuses to think any longer. > > regards, juergen i tried what Jonathan suggested and replaced the lambda by a named comparison function and it works. so my advice for people who might search the mailinglist in the future: do not use lambdas in python expressions in trusted fs page templates. regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] global name 'context' not defined in TrustedFSPageTemplate
On Thu, June 1, 2006 18:08, Jonathan wrote: > > - Original Message - > From: "Jürgen Herrmann" <[EMAIL PROTECTED]> > To: > Sent: Thursday, June 01, 2006 11:51 AM > Subject: [Zope] global name 'context' not defined in TrustedFSPageTemplate > > >> hi! >> >> i get the following error in one of my trusted page template files: >> >> 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 Shared.DC.Scripts.Bindings, line 311, in __call__ >>* Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec >>* Module Products.CMFCore.FSPageTemplate, line 195, in _exec >>* Module Products.TrustedExecutables.TrustedFSPageTemplate, line 31, in >> pt_render >>* Module Products.PageTemplates.PageTemplate, line 104, in pt_render >> >>* Module TAL.TALInterpreter, line 238, in __call__ >>* Module TAL.TALInterpreter, line 281, in interpret >>* Module TAL.TALInterpreter, line 507, in do_setLocal_tal >>* Module Products.PageTemplates.TALES, line 221, in evaluate >> URL: >> file:/home/bliss/zope/Products/BlissCalendar/www/BlissCalendar/show_content_week.xpt >> Line 3, Column 0 >> Expression: > cmp(context.utils.text2date(a), >> context.utils.text2date(b)))> >> Names: >> >> {'container': , >> 'context': , >> 'default': > 0xb703850c>, >> 'here': , >> 'loop': > 0xb5d9426c>, >> 'modules': >> > 0xb6fa1b8c>, >> 'nothing': None, >> 'options': {'args': ()}, >> 'repeat': > 0xb5d9426c>, >> 'request': > URL=https://bliss.local/BlissCalendar/show_content_week>, >> 'root': , >> 'template': > /bliss/BlissCalendar/show_content_week>, >> 'traverse_subpath': [], >> 'user': > /bliss/acl_users>} >> >>* Module Products.PageTemplates.PythonExpr, line 70, in __call__ >> __traceback_info__: dates.sort(lambda a,b: >> cmp(context.utils.text2date(a), >> context.utils.text2date(b))) >>* Module , line 2, in f >>* Module , line 2, in >> >> NameError: global name 'context' is not defined > > Just a guess (the python gurus could answer this for sure), but lambda > functions have access to variables in the containing scope, which in your > case is the date.sort function. Does date.sort provide access to 'context'? > > A quick test would be to get rid of the lambda function and create a named > function and see if that works. > i have to add that this was a "normal" page template file before, just converted i to a trusted one. in the "normal" page template file this expression just worked. i'll dig a bit deeper tomorrow if nothing comes up here. going home now, my brain refuses to think any longer. regards, juergen ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] global name 'context' not defined in TrustedFSPageTemplate
hi! i get the following error in one of my trusted page template files: 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 Shared.DC.Scripts.Bindings, line 311, in __call__ * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec * Module Products.CMFCore.FSPageTemplate, line 195, in _exec * Module Products.TrustedExecutables.TrustedFSPageTemplate, line 31, in pt_render * Module Products.PageTemplates.PageTemplate, line 104, in pt_render * Module TAL.TALInterpreter, line 238, in __call__ * Module TAL.TALInterpreter, line 281, in interpret * Module TAL.TALInterpreter, line 507, in do_setLocal_tal * Module Products.PageTemplates.TALES, line 221, in evaluate URL: file:/home/bliss/zope/Products/BlissCalendar/www/BlissCalendar/show_content_week.xpt Line 3, Column 0 Expression: Names: {'container': , 'context': , 'default': , 'here': , 'loop': , 'modules': , 'nothing': None, 'options': {'args': ()}, 'repeat': , 'request': https://bliss.local/BlissCalendar/show_content_week>, 'root': , 'template': , 'traverse_subpath': [], 'user': } * Module Products.PageTemplates.PythonExpr, line 70, in __call__ __traceback_info__: dates.sort(lambda a,b: cmp(context.utils.text2date(a), context.utils.text2date(b))) * Module , line 2, in f * Module , line 2, in NameError: global name 'context' is not defined the "Names" section clearly shows a 'context' entry... anybody seen this or something similar before? (btw. here doesn't work either) regards, juergen ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] unrestricted pagetemplatefile?
looks like what i've been searching for, thanks to everyone who replied! regards, juergen herrmann On Fri, March 24, 2006 07:29, Andreas Jung wrote: > Look at Dieters TrustedExecutables. > > -aj > > --On 23. März 2006 19:50:20 +0100 Jürgen Herrmann > <[EMAIL PROTECTED]> wrote: > >> hi! >> >> the question about "unrestricted pagetempltefiles" has come up once, >> i found a discussion here: >> http://mail.zope.org/pipermail/zope-dev/2004-March/thread.html#22094 >> >> is there such a thing yet? browsing the sourcecode lets me tend to a >> "no"... maybe there is a patch? >> >> how difficult would it be to implement it, any hints at which methods >> contain the "magic"? :) >> >> thanks in advance. >> >> regards, juergen >> ___ >> >>>> XLhost.de - eXperts in Linux hosting << >> >> Jürgen Herrmann >> BruderwöhrdstraÃe 15b, DE-93051 Regensburg >> >> Fon: +49 (0)700 XLHOSTDE [0700 95467833] >> Fax: +49 (0)721 151 463027 >> WEB: http://www.XLhost.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 ) > > > > --- >- Andreas JungZOPYX Ltd. & Co KG- > - E-mail: [EMAIL PROTECTED] Web: www.zopyx.com, www.zopyx.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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] unrestricted pagetemplatefile?
hi! the question about "unrestricted pagetempltefiles" has come up once, i found a discussion here: http://mail.zope.org/pipermail/zope-dev/2004-March/thread.html#22094 is there such a thing yet? browsing the sourcecode lets me tend to a "no"... maybe there is a patch? how difficult would it be to implement it, any hints at which methods contain the "magic"? :) thanks in advance. regards, juergen ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] LocalFS under Zope2.9
change the line "from OFS.content_types..." to "from zope.app.content_types" in LocalFS.py regrds, juergen herrmann On Fri, January 20, 2006 19:07, Dennis Allison wrote: > > This is the LocalFS-1.3-andreas version. Later releases do not appear to > address this issue. > > > 2006-01-20T09:22:51 ERROR Zope Couldn't install LocalFS > Traceback (most recent call last): > File "/usr/local/src/zope/Zope2.9/lib64/python/OFS/Application.py", line > 763, in install_product > global_dict, global_dict, silly) > File "/opt/zope/zproducts/standard/LocalFS/__init__.py", line 44, in ? > import os, LocalFS > File "/opt/zope/zproducts/standard/LocalFS/LocalFS.py", line 51, in ? > from OFS.content_types import find_binary > ImportError: cannot import name find_binary > > > > > > -- > > ___ > 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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] five i18n
me again :) some more things i found out: 1. MyLanguages is instantiated on every http request but regardless of what i return (['DE'] or ['de']) i always get the english translation. weird?! 2. seems that only page templates served through an http request trigger the i18n stuff at all. if so, how can i circumvent this? (i want to generate xml and run it through trml2pdf to produce pdf output, which works excellent - but not with i18n) thanks for your help. regards, juergen On Wed, January 18, 2006 15:41, Martijn Faassen wrote: > Jürgen Herrmann wrote: >> just tried this: >> >> hacked in a MyLanguages in five's i18n.py: >> >> class MyLanguages(object): >> """ fake """ >> implements(IUserPreferredLanguages) >> >> def __init__(self, context): >> self.context = context >> >> def getPreferredLanguages(self): >> return ('DE') >> >> and in my overrides.zcml added: >> > for="zope.publisher.interfaces.http.IHTTPRequest" >> provides="zope.i18n.interfaces.IUserPreferredLanguages" >> factory="Products.Five.i18n.MyLanguages" /> > > Oh, I see you already did what I did in the sample code above. > > Regards, > > Martijn > > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] five i18n (addendum)
i added a print statement in registerTranslations() and it shows me that it finds my message catalogs. On Wed, January 18, 2006 15:27, Jürgen Herrmann wrote: > just tried this: > > hacked in a MyLanguages in five's i18n.py: > > class MyLanguages(object): > """ fake """ > implements(IUserPreferredLanguages) > > def __init__(self, context): > self.context = context > > def getPreferredLanguages(self): > return ('DE') > > and in my overrides.zcml added: > for="zope.publisher.interfaces.http.IHTTPRequest" > provides="zope.i18n.interfaces.IUserPreferredLanguages" > factory="Products.Five.i18n.MyLanguages" /> > > 1. is the return value correct? i.e. is a tuple ok? >should it be ('DE') or ('de') - tried both to no avail :( > 2. does the translation also work with page template files? > > regards, juergen > > On Wed, January 18, 2006 14:28, Lennart Regebro wrote: >> On 1/18/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >>> does the zope/five/i18n machinery tell anything about it's startup >>> phase (finding message catalogs etc.) in the logs or while watching >>> runzope output? >> >> Nope. It would probably be good if the registerTranslations statement >> printed logs of what it found. >> >>> - how can i set the target language for the translation in the zpt? >> >> That's tricky! :) You need either Localizer or the plone tool for that >> now, I think. But it's mentioned in the documentation. By default it >> just picks the language from the list of languages in your browser, I >> think? >> >>> - do i have to compile the .pos to .mos by hand? >> >> Yes. >> >> -- >> 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/listinfo/zope-announce >> http://mail.zope.org/mailman/listinfo/zope-dev ) >> > > > ___ > >>> XLhost.de - eXperts in Linux hosting << > > Jürgen Herrmann > Bruderwöhrdstraße 15b, DE-93051 Regensburg > > Fon: +49 (0)700 XLHOSTDE [0700 95467833] > Fax: +49 (0)721 151 463027 > WEB: http://www.XLhost.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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] five i18n
just tried this: hacked in a MyLanguages in five's i18n.py: class MyLanguages(object): """ fake """ implements(IUserPreferredLanguages) def __init__(self, context): self.context = context def getPreferredLanguages(self): return ('DE') and in my overrides.zcml added: 1. is the return value correct? i.e. is a tuple ok? should it be ('DE') or ('de') - tried both to no avail :( 2. does the translation also work with page template files? regards, juergen On Wed, January 18, 2006 14:28, Lennart Regebro wrote: > On 1/18/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> does the zope/five/i18n machinery tell anything about it's startup >> phase (finding message catalogs etc.) in the logs or while watching >> runzope output? > > Nope. It would probably be good if the registerTranslations statement > printed logs of what it found. > >> - how can i set the target language for the translation in the zpt? > > That's tricky! :) You need either Localizer or the plone tool for that > now, I think. But it's mentioned in the documentation. By default it > just picks the language from the list of languages in your browser, I > think? > >> - do i have to compile the .pos to .mos by hand? > > Yes. > > -- > 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/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] five i18n
On Wed, January 18, 2006 14:28, Lennart Regebro wrote: > On 1/18/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> does the zope/five/i18n machinery tell anything about it's startup >> phase (finding message catalogs etc.) in the logs or while watching >> runzope output? > > Nope. It would probably be good if the registerTranslations statement > printed logs of what it found. > >> - how can i set the target language for the translation in the zpt? > > That's tricky! :) You need either Localizer or the plone tool for that > now, I think. But it's mentioned in the documentation. By default it > just picks the language from the list of languages in your browser, I > think? ok, first one. will investigate that. > >> - do i have to compile the .pos to .mos by hand? > > Yes. second one. i'll report back :) > > -- > 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/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] five i18n
does the zope/five/i18n machinery tell anything about it's startup phase (finding message catalogs etc.) in the logs or while watching runzope output? i don't see anything here, and still didn't get it to work. - what are the preconditions to get it working? i use plain zope page templates (no cmf/plone or cps)... - how can i set the target language for the translation in the zpt? - my configure.zcml: http://namespaces.zope.org/zope"; xmlns:i18n="http://namespaces.zope.org/i18n";> (must get parsed, because zope doesnt start up if i put some crap in :) - my subdir layout under the product dir for message catalogs: ./locales/ ./locales/de/LC_MESSAGES/blisspro.po ./locales/en/LC_MESSAGES/blisspro.po - do i have to compile the .pos to .mos by hand? or is it done automatically like PTS did? must be missing something... thanks in advance for your answers! regards, juergen On Tue, January 17, 2006 17:45, Lennart Regebro wrote: > On 1/17/06, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> hi all! >> >> does anybody have a five product that uses i18n that i can have a look >> at? >> i don't seem to get it right... > > Yeah, the CalZope trunk does it: > http://svn.nuxeo.org/trac/pub/browser/CalZope/trunk/ > > -- > 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/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] five i18n
hi all! does anybody have a five product that uses i18n that i can have a look at? i don't seem to get it right... thanks & regards, juergen ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] DateTime mess
[ Lennart Regebro wrote:] > On 11/29/05, Philipp von Weitershausen <[EMAIL PROTECTED]> wrote: >> We could deprecate DateTime now to warn people about that. But then >> their product would only either work with Zope <2.12 or with Zope >2.12 >> (depending on whether it still expects the DateTime API or the >> datetime.datetime API); it would not with both versions. That's a harsh >> upgrade plan and it would probably take ages before people would adopt >> Zope 2.12. > > I agree, official deprecation and warnings should only happen when we > have a real backwards compatibility and transition-path. Which would > include what you call a "frankendatetime". :-) > > Which, as I understand it, is what Jürgen Herrman wanted to create... correct that is ;) regards, juergen herrmann _______ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] standard_error_message as PageTemplate?
hi there! is it possible to replace the standard_error_message dtml method by a page template? has anybody done this? seems like i don't get error_type, error_tb etc... regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] Re: DateTime mess
[ Lennart Regebro wrote:] > On 11/22/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> i'll surely change the storage format, when rewriting it! > > So you plan on having some version marker, or so, which > tells which storage format is used? > > //Curious. basicall i thought about having a dateime instance as "storage" in the new implementation and test for it's existance on DateTime instances. something like that: dt = getattr(self, '_datetime', None) if dt is not None: #new, everything ok else: #migrate! rfc! regards, juergen herrmann _______ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] Re: DateTime mess
[ Lennart Regebro wrote:] > On 11/22/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> do we REALLY need dates <1900 / >2036 ? > > Yes. > >> using unix timestamps for >> storage and as the base for all conversions would make things a lot >> easier! > > datetimes are picklable, so if you are going to change how they are > stored (which may not be a good idea for backwards compatible > reasons), you should use that. i'll surely change the storage format, when rewriting it! storing year, month, day, hour, minute, second, a unix timestamp and tzinfo is plain odd! so using a datetime instance for storage indeed seems the most obvious thing if we need dates <1900 / >2036. regards, juergen herrmann _______ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] Re: DateTime mess
[ Florent Guillaume wrote:] > > > Jürgen Herrmann wrote: >> recently i came up here with the intention to fix DateTime#strftime(). >> while trying this, i had to dig deeper and deeper into the >> implementation >> of DateTime and especially the timezone and daylight saving stuff. >> to be honest, it's completely hacked together :( >> DateTimeZone.py has one BIG dictionary in it, not a single line of >> comments. values of this dict are nested lists, among other hackish >> things (list like usage of a string, with \000 as separator). >> the methods that use this dict also have no comments/docstrings at all. >> obviously the guy(s) that originally wrote this, is/are hiding (i know >> why :) so, there's nobody to ask either... >> >> sorry guys, i won't be able to completely fix this for now. i found >> a way to monkey patch zope to make it work for my case (2 timezones >> only). my plan is to completely reimplement DateTime, based on >> python's datetime in my own freetime (maybe around xmas this year) >> and give it back to the community. >> >> once again sry, if i raised expectations on the fix of strftime. > > Yes replacing DateTime is a laudable but difficult goal. > > One thing that could be done meanwhile is just refactor the unit test to > be a base class that could then be used to test DateTime or to test > another potential implementation. That would go a long way to help > actually write a new implementation. > > Florent > hi florent! actually that's the best thing to do! this way the implementer knows what to do exactly :) but be aware that some tests got modified to pass with current (broken) behaviour! one more question (to the public!): do we REALLY need dates <1900 / >2036 ? using unix timestamps for storage and as the base for all conversions would make things a lot easier! regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] DateTime mess
[ Lennart Regebro wrote:] > On 11/21/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> recently i came up here with the intention to fix DateTime#strftime(). >> while trying this, i had to dig deeper and deeper into the >> implementation >> of DateTime and especially the timezone and daylight saving stuff. >> to be honest, it's completely hacked together :( > > Yup. > >> sorry guys, i won't be able to completely fix this for now. i found >> a way to monkey patch zope to make it work for my case (2 timezones >> only). my plan is to completely reimplement DateTime, based on >> python's datetime in my own freetime (maybe around xmas this year) >> and give it back to the community. > > Well, that would be cool. Just a question: How do you plan to keep and > verify backwards compatibility? Any database, with any type of > DateTime object, must work transparently. 100% compatibility isn't desireable, because its broken atm ;P _______ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] DateTime mess
[ Andreas Jung wrote:] > > > --On 21. November 2005 15:14:50 +0100 Lennart Regebro <[EMAIL PROTECTED]> > wrote: >> Well, that would be cool. Just a question: How do you plan to keep and >> verify backwards compatibility? Any database, with any type of >> DateTime object, must work transparently. > > Perfect question. When we considered rewriting DateTime using mx.DateTime > in 2001 we could answer this question :-) That's why the rewrite never > happened. > > -aj well, i'm aware of that issue. because DateTimes are probably used very heavily i personally would prefer an offline update strategy, though that could be quite tough, requiring to operate at zodb level and inspecting every pickle. i'd prefer it for speed reasons, lazy update always has to check the "format" of the instance and do the conversion if necessary. probably the offline strategy is not convenient enough for john q. public, though... is there a way to hook into the unpickling process of DateTime if we choose the lazy update method? btw. you mentioned mxDateTime - is it recommendable to make it a requirement for zope or should we better stick to python's datetime? regards, juergen herrmann _______ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] DateTime mess
hi all! recently i came up here with the intention to fix DateTime#strftime(). while trying this, i had to dig deeper and deeper into the implementation of DateTime and especially the timezone and daylight saving stuff. to be honest, it's completely hacked together :( DateTimeZone.py has one BIG dictionary in it, not a single line of comments. values of this dict are nested lists, among other hackish things (list like usage of a string, with \000 as separator). the methods that use this dict also have no comments/docstrings at all. obviously the guy(s) that originally wrote this, is/are hiding (i know why :) so, there's nobody to ask either... sorry guys, i won't be able to completely fix this for now. i found a way to monkey patch zope to make it work for my case (2 timezones only). my plan is to completely reimplement DateTime, based on python's datetime in my own freetime (maybe around xmas this year) and give it back to the community. once again sry, if i raised expectations on the fix of strftime. regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] Re: DateTime strftime problem
[ Dieter Maurer wrote:] > Jürgen Herrmann wrote at 2005-11-9 13:38 +0100: >>zope 2.7.8's DateTime::strftime() looks like this: >> >>def strftime(self, format): >> # Format the date/time using the *local timezone representation*. >> return strftime(format, safelocaltime(self.timeTime())) >> >>it seems that my assumption about strftime's behaviour was incorrect. >>why do we have time zones at all, if strftime always uses the machine's >>local time zone? > > Zope's "strftime" is simply broken. > > Forget about it. It should be simple to implement your own > version in Python (and I think someone already did). > Once you did, donate the implementation to Zope > > -- > Dieter > ok, i guess i can fix strftime. will take some time to change the tests and add some comments. i'd like to report with the patch here first and get some comments, to avoid "don't do"s... already came across another python bug in strptime, that reports a format error, if %Z (timezone *omg*) is in the format string and you give it value different to UTC... this IS getting interesting :) thanks for all your help... regards, juergen ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] Re: DateTime strftime problem
zope 2.7.8's DateTime::strftime() looks like this: def strftime(self, format): # Format the date/time using the *local timezone representation*. return strftime(format, safelocaltime(self.timeTime())) it seems that my assumption about strftime's behaviour was incorrect. why do we have time zones at all, if strftime always uses the machine's local time zone? would this be better off in a new method, similar to strftime but respecting the DateTime's current time zone? (that's what i need) submitting a patch with my implementation is likely to be refused because it changes long standing behaviour... on the other hand, if DateTime's strftime should behave as similar as possible to datetime's strftime, it should respect the timezone information attached to it. honestly i don't know what to do... i can just make this a monkeypatch and only use it myself, but that just didn't feel like "the right thing to do" :) regards, juergen herrmann [ Florent Guillaume wrote:] > The DateTime implementation in Zope is notoriously undertested and > underspecified when it comes to time zones. Until recently strftime was > quite buggy too, and as you saw it has been recoded in terms of the python > datetime implementation now that it exists. It's very possible that a bug > was introduced at that point, it would be useful to check with Zope 2.7's > DateTime. Or the bug has always been there. > > It think it's a good thing if DateTime can behave more regularly, which > means be more in line with python's datetime, in corner cases. > > Please submit a patch to the collector. It probably will be included in > 2.9 > but not 2.8 which is strictly in maintenance mode, unless you convince us > that it's very unlikely that code would change behavior as a result. > > Florent > > Jürgen Herrmann wrote: >> [ Jürgen Herrmann wrote:] >> >>>i looked at the source of DateTime::strftime(), surpirse, surprise :) >>>strftime uses python's datetime class and it's strftime method! >>>but no care is taken at this time for timezone information, so i >>>decided to code a tzinfo subclass for datetime that can represent >>>fixed offset from gmt (no dst) and hand one such instance to >>>datetime.fromtimestamp(). seems like this code is working correctly now. >>>i'll run it against some tests tomorrow and report back on the results. >>> >>>regards, juergen herrmann >> >> >> if i run the DateTime testsuite against my patched version: >> == >> ERROR: Checks strftime in dates <= 1900 or >= 2038 >> -- >> Traceback (most recent call last): >> File "/usr/lib/python2.4/unittest.py", line 260, in run >> testMethod() >> File "/home/bliss/zope/lib/python/DateTime/tests/testDateTime.py", >> line >> 366, in testStrftimeFarDates >> self.assertEqual(dt.strftime('%d/%m/%Y'), '30/01/1900') >> File "/home/bliss/zope/lib/python/DateTime/DateTime.py", line 1542, in >> strftime >> ds = datetime.fromtimestamp(self._t+offsetsecs, >> tzi).strftime(format) >> ValueError: timestamp out of range for platform time_t >> >> == >> ERROR: Checks time zone in dates <= 1900 or >= 2038 >> -- >> Traceback (most recent call last): >> File "/usr/lib/python2.4/unittest.py", line 260, in run >> testMethod() >> File "/home/bliss/zope/lib/python/DateTime/tests/testDateTime.py", >> line >> 374, in testZoneInFarDates >> self.assertEqual(dt1.strftime('%d/%m/%Y %H:%M'), >> dt2.strftime('%d/%m/%Y %H:%M')) >> File "/home/bliss/zope/lib/python/DateTime/DateTime.py", line 1542, in >> strftime >> ds = datetime.fromtimestamp(self._t+offsetsecs, >> tzi).strftime(format) >> ValueError: timestamp out of range for platform time_t >> >> == >> FAIL: strftime timezone testing >> -- >> Traceback (most recent call last): >> File "/usr/lib/python2.4/unittest.py", line 260, in run >> testMethod() >> File "/home/bliss/zope/lib/python/DateTime/tests/testDateTime.py", >> line >> 361, in testStrftimeTZhandling >> self.asse
Re: [Zope] DateTime strftime problem
[ Jürgen Herrmann wrote:] > i looked at the source of DateTime::strftime(), surpirse, surprise :) > strftime uses python's datetime class and it's strftime method! > but no care is taken at this time for timezone information, so i > decided to code a tzinfo subclass for datetime that can represent > fixed offset from gmt (no dst) and hand one such instance to > datetime.fromtimestamp(). seems like this code is working correctly now. > i'll run it against some tests tomorrow and report back on the results. > > regards, juergen herrmann if i run the DateTime testsuite against my patched version: == ERROR: Checks strftime in dates <= 1900 or >= 2038 -- Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 260, in run testMethod() File "/home/bliss/zope/lib/python/DateTime/tests/testDateTime.py", line 366, in testStrftimeFarDates self.assertEqual(dt.strftime('%d/%m/%Y'), '30/01/1900') File "/home/bliss/zope/lib/python/DateTime/DateTime.py", line 1542, in strftime ds = datetime.fromtimestamp(self._t+offsetsecs, tzi).strftime(format) ValueError: timestamp out of range for platform time_t == ERROR: Checks time zone in dates <= 1900 or >= 2038 -- Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 260, in run testMethod() File "/home/bliss/zope/lib/python/DateTime/tests/testDateTime.py", line 374, in testZoneInFarDates self.assertEqual(dt1.strftime('%d/%m/%Y %H:%M'), dt2.strftime('%d/%m/%Y %H:%M')) File "/home/bliss/zope/lib/python/DateTime/DateTime.py", line 1542, in strftime ds = datetime.fromtimestamp(self._t+offsetsecs, tzi).strftime(format) ValueError: timestamp out of range for platform time_t == FAIL: strftime timezone testing -- Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 260, in run testMethod() File "/home/bliss/zope/lib/python/DateTime/tests/testDateTime.py", line 361, in testStrftimeTZhandling self.assertEqual(dt_string, dt_localstring) File "/usr/lib/python2.4/unittest.py", line 333, in failUnlessEqual raise self.failureException, \ AssertionError: '2003-11-19 17:32 -0215' != '2003-11-19 21:47 GMT+0100' -- Ran 32 tests in 13.056s th first two are obviously side effects from using a timestamp for the instantiation of my datetime object, could be fixed, not the focus for now. the third one brings me back to my initial question: what is this code snippet supposed to return? >>> d = DateTime('2005/04/03 02:01 UTC') >>> d.toZone('GMT+1').strftime('%Y/%m/%d %H:%M %Z') '2005/04/03 03:01 GMT+0100' is this correct? if so, the i would tend to say, the testcase was written to pass with wrong strftime() behaviour. (*duck*) regards, juergen herrmann ps: tomorrow has been shifted to today due to a bug in my brain's datetime implementation, so i ran the tests today :) ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] DateTime strftime problem
[ Andreas Jung wrote:] > > > --On 7. November 2005 15:36:26 +0100 Andreas Jung <[EMAIL PROTECTED]> > wrote: > >> >> >> --On 7. November 2005 15:22:56 +0100 Jürgen Herrmann >> <[EMAIL PROTECTED]> wrote: >> >>> 2. if this works as expected, why not make DateTime a wrapper around >>> python datetime objects? is DateTime optimized for storage in the >>> zodb (maybe a separate question to the zodb-dev list)? >>> what was the intention to create DateTime anyway, if there's a >>> python pendant already? >>> >> >> This idea had been discussed already for Python 2.4 or Python 2.5 > > I mean: Zope 2.4 or Zope 2.5, not Python > > -aj i looked at the source of DateTime::strftime(), surpirse, surprise :) strftime uses python's datetime class and it's strftime method! but no care is taken at this time for timezone information, so i decided to code a tzinfo subclass for datetime that can represent fixed offset from gmt (no dst) and hand one such instance to datetime.fromtimestamp(). seems like this code is working correctly now. i'll run it against some tests tomorrow and report back on the results. regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] DateTime strftime problem
[ Lennart Regebro wrote:] > On 11/7/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: > >> then i will fix it, if i can. i need that functionality, because we >> have users from different time zones that access a shared calendar. > > I don't know if this helps, but it might: > > Python had a good module called datetime. Most likely, you want to use > that instead. There are no standard timezone implementation, but Zope > 3 has one you might be able to use. 1. what do you mean by HAD? seems to be there still and looks quite useable. 2. if this works as expected, why not make DateTime a wrapper around python datetime objects? is DateTime optimized for storage in the zodb (maybe a separate question to the zodb-dev list)? what was the intention to create DateTime anyway, if there's a python pendant already? regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] DateTime strftime problem
[ Andreas Jung wrote:] > > > --On 7. November 2005 14:41:43 +0100 Jürgen Herrmann> >> zope 2.8.3, should i upgrade to 2.8.4 first? >> > > This is possibly related to bug #1780 (and other related timezone bugs). > Unfortunately the timezone handling in Zope was and is always a > mess...unlikely that it will be ever fixed, sorry. > > -aj > > me once again... d = DateTime('2005/04/03 02:01 GMT').toZone('GMT+1') s = d.strftime('%Y/%m/%d %H:%M %Z') here i would expect s == '2005/04/03 03:01 GMT+1', do i have the correct expectation here? what is d.strftime('%Y/%m/%d %H:%M') expected to return then? regards, juergen herrmann _______ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] DateTime strftime problem
[ Andreas Jung wrote:] > > > --On 7. November 2005 14:41:43 +0100 Jürgen Herrmann> >> zope 2.8.3, should i upgrade to 2.8.4 first? >> > > This is possibly related to bug #1780 (and other related timezone bugs). > Unfortunately the timezone handling in Zope was and is always a > mess...unlikely that it will be ever fixed, sorry. > > -aj > > then i will fix it, if i can. i need that functionality, because we have users from different time zones that access a shared calendar. thanks for the hint anyway, regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] DateTime strftime problem
hi all! DateTime('2005/04/03 02:01 GMT').toZone('GMT-4') prints: 2005/04/02 22:01:00 GMT-4 ...which is what i expected - DateTime('2005/04/03 02:01 GMT').toZone('GMT-4')\ .strftime('%Y/%m/%d %H:%M %Z') prints: 2005/04/03 04:01 hmm, where's the timezone information gone? to make it short, how can i get a text representation of a DateTime object in a given timezone? thanks in advance! juergen herrmann _______ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] Re: implicit vs. explicit ownership?
[ Florent Guillaume wrote:] > Jürgen Herrmann wrote: >> in AccessControl.Owned.Owned: >> >> def manage_changeOwnershipType(explicit=1, RESPONSE=None, >> REQUEST=None): >> """Change the type (implicit or explicit) of ownership. >> """ >> >> can somebody please explain what's the difference between explicit >> and implicit here, or provide a rtfm hint? > > Note that this is *executable* ownership, about which few people care > (except those that develop code-like objects). > Read http://www.zope.org/Members/jim/ZopeSecurity/ServerSideTrojan for > background. > > Here the "implicit" or "explicit" executable ownership is just the fact > that > the _owner is acquired from the parent or explicitely set on the object. thanks for your answer... hmm, i'm a bit confused now. do you say that changeOwnershipType() only has to do with "executeable ownership"? especially i have to know which methods of the IOwned interface are essential and have to be reimplemented properly on my objects. ...but the fog is clearing up a little bit now, i thought that the "owner" role would be completely dynamically assigned to a user by getRolesInContext, now i see that this is done at object creation time and more than one user can have the local role "owner" on an object. for my use cases i'd prefer to let getRolesInContext() add the "owner" role to it's return list if the (runtime and proprietary) owner check tells it to. any contraindications (besides performance, possibly)? regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] implicit vs. explicit ownership?
in AccessControl.Owned.Owned: def manage_changeOwnershipType(explicit=1, RESPONSE=None, REQUEST=None): """Change the type (implicit or explicit) of ownership. """ can somebody please explain what's the difference between explicit and implicit here, or provide a rtfm hint? regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] inheriting from SimpleUserFolder's User
[ Dieter Maurer wrote:] > Jürgen Herrmann wrote at 2005-10-19 15:34 +0200: >>i use the SimpleUserFolder product and derive a MyUser class from it's >>included User class, which in turn inherits from BasicUser. >> >>the SimpleUserFolder's User class does neither reimplement >>getRolesInContext() nor allowed(). i looked at the source of >>BasicUser (lib/python/AccessControl/User.py) and found out that >>allowed() does not use the information provided by getRolesInContext(). >>i found this comment: >># Still have not found a match, so check local roles. We do >># this manually rather than call getRolesInContext so that >># we can incur only the overhead required to find a match. >> >>so if i reimplement getRolesInContext() in MyUser, i'll probably also >>have to reimplement allowed() to reflect the possibly added local roles, >>right? > > Yes. > >> ... >>ps: looking at the code of allowed() i doubt that the "manual" checking >>of local roles will speed this method up a lot: local roles seem to be >>a seldomly used feature, the improvement in speed would only occur if >>the object in question was protected by a local role > > Be careful about terminology! Objects are not protected by roles > (but by permissions). k, i'll take care in the future :) > > You gain something if a near local role grants the necessary > permission. > The "Owner" local role tends to be very near. > > Thus, you may gain, when usually owners try to execute protected > methods. sounds reasonable. > >>(and not a normal >>one). is this enough to justify duplicated code with all of it's >>disadvantages)? > > Nobody prevents you to implement your "allowed" by means > of "getRolesInContext". > > -- > Dieter > ok, it just felt a little wrong to reimplement allowed... but if thats the way, fine by me! to dig a little deeper into zope's security machinery, does anybody know where to look at (in the source) f.ex. to find the place where the owner role is assigned to a user? best regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] inheriting from SimpleUserFolder's User
hello! i use the SimpleUserFolder product and derive a MyUser class from it's included User class, which in turn inherits from BasicUser. the SimpleUserFolder's User class does neither reimplement getRolesInContext() nor allowed(). i looked at the source of BasicUser (lib/python/AccessControl/User.py) and found out that allowed() does not use the information provided by getRolesInContext(). i found this comment: # Still have not found a match, so check local roles. We do # this manually rather than call getRolesInContext so that # we can incur only the overhead required to find a match. so if i reimplement getRolesInContext() in MyUser, i'll probably also have to reimplement allowed() to reflect the possibly added local roles, right? regards, jürgen herrmann ps: looking at the code of allowed() i doubt that the "manual" checking of local roles will speed this method up a lot: local roles seem to be a seldomly used feature, the improvement in speed would only occur if the object in question was protected by a local role (and not a normal one). is this enough to justify duplicated code with all of it's disadvantages)? ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] REQUEST not accessible
[ Jens Vagelpohl wrote:] > > On 13 Oct 2005, at 11:56, Jürgen Herrmann wrote: >>> Apart from whether this worked previosuly or not, it is bad coding >>> practice to rely on assumptions such as "it will somehow acquire the >>> REQUEST". You should really change your code to explicity pass in >>> REQUEST everywhere. Then you can stop worrying. >>> >>> >> thanks for the answer, the coding style is one thing, and i don't have >> the least bit of a problem to stick with this in the future (already >> changed all the occurrences anyway to make it work again). >> >> what i'm worried about is wether i did break anything else, possibly >> with even worse results... (i don't like hidden bugs) > > By explicitly passing REQUEST? I doubt it. No i meant that i already broke something that did work before: obviously some code changes of mine lead to the results described before, i assume it has to do with my code as i didn't install any products or upgrade zope in the last 3 weeks, and the previous release (2 weeks ago) the catalog search was working fine... that, i suspected, might break things in other places too... > > >> btw. is it also bad practice to use self.REQUEST in methods? >> what about def foo(self, REQUEST=None), when and how is REQUEST >> passed there? is it also not a good coding style, if not passing it >> directly? > > The common case is to pass it in explicitly. To pass it in and avoid > any surprises see the solution discussed above. Explicit is better > than implicit. > > jens juergen ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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] REQUEST not accessible
[ Jens Vagelpohl wrote:] > > On 13 Oct 2005, at 11:39, Jürgen Herrmann wrote: >> up to some time in them i could just write: >> tal:define="results python:here.Catalog.searchResults()" >> >> it seems this isn't working anymore, the catalog would return >> all brains instead of seraching the relevant ones... (completely >> ignoreing everything in REQUEST) >> >> instead i have to write now: >> tal:define="results python:here.Catalog.searchResults >> (REQUEST=request)" >> >> i suspect that the catalog was able to acquire REQUEST via >> self.REQUEST >> and this isn't working anymore. has anyone had a similar problem? i >> don't know what i have changed leading to these kinds of problems... > > Apart from whether this worked previosuly or not, it is bad coding > practice to rely on assumptions such as "it will somehow acquire the > REQUEST". You should really change your code to explicity pass in > REQUEST everywhere. Then you can stop worrying. > > jens > thanks for the answer, the coding style is one thing, and i don't have the least bit of a problem to stick with this in the future (already changed all the occurrences anyway to make it work again). what i'm worried about is wether i did break anything else, possibly with even worse results... (i don't like hidden bugs) btw. is it also bad practice to use self.REQUEST in methods? what about def foo(self, REQUEST=None), when and how is REQUEST passed there? is it also not a good coding style, if not passing it directly? regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] REQUEST not accessible
hi all! i have several products using PageTemplateFiles a lot. up to some time in them i could just write: tal:define="results python:here.Catalog.searchResults()" it seems this isn't working anymore, the catalog would return all brains instead of seraching the relevant ones... (completely ignoreing everything in REQUEST) instead i have to write now: tal:define="results python:here.Catalog.searchResults(REQUEST=request)" i suspect that the catalog was able to acquire REQUEST via self.REQUEST and this isn't working anymore. has anyone had a similar problem? i don't know what i have changed leading to these kinds of problems... best regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] Re: FW: [ZODB-Dev] python types question
oh my goodness, today is not my day. this should go to the zodb-dev list, plz ignore! [ Jürgen Herrmann wrote:] > thanks tim! my mistake... > > regards, juergen herrmann > > [ Tim Peters wrote:] >> [fwd'ing private msg, since it appears to have been intended to >> go to the list] >> >> -Original Message- >> From: Jürgen Herrmann [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, August 23, 2005 7:31 AM >> To: Tim Peters >> Subject: RE: [ZODB-Dev] python types question >> >> hi! >> >> first of all, thanks to everybody who replied to my message. >> i experimented a bit with OOBTree and OOTreeSet. OOBTree is surely >> fine for the mapping part of what i need. >> But i think OOTreeSet doesn't fit as a replacement for PersistentList >> because i need the oids in the list to maintain their order. i want >> to be able to change the order of oids in the lists, too. >> >> any further hints what to use instead of OOTreeSet then? >> >> regards, juergen herrmann >> >> >> ___ >> >>>> XLhost.de - eXperts in Linux hosting << >> >> Jürgen Herrmann >> Bruderwöhrdstraße 15b, DE-93051 Regensburg >> >> Fon: +49 (0)700 XLHOSTDE [0700 95467833] >> Fax: +49 (0)721 151 463027 >> WEB: http://www.XLhost.de >> >> ___ >> For more information about ZODB, see the ZODB Wiki: >> http://www.zope.org/Wikis/ZODB/ >> >> ZODB-Dev mailing list - ZODB-Dev@zope.org >> http://mail.zope.org/mailman/listinfo/zodb-dev >> > > > ___ > >>> XLhost.de - eXperts in Linux hosting << > > Jürgen Herrmann > Bruderwöhrdstraße 15b, DE-93051 Regensburg > > Fon: +49 (0)700 XLHOSTDE [0700 95467833] > Fax: +49 (0)721 151 463027 > WEB: http://www.XLhost.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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] Re: FW: [ZODB-Dev] python types question
thanks tim! my mistake... regards, juergen herrmann [ Tim Peters wrote:] > [fwd'ing private msg, since it appears to have been intended to > go to the list] > > -Original Message----- > From: Jürgen Herrmann [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 23, 2005 7:31 AM > To: Tim Peters > Subject: RE: [ZODB-Dev] python types question > > hi! > > first of all, thanks to everybody who replied to my message. > i experimented a bit with OOBTree and OOTreeSet. OOBTree is surely > fine for the mapping part of what i need. > But i think OOTreeSet doesn't fit as a replacement for PersistentList > because i need the oids in the list to maintain their order. i want > to be able to change the order of oids in the lists, too. > > any further hints what to use instead of OOTreeSet then? > > regards, juergen herrmann > > > ___ > >>> XLhost.de - eXperts in Linux hosting << > > Jürgen Herrmann > Bruderwöhrdstraße 15b, DE-93051 Regensburg > > Fon: +49 (0)700 XLHOSTDE [0700 95467833] > Fax: +49 (0)721 151 463027 > WEB: http://www.XLhost.de > > ___ > For more information about ZODB, see the ZODB Wiki: > http://www.zope.org/Wikis/ZODB/ > > ZODB-Dev mailing list - ZODB-Dev@zope.org > http://mail.zope.org/mailman/listinfo/zodb-dev > ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] and ZPublisher?
hi all! i read something about using image submit buttons with zope here: http://www.dieter.handshake.de/pyprojects/zope/#bct_sec_6.13 there's a patch for zope 2.5's zpublisher, quite old :/ so i patched ZPublisher.py by hand, anybody interested in the patch against zope 2.8.0? (i'll upgrade to 2.8.1 anytime soon, but i guess that changes to ZPublisher between 2.8.0 and 2.8.1 should be nonexistant) regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.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 )
[Zope] zodb/transaction questions
hi all! this is not my first posting regarding my "before_transaction_commit" stuff, to summarize my plans: make the transaction object call a method "_before_transaction_commit()" on each changed object before the commit process starts. in zodb 3.2 style transactions it seemed to be easy, changed objects were stored in a list attribute of the transaction, attribute name was 'objects'. now in zope 2.8 we have zodb 3.4 and everything is different, there are managers/synchs to be registered, short question: how do i get at the modified objects cleanly? hope someone is fit in zodb hacking here :) regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] bug?
i was dumb :) the metadata table simply didn't have getId, so the brains object acquires getId from the catalog. sorry for my nubness ;P regards, juergen herrmann [ Peter Bengtsson wrote:] > Easy. The brain object doesn't have a 'getId()' method. The Catalog has. > What you're probably after is something like this:: > > for brain in context.Catalog.searchResults({'bool':1}): > cataloged_object = brain.getObject() > if cataloged_object is None: > print "ZCatalog out of sync!!" > else: > print cataloged_object.getId() > > On 7/6/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: >> hi there! >> >> either this is a bug or i'm too stoned to see, what's going on... >> >> i have a folder /1, 2 subfolders /1/11 and /1/22. each subfolder >> has a property 'bool', which is a boolean. >> there's a zcatalog instance in /1/Catalog with one index bool, indexed >> attribute 'bool'. i cataloged the two subfolders of /1 there. >> >> i have i skript /1/test with the following content: >> results = context.Catalog.searchResults({'bool':1}) >> print results >> for o in results: >> print o >> print o.getId >> print o.getId() >> return printed >> >> it prints: >> [, >> ] >> >> > >> Catalog >> >> > >> Catalog >> >> why in the world is o.getId a bound method of /1/Catalog? >> o is a mybrains instance!!! >> >> what am i missing?! help! >> >> regards, juergen herrmann >> ___ >> >> >> XLhost.de - eXperts in Linux hosting << >> >> Juergen Herrmann >> Weiherweg 10, 93051 Regensburg, Germany >> Fon: +49 (0)700 XLHOSTDE [0700 95467833] >> Fax: +49 (0)721 151 463027 >> >> ICQ: 27139974 - IRC: [EMAIL PROTECTED] >> WEB: http://www.XLhost.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 ) >> > > > -- > Peter Bengtsson, > work www.fry-it.com > home www.peterbe.com > hobby www.issuetrackerproduct.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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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 )
[Zope] bug?
hi there! either this is a bug or i'm too stoned to see, what's going on... i have a folder /1, 2 subfolders /1/11 and /1/22. each subfolder has a property 'bool', which is a boolean. there's a zcatalog instance in /1/Catalog with one index bool, indexed attribute 'bool'. i cataloged the two subfolders of /1 there. i have i skript /1/test with the following content: results = context.Catalog.searchResults({'bool':1}) print results for o in results: print o print o.getId print o.getId() return printed it prints: [, ] > Catalog > Catalog why in the world is o.getId a bound method of /1/Catalog? o is a mybrains instance!!! what am i missing?! help! regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] Pass objects from template to template via HTML forms.
[ Negroup - wrote:] > 2005/7/5, Konstantin E. Steuck <[EMAIL PROTECTED]>: >> Negroup - wrote: > [cut] >> Try looking into copy/cut/paste machinery, it seems to be what you're looking for >> > > This is a thing I absolutely want to avoid. I simply need to pass an object directly from one template to another, without intermediate steps (like, copying or creating the object with some manage_*method from a template, read the created object from the other template and then remove the object itself because unuseful..). > > In python it is so immediate: I pass objects between functions via parameters; in zope the most natural way to "simulate" parameters passing from one zpt and another is storing them inside the request object, and thus, using html forms. But for some reasons that I'm missing, it doesn't work! passing objects from one template to another via the REQUEST variable only works while you're in ONE request. otherwise you'll get a string representation as you mentioned. try using the session mechanism instead: http://www.plope.com/Books/2_7Edition/Sessions.stx regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.de ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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 )
[Zope] python question
hi all! i think there should be no functional difference in the two code snippets below, but is there any difference in performance? (i know, the "except AttributeError" could possibly mask an AttributeError in the called function...) 1.: hook = getattr(o, '_before_transaction_commit', None) if hook: hook() 2.: try: o._before_transaction_commit() except AttributeError: pass regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] automagic reindexing of objects
[ Jürgen Herrmann wrote:] ... > hook = object.get('_before_transaction_commit', None) > if hook: hook() ... of course it should be: getattr(object, '_before_transaction_commit', None) regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] automagic reindexing of objects
hi all! as i had time to look at all the stuff, i realized, that i'm getting closer, but this is not exactly what i wanted... as i can see from the path, one has to call: beforeCommitHook(method, **args, **kwargs) on each transaction, correct? this is contrary to my idea of everything doing it's work "automagically". what i want is a kind of callback to each dirty object, something like this: class Transaction(...): def commit(self, ...): # insert this: for object in self._objects: try: object._before_transaction_commit() except AttributeError: pass # rest of original commit() follows... could this impose any unforseen behaviour? btw: what version of the two following is better (i.e. faster and more elegeant, i do python coding since abt. 6months only...) try: object._before_transaction_commit() except AttributeError: pass or hook = object.get('_before_transaction_commit', None) if hook: hook() another question: is it hook() or hook(object) in the previous line? i never know if the self parameter has to be passed in if not called as self.method() - are there any (simple) rules? regards, juergen herrmann [ Florent Guillaume wrote:] > Dieter Maurer <[EMAIL PROTECTED]> wrote: >> Jürgen Herrmann wrote at 2005-6-17 14:19 +0200: >> >i make heavy use of indexes in my extension classes. these all inherit >> >from catalogpathaware, so i have to call object.reindex_object() on >> >each changed instance. calling it from attribute getters/setters f.ex. >> >is not a good idea, because changing 3 attributes will reindex the >> object >> >3 times. >> > >> >what i'd like to have is that such objects are reindexed automatically >> >before comitting a transaction. >> > >> >is it possible? where should i start looking in the source, is there >> >possibly a before_transaction_commit hook? >> >> It is impossible with "ZODB 3.2" (unless you patch >> "ZODB.Transaction.Transaction"). > > The CPSCompat module of CPS has monkey-patches that backport this from > ZODB 3.4, among others, to be used in Zope 2.7. > > http://svn.nuxeo.org/trac/pub/file/CPSCompat/trunk/PatchZODBTransaction.py > > Florent > >> "ZODB 3.4" (which is used for Zope 2.8/3.1) has hooks >> that makes it possible. > > > -- > Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D > +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] > ___ > 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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] automagic reindexing of objects
[ Dieter Maurer wrote:] > Jürgen Herrmann wrote at 2005-6-17 14:19 +0200: >>i make heavy use of indexes in my extension classes. these all inherit >>from catalogpathaware, so i have to call object.reindex_object() on >>each changed instance. calling it from attribute getters/setters f.ex. >>is not a good idea, because changing 3 attributes will reindex the object >>3 times. >> >>what i'd like to have is that such objects are reindexed automatically >>before comitting a transaction. >> >>is it possible? where should i start looking in the source, is there >>possibly a before_transaction_commit hook? > > It is impossible with "ZODB 3.2" (unless you patch > "ZODB.Transaction.Transaction"). > > "ZODB 3.4" (which is used for Zope 2.8/3.1) has hooks > that makes it possible. > > -- > Dieter that's what i wanted to hear, thanks! i'll have a look at zope 2.8 immediately :) regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] automagic reindexing of objects
[ Peter Bengtsson wrote:] > Personally I think one should stay the hell away from transactions. > They're not for you to fiddle with. > I understand your question and even though I think it's a bit crazy I > can see a benefit (simplicity for the programmer). > > How about a trickery solution like this: > > class CatalogPathAware: > def index_object(self, *a, **k): > print self.__class__.__name__, "in for indexing!" > > class _MyProduct(CatalogPathAware): > def __init__(self, id, title=''): > self.id = id > self.title = title > def setTitle(self, title): > # could be much more complicated > self.title = title > > class MyProduct(_MyProduct): > def setTitle(self, title): > _MyProduct.setTitle(self, title) > self.index_object() > > inst = MyProduct("instanceA") > inst.setTitle('Peter') > > print inst.title > > > You would basically rename your existing class from "Whatever" to > "_Whatever" and continue as before. This does mean however that you > have to explicitly write a function for each setter. > hmm, i can't see how this would help. if i call index_object in every attribute getter method, the indexing is done possibly several times, unnecessary and (cpu)time consuming. juergen ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] automagic reindexing of objects
[ Jonathan wrote:] > > - Original Message - > From: "Jürgen Herrmann" <[EMAIL PROTECTED]> >> i make heavy use of indexes in my extension classes. these all inherit >> from catalogpathaware, so i have to call object.reindex_object() on >> each changed instance. calling it from attribute getters/setters f.ex. >> is not a good idea, because changing 3 attributes will reindex the >> object >> 3 times. >> >> what i'd like to have is that such objects are reindexed automatically >> before comitting a transaction. > > You can't index before committing. I think you need a different strategy: > how about creating all of the new objects and then call the > catalog/indexing > mechanism. We do this for one of our large volume catalogs (1m+ records), > by having an object class/catalog that are not 'aware' and then manually > (well, thru a python routine) cataloging/indexing the objects. hmm, it's not about newly created objects. i want to have automatic REindexing, in cleartext - i want to make it easy for the programmer: he/she should just call an attribute setter or maybe change a relation and just before the transaction would be committed to the storage, i'd like to cycle through all dirty objects and reindex them, if they're catalogpathaware (or implement reindex_object()...). > > HTH > > Jonathan juergen ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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 )
[Zope] automagic reindexing of objects
hi all! i make heavy use of indexes in my extension classes. these all inherit from catalogpathaware, so i have to call object.reindex_object() on each changed instance. calling it from attribute getters/setters f.ex. is not a good idea, because changing 3 attributes will reindex the object 3 times. what i'd like to have is that such objects are reindexed automatically before comitting a transaction. is it possible? where should i start looking in the source, is there possibly a before_transaction_commit hook? regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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 )
[Zope] utf-8 vs. unicode question(s)
hi out there! there's been some discussion about utf-8 vs. unicode strings on the list lately. i'd like to ask if my gained understandings are correct und thus possibly make it clear to others also. i have set my python default encoding to utf-8, i always send http responses from zope as utf-8 (by setting the header like this: tal:define="dummy python:request.RESPONSE.\ setHeader('Content-Type','text/html;; charset=utf-8')" ) so if i'd like to use unicode strings in my zope applications, it's still necessary to convert request variables to unicode by using unicode(REQUEST.foo, 'utf-8'), right? as far as i understodd, the conversion back to utf-8 is handled automagically by zope (if the abovementioned header is set), also correct? thanks in advance for your answers! regards, juergen herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] Forcing all Zope access to come through an Apache/SSL proxy
hi! i use mod_proxy for this, here's the config snippet: ServerName foo.com ServerAdmin [EMAIL PROTECTED] ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPass /misc_ http://localhost:8080/misc_ ProxyPass /p_ http://localhost:8080/p_ ProxyVia on SSLEngine on SSLCertificateFile /path/to/my/server.crt SSLCertificateKeyFile /path/to/my/server.key i have to admit that i never tried mod_rewrite on this issue before, so i can't tell you what's wrong with your config, i just can give you an working solution :) regards, juergen herrmann [ Reuven M. Lerner wrote:] > I've written a Zope application that needs to be behind SSL. I assumed > that the most straightforward way to do this would be to (1) set up Zope > on port 8080 and (2) use Apache to act as a proxy between the outside > world and Zope. Unfortunately, while it was a piece of cake to set up a > proxy for non-SSL access to Zope, I'm rather stumped regarding SSL. > I've done non-SSL proxying for years with mod_rewrite, and it was really > a snap, so I'm surprised that this is so difficult. > > Zope is working just fine when I access it directly (using HTTP) on port > 8080. I have installed the (self-signed) SSL certificate into Apache > without any trouble, and am able to access individual documents on disk > via SSL, using Apache. So if all I would want is to use Apache with > SSL, I would be done by now. > > Here is the relevant portion of the Apache configuration file (with > names and numbers changed somewhat): > > > ServerName myserver.com > ServerAdmin [EMAIL PROTECTED] > > SSLProxyEngine on > RewriteEngine On > > RewriteRule ^/(.*) > http://localhost:8080/VirtualHostBase/https/myserver.com:443/app/$1 > [L,P] > > > > The above should make it possible (I believe), an HTTPS connection > between my browser and my cup. Apache should then take that incoming > SSL request and issue its own request to the Zope server. Zope will > respond, sending it back to Apache, which (in turn) sends it back to me. > > But of course, that doesn't happen. Zope's provides indicates that > many of the requests begin with "\x80g\x01\x03". My guess is that the > SSL request is being piped to Zope directly, but it's hard to know from > just a few characters. Does this mean that I need to do some more > translating, from HTTP into HTTPS? > > Not that it should make any difference, but I'm running Apache 2.0.52 on > Red Hat Enterprise 4.0, with Zope 2.7.5 and Python 2.3.4. > > Thanks in advance for any advice you might have, > > Reuven > > ___ > 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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] [python script] problem with AUTHENTICATED_USER
hi: AUTHENTICATED_USER is in REQUEST: hence you could write ... self.REQUEST.AUTHENTICATED_USER.has_role(self, ["Manager"]) ... regards, juergen herrmann [ [EMAIL PROTECTED] wrote:] > I have problem with my python script. > I want to check if a user has a the "manager" role, and add an option in a > menu in this case > Here is my script: > > for el in rep.objectValues('Folder'): > if el.id=="Administration" and > AUTHENTICATED_USER.has_role(self, ["Manager"]): > #add option to the menu > > > > but Zope displays me an error: > Error Type: NameError > Error Value: global name 'AUTHENTICATED_USER' is not defined > > I don't know what is the problem. > I use sessionUserFolder (a Zope products), so I think it could be the > reason of the problem. > Thank you for your help > > ___ > 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 ) > ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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] [python script] problem with AUTHENTICATED_USER
[ [EMAIL PROTECTED] wrote:] > I have another problem (not in relation with AUTHENTICATED_USER): > I would like to know if a special function exists to transform special > char in html (like HTMLentities in PHP or escape in javascript) > ___ > 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 ) > use this: from Products.PythonScripts.standard import html_quote html_quote('< & >') ... regards, Juergen Herrmann ___ >> XLhost.de - eXperts in Linux hosting << Juergen Herrmann Weiherweg 10, 93051 Regensburg, Germany Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 ICQ: 27139974 - IRC: [EMAIL PROTECTED] WEB: http://www.XLhost.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 )
[Zope] symbols undefined after product refresh?
hi! after reloading my own products through the zmi it seems like some classes and methods gets undefined. please see the following traceback: ... Module Python expression "here.zuml_parseAndCheckinModel(newConfigDict)", line 1, in Module Products.IDE.IDEContainer, line 176, in zuml_parseAndCheckinModel Module Products.Relateable.MetaManager, line 474, in recreateIndexes Module None, line 104, in addSubClassCatalogMethod TypeError: 'NoneType' object is not callable the code @ line 104 is: o = SubClassCatalog(id, searchKeys, subClassNames) SubClassCatalog is defined in /Products/SubClassCatalog/SubClassCatalog.py, after I refresh the Product "SubCLassCatalog", i get the error mentioned above. restarting Zope fixes the Problem, MetaManager::recreatedIndexes() will work repeatedly until i refresh one or more Products... did i miss something while importing stuff? /Products/relateable/MetaManager.py imports the constructor for a SubClassCatalog like this: from Products.SubClassCatalog.SubClassCatalog import addSubClassCatalogMethod i'm pretty puzzled at this point, hope someone got a hint... regards, juergen herrmann ps: this does not only happen to my SubClassCatalog, this also hits f.ex. "from random import randint" where randint gets undefined. ___ 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 )