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 li...@localguru.de 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 )
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 sdup...@gmail.com wrote: On Wed, Feb 29, 2012 at 7:12 AM, Jürgen Herrmann juergen.herrm...@xlhost.de 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-dev] beta.zope.org (www.zope.org relaunch project)
On Tue, 10 May 2011 11:36:39 +0200, Lennart Regebro wrote: Oh! Nice! IMO you can switch now. It's already a vast improvement, constructive feedback and changes might improve it more, but it doesn't need to be perfect before it's launched, just better. And it is. +1 cheers, jürgen On Tue, May 10, 2011 at 06:55, Andreas Jung li...@zopyx.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, I am happy to announce that we have made progress with the zope.org relaunch project. The first public version of the new site is now available under http://beta.zope.org The basic idea behind the project is: - a minimalistic www.zope.org site giving a short overview about what Zope is - including all related app servers, CMSes, frameworks etc. which links to the related project sites (micro-site approach) - no more member contents on www.zope.org - the current www.zope.org will be stripped down to the current member contents and stuff that has to be preserved. www.zope.org will be renamed to old.zope.org later Constructive criticism and feedback is welcome _now_. I hope that we can fix the outstanding issues and integrate further feedback over the next few week in order to roll out the new site in the first half of June (2011 of course). Many thanks to my team (doing the real work): - - Michael Haubenwaller - - Kai Mertens - - Johannes Raggam Andreas Jung Zope Foundation -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQGUBAEBAgAGBQJNyMVOAAoJEADcfz7u4AZjTgoLvigFQqPKlnn9J97+wrQRJkdr 8ErOiV6LCmpQeNLGDVodq0Y4JGnfQELu0ByzRz+xdig3NDAY9WyKTcxjJqu7DJ4H NnZ49dK47uvZaYbfq0kKjzIw9/FX092t5+lyVdiYst1d3JGEphz1iDsl+rySu4m1 xf3Zq5/+HH0xl2NPQ391dqPuoka+93ydygBfqR7TbBxr4t1GcbFs6vMhN5/13I7c g/Q6CWCKlBOfdSnof+p1M/EHtLelst7LPHXluB5tLSQcbpbhd3vtV2x19+InNBWs 3vbaWz9EFPQVdgrAc8f3Npw6+t1tn2JMBlLEJtwLmaErqjgDA4MMEmOmJPqNDqYo 7fyVWy0+OFeJdrGtO6MOZvmkgTxp+DBYjCOqzhzBijoHGaBQz1RsfH8IrWqhI+Av PRihsjM6ZBEhVcHyW/FIQfSvsYJCsim+xxcfkmUhUjXSD6j2h4BBjNnnyI2JRHkq iu0A27ANzqZrHx8rRipFcU9gJqLtBfA= =8/ed -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope ) -- 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-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] long running methods
On Thu, 20 May 2010 18:00:43 -0600, Shane Hathaway sh...@hathawaymix.org 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 )
[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] long running methods
On Thu, 20 May 2010 15:59:58 +0200, Patrick Gerken do3cc...@googlemail.com wrote: On Thu, May 20, 2010 at 14:18, Jürgen Herrmann juergen.herrm...@xlhost.dewrote: 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-dev] zope2/zodb cache size question
hi there! today i did some sanity check calcs on a set of approx 15 objects in one of our zodb. for these calculations i had to iterate over all of these objects. during this loop memory footprint of the zope process grew to ~5gb and the cache summary showed for the zodb connection which was used: Connection at 24c10410263104 462834 -- 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-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] zope2/zodb cache size question
hi there! today i ran a check script which iterates over approx 15 objects and does some sanity check calculations on these. during this loop i saw the zope process use up to about 4.5gb memory. the database has ~3.5million objects in it. i set the zodb cache size for the mount point in question to 1 objects. obviously this limit is not honoured during one transaction: connection active objects total objects ... Connection at 24c10410 263104 462834 ... so two questions here: - would the byte-limited zodb cache setting help here? - if no - how can i iterate over a big set of objects without forcing them to stay in the cache for the whole transaction? after all i just need each object once during the iteration. 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-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope2/zodb cache size question
On Thu, 22 Apr 2010 14:56:31 +0200, Jürgen Herrmann juergen.herrm...@xlhost.de wrote: hi there! today i did some sanity check calcs on a set of approx 15 objects in one of our zodb. for these calculations i had to iterate over all of these objects. during this loop memory footprint of the zope process grew to ~5gb and the cache summary showed for the zodb connection which was used: Connection at 24c10410263104 462834 please ignore this msg, i hit the send button and the mail was not finished yet. ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope2/zodb cache size question
On Thu, 22 Apr 2010 12:54:55 -0400, Jim Fulton j...@zope.com wrote: On Thu, Apr 22, 2010 at 9:00 AM, Jürgen Herrmann juergen.herrm...@xlhost.de wrote: hi there! today i ran a check script which iterates over approx 15 objects and does some sanity check calculations on these. during this loop i saw the zope process use up to about 4.5gb memory. the database has ~3.5million objects in it. i set the zodb cache size for the mount point in question to 1 objects. obviously this limit is not honoured during one transaction: Right. so two questions here: - would the byte-limited zodb cache setting help here? No. The limits aren't really limits. They are more like suggestions. :) In particular, they are only enforced at transaction (or subtransaction) boundaries, when a connection is opened or closed, or when applications call certain APIs explicitly. are these apis exposed somewhere? calling these periodically sounds cleaner than the aproach below. - if no - how can i iterate over a big set of objects without forcing them to stay in the cache for the whole transaction? after all i just need each object once during the iteration. As you're iterating through the objects, if you know you aren't going to need an object again or otherwise think it would be OK to free it from memory, you can call _p_deactivate on it. If the object hasn't been modified, then it's state will be released and it will become a ghost. as my objects contain references to OOBTrees, do i also have to call _p_deactivate() on these explicitly, or is it enough to call it on the containing object? thanks for your help! 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)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[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] 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-dev] zopectl and runzope not working on freshly easy_install'd zope 2.12.0c1
good morning everbody! while trying to update my zope 2.12 test installation to 2.12.0c1 via easy_install i ran into problems with zopectl and runzope today. to make sure i didn't screw anything by myself i did a fresh install to a new virtualenv. outcome is reported here: https://bugs.launchpad.net/zope2/+bug/434549 just posting this as not everybody seems to be monitoring bugs on launchbad yet. is this a bad idea to post bugs here also? cheers, 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-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zopectl and runzope not working on freshly easy_install'd zope 2.12.0c1
On Tue, September 22, 2009 11:54, Andreas Jung wrote: On 22.09.09 11:39, Jürgen Herrmann wrote: good morning everbody! while trying to update my zope 2.12 test installation to 2.12.0c1 via easy_install i ran into problems with zopectl and runzope today. to make sure i didn't screw anything by myself i did a fresh install to a new virtualenv. outcome is reported here: You haven't read the docs carefully: http://docs.zope.org/zope2/releases/2.12/INSTALL.html i read it again, this time following the section Installing Zope using easy_install word by word (except inserting the correct zope2 version number into the easy_install command). here's the outcome: [...@t5-laptop ~]$ virtualenv --no-site-packages my_zope New python executable in my_zope/bin/python2.6 Also creating executable in my_zope/bin/python Installing setuptoolsdone. [...@t5-laptop ~]$ cd my_zope [...@t5-laptop my_zope]$ source bin/activate (my_zope)[...@t5-laptop my_zope]$ bin/easy_install -i http://download.zope.org/Zope2/index/2.12.0c1 Zope2 ... (my_zope)[...@t5-laptop my_zope]$ bin/mkzopeinstance Please choose a directory in which you'd like to install Zope instance home files such as database files, configuration files, etc. Directory: /home/jh/my_zope Please choose a username and password for the initial user. These will be the credentials you use to initially manage your new Zope instance. Username: admin Password: Verify password: (my_zope)[...@t5-laptop my_zope]$ bin/zopectl fg Traceback (most recent call last): File bin/zopectl, line 8, in module load_entry_point('Zope2==2.12.0c1', 'console_scripts', 'zopectl')() File /home/jh/my_zope/lib/python2.6/site-packages/Zope2-2.12.0c1-py2.6-linux-i686.egg/Zope2/Startup/zopectl.py, line 347, in run exitstatus = main() File /home/jh/my_zope/lib/python2.6/site-packages/Zope2-2.12.0c1-py2.6-linux-i686.egg/Zope2/Startup/zopectl.py, line 303, in main options.realize(args) File /home/jh/my_zope/lib/python2.6/site-packages/Zope2-2.12.0c1-py2.6-linux-i686.egg/Zope2/Startup/zopectl.py, line 122, in realize self.directory = config.instancehome AttributeError: 'NoneType' object has no attribute 'instancehome' what did i miss??? andreas, you could have been a bit more telling in your answer :) 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)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zopectl and runzope not working on freshly easy_install'd zope 2.12.0c1
On Tue, September 22, 2009 12:23, Andreas Jung wrote: On 22.09.09 12:15, Jürgen Herrmann wrote: ... (my_zope)[...@t5-laptop my_zope]$ bin/mkzopeinstance Please choose a directory in which you'd like to install Zope instance home files such as database files, configuration files, etc. Try to create your instance outside the buildout dir. Andreas some further testing shows, that it's still possible to have the instance home in /somedir/instance and the virtualenv in /somedir/instance/virtualenv still is this info missing on http://docs.zope.org/zope2/releases/2.12/INSTALL.html or am i blind? 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)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zopectl and runzope not working on freshly easy_install'd zope 2.12.0c1
On Tue, September 22, 2009 13:31, Andreas Jung wrote: On 22.09.09 13:29, Jürgen Herrmann wrote: On Tue, September 22, 2009 12:23, Andreas Jung wrote: On 22.09.09 12:15, Jürgen Herrmann wrote: ... (my_zope)[...@t5-laptop my_zope]$ bin/mkzopeinstance Please choose a directory in which you'd like to install Zope instance home files such as database files, configuration files, etc. Try to create your instance outside the buildout dir. Andreas some further testing shows, that it's still possible to have the instance home in /somedir/instance and the virtualenv in /somedir/instance/virtualenv s Better give feedback if it worked or not :-) Andreas well, now it works. as descripted above, my instance home is now /home/xlhost/zope and the virtualenv is in /home/xlhost/zope/virtualenv i found another problem though: Zope2-2.12.0c1-py2.6-linux-i686.egg/Products/PluginIndexes/nterfaces.py is now missing the interfaces ITextIndex and IVocabulary which leads to import errors in Products.GenericSetup why have these been dropped? they were there in 2.12.0b1 and after copying them over everything comes up fine. 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)800 XLHOSTDE [0800 95467833] Fax: +49 (0)800 95467830 WEB: http://www.XLhost.de IRC: #xlh...@irc.quakenet.org ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zopectl and runzope not working on freshly easy_install'd zope 2.12.0c1
On Tue, September 22, 2009 14:10, Andreas Jung wrote: On 22.09.09 14:07, Jürgen Herrmann wrote: On Tue, September 22, 2009 13:31, Andreas Jung wrote: On 22.09.09 13:29, Jürgen Herrmann wrote: On Tue, September 22, 2009 12:23, Andreas Jung wrote: On 22.09.09 12:15, Jürgen Herrmann wrote: ... (my_zope)[...@t5-laptop my_zope]$ bin/mkzopeinstance Please choose a directory in which you'd like to install Zope instance home files such as database files, configuration files, etc. Try to create your instance outside the buildout dir. Andreas some further testing shows, that it's still possible to have the instance home in /somedir/instance and the virtualenv in /somedir/instance/virtualenv s Better give feedback if it worked or not :-) Andreas well, now it works. as descripted above, my instance home is now /home/xlhost/zope and the virtualenv is in /home/xlhost/zope/virtualenv i found another problem though: Zope2-2.12.0c1-py2.6-linux-i686.egg/Products/PluginIndexes/nterfaces.py is now missing the interfaces ITextIndex and IVocabulary which leads to import errors in Products.GenericSetup why have these been dropped? The removal of TextIndex is documented in the release notes. Andreas ok, thanks very much for your help! 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-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] zope 2.12.0b1 bugs
i found two bugs in the current zope 2.12 beta: 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? so could it? i'm willing to give it a try and fix this. can i acquire standard_error_message from a HTTPResponse instance? 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: * 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 no clues on this one. where can i report these two bugs? ...or maybe a fix for 1. 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] [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 )
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 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] 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-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 don't think so. i modified ZConfig/loader.py, lines 203 and following: try: ignored = __import__(package) +print ignored: %r % ignored except ImportError, e: raise ZConfig.SchemaResourceError( could not load package %s: %s % (package, str(e)), filename=file, package=package) pkg = sys.modules[package] +print pkg: %r % pkg if not hasattr(pkg, __path__): raise ZConfig.SchemaResourceError( import name does not refer to a package, filename=file, package=package) return package:%s:%s % (package, file) the debug prints: ignored: module 'ZODB' from '/home/xlhost/zope/lib/python2.4/site-packages/ZODB3-3.9.0a12-py2.4-linux-i686.egg/ZODB/__init__.pyc' pkg: module 'ZODB' from '/home/xlhost/zope/lib/python2.4/site-packages/ZODB3-3.9.0a12-py2.4-linux-i686.egg/ZODB/__init__.pyc' ignored: module 'relstorage' from '/home/xlhost/zope/lib/python2.4/site-packages/RelStorage-1.1.3-py2.4.egg/relstorage/relstorage.pyc' pkg: module 'relstorage' from '/home/xlhost/zope/lib/python2.4/site-packages/RelStorage-1.1.3-py2.4.egg/relstorage/relstorage.pyc' so the imports seem to work fine, however pkg has __path__ attribute missing! maybe that will help with debugging? btw. i also tried relstorage trunk (did a svn co and replace the egg's files with the checkout files), but that did NOT help. 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] zope 2.12.0a4 and CMFCore
i followed the directions in this thread: http://www.nabble.com/Zope-2.12.0a4-easy_installable---please-test-td23212708.html installation was fine with stock python2.4 on mandriva 2008.1 easy_install Products.CMFCore: installed without errors. on startup i get the following traceback: ... File /home/xlhost/zope/GeneralProducts/utils/__init__.py, line 12, in ? from Products.TrustedExecutables.TrustedFSPageTemplate import TrustedFSPageTemplate File /home/xlhost/zope/Products/TrustedExecutables/TrustedFSPageTemplate.py, line 3, in ? from Products.CMFCore.FSPageTemplate import FSPageTemplate, registerFileExtension File /home/xlhost/zope/lib/python2.4/site-packages/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/__init__.py, line 26, in ? import PortalFolder File /home/xlhost/zope/lib/python2.4/site-packages/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/PortalFolder.py, line 32, in ? from CMFCatalogAware import CMFCatalogAware File /home/xlhost/zope/lib/python2.4/site-packages/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/CMFCatalogAware.py, line 31, in ? from interfaces import ICallableOpaqueItem File /home/xlhost/zope/lib/python2.4/site-packages/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/interfaces/__init__.py, line 47, in ? from Interface.bridge import createZope3Bridge ImportError: No module named Interface.bridge any hints where to start hunting that bug? is it actually a bug? 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] zope2.12.a04 / relstorage / zodbconvert.py errors
i successfully installed zope 2.12.0a4 via easy_install today. startup and functionality is fine. i installed relstorage via easy_install also, but shipped zodbconvert.py fails with the following traceback: Traceback (most recent call last): File ./lib/python2.4/site-packages/RelStorage-1.1.3-py2.4.egg/relstorage/zodbconvert.py, line 110, in ? main() File ./lib/python2.4/site-packages/RelStorage-1.1.3-py2.4.egg/relstorage/zodbconvert.py, line 68, in main schema = ZConfig.loadSchemaFile(StringIO(schema_xml)) File /home/xlhost/zope/lib/python2.4/site-packages/ZConfig-2.6.1-py2.4.egg/ZConfig/loader.py, line 35, in loadSchemaFile return SchemaLoader().loadFile(file, url) File /home/xlhost/zope/lib/python2.4/site-packages/ZConfig-2.6.1-py2.4.egg/ZConfig/loader.py, line 75, in loadFile return self.loadResource(r) File /home/xlhost/zope/lib/python2.4/site-packages/ZConfig-2.6.1-py2.4.egg/ZConfig/loader.py, line 187, in loadResource schema = ZConfig.schema.parseResource(resource, self) File /home/xlhost/zope/lib/python2.4/site-packages/ZConfig-2.6.1-py2.4.egg/ZConfig/schema.py, line 27, in parseResource xml.sax.parse(resource.file, parser) File /home/xlhost/zope/lib/python2.4/site-packages/RelStorage-1.1.3-py2.4.egg/relstorage/__init__.py, line 31, in parse File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line 109, in parse File /usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py, line 123, in parse File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line 216, in feed File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line 312, in start_element File /home/xlhost/zope/lib/python2.4/site-packages/ZConfig-2.6.1-py2.4.egg/ZConfig/schema.py, line 103, in startElement getattr(self, start_ + name)(attrs) File /home/xlhost/zope/lib/python2.4/site-packages/ZConfig-2.6.1-py2.4.egg/ZConfig/schema.py, line 306, in start_import src = self._loader.schemaComponentSource(pkg, file) File /home/xlhost/zope/lib/python2.4/site-packages/ZConfig-2.6.1-py2.4.egg/ZConfig/loader.py, line 215, in schemaComponentSource filename=file, package=package) ZConfig.SchemaResourceError: import name does not refer to a package Package name: 'relstorage' File name: 'component.xml' Package path: None a debug print before the exception is raised revealed the following: - a __import__('relstorage') on line 204 of ZConfig/loader.py loads the module just fine. - the test hasattr(pkg, __path__) on line 211 fails. - a __import__('relstorage') in my virtualenv's python interpreter imports the module and there it has a __path__ attribute! in a newsgroup posting i read the following sentence: modules don't have __path__, only packages do. wtf??? his is as much information as i can provide. i'm somehow lost and confused now. any hints? 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope] 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 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 )
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] 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-dev] Re: Interest in AdvancedQuery and/or ManagableIndex?
On Mon, February 5, 2007 12:26, Philipp von Weitershausen wrote: On 5 Feb 2007, at 12:22 , Martijn Faassen wrote: Some of the holdup is in the bylaws. The bylaws were, simply put, rather overengineered, and we've been struggling to cut them down so we can actually work with them. This is holding up the IP transfer. Ok. Is there anything us mere mortals can do to speed up this process? Another is of course who is doing the hosting. Currently we're using ZC's infrastructure for SVN. We need to shift it away from ZC's infrastructure at some point to make it easier to give other people access. ZC can say more about this, however. I'm sure we'd find somebody willing to host at least the subversion repository. We just need to get to a point where we can say: Hey, the ZF now owns Zope, who wants to host it? can anyone estimate on how much traffic the svn-repos will generate? we have enough space and cpu time available, but traffic is an issue if it exceeds one or two mbits average per month (300-600gb)... 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] 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: VirtualHost 85.235.249.119:80 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] /VirtualHost The rule works fine when proxy.conf is like this: Proxy * Allow from localhost /Proxy 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. Proxy * Order Deny,Allow Allow from localhost Deny from all /Proxy or Proxy * Allow from localhost Deny from all /Proxy 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=jinwutuanww=145dc=1dir=0num=5color=4charset=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 )
[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] 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 )
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: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 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] 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: zope@zope.org 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 TrustedFSPageTemplate at /bliss/BlissCalendar/show_content_week * 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: PythonExpr dates.sort(lambda a,b: cmp(context.utils.text2date(a), context.utils.text2date(b))) Names: {'container': BlissCalendar at /bliss/BlissCalendar, 'context': BlissCalendar at /bliss/BlissCalendar, 'default': Products.PageTemplates.TALES.Default instance at 0xb703850c, 'here': BlissCalendar at /bliss/BlissCalendar, 'loop': Products.PageTemplates.TALES.SafeMapping object at 0xb5d9426c, 'modules': Products.TrustedExecutables.TrustedExpression._ModuleImporter instance at 0xb6fa1b8c, 'nothing': None, 'options': {'args': ()}, 'repeat': Products.PageTemplates.TALES.SafeMapping object at 0xb5d9426c, 'request': HTTPRequest, URL=https://bliss.local/BlissCalendar/show_content_week, 'root': Application at , 'template': TrustedFSPageTemplate at /bliss/BlissCalendar/show_content_week, 'traverse_subpath': [], 'user': User at /bliss/data/Users/instances/juherm00 used for /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 string, line 2, in f * Module string, line 2, in lambda 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 )
[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 TrustedFSPageTemplate at /bliss/BlissCalendar/show_content_week * 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: PythonExpr dates.sort(lambda a,b: cmp(context.utils.text2date(a), context.utils.text2date(b))) Names: {'container': BlissCalendar at /bliss/BlissCalendar, 'context': BlissCalendar at /bliss/BlissCalendar, 'default': Products.PageTemplates.TALES.Default instance at 0xb703850c, 'here': BlissCalendar at /bliss/BlissCalendar, 'loop': Products.PageTemplates.TALES.SafeMapping object at 0xb5d9426c, 'modules': Products.TrustedExecutables.TrustedExpression._ModuleImporter instance at 0xb6fa1b8c, 'nothing': None, 'options': {'args': ()}, 'repeat': Products.PageTemplates.TALES.SafeMapping object at 0xb5d9426c, 'request': HTTPRequest, URL=https://bliss.local/BlissCalendar/show_content_week, 'root': Application at , 'template': TrustedFSPageTemplate at /bliss/BlissCalendar/show_content_week, 'traverse_subpath': [], 'user': User at /bliss/data/Users/instances/juherm00 used for /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 string, line 2, in f * Module string, line 2, in lambda 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] 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: zope@zope.org 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 TrustedFSPageTemplate at /bliss/BlissCalendar/show_content_week * 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: PythonExpr dates.sort(lambda a,b: cmp(context.utils.text2date(a), context.utils.text2date(b))) Names: {'container': BlissCalendar at /bliss/BlissCalendar, 'context': BlissCalendar at /bliss/BlissCalendar, 'default': Products.PageTemplates.TALES.Default instance at 0xb703850c, 'here': BlissCalendar at /bliss/BlissCalendar, 'loop': Products.PageTemplates.TALES.SafeMapping object at 0xb5d9426c, 'modules': Products.TrustedExecutables.TrustedExpression._ModuleImporter instance at 0xb6fa1b8c, 'nothing': None, 'options': {'args': ()}, 'repeat': Products.PageTemplates.TALES.SafeMapping object at 0xb5d9426c, 'request': HTTPRequest, URL=https://bliss.local/BlissCalendar/show_content_week, 'root': Application at , 'template': TrustedFSPageTemplate at /bliss/BlissCalendar/show_content_week, 'traverse_subpath': [], 'user': User at /bliss/data/Users/instances/juherm00 used for /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 string, line 2, in f * Module string, line 2, in lambda 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 )
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-dev] ImageFile weirdness?
On Thu, February 23, 2006 09:02, Chris Withers wrote: 1. why the 3 posts? sorry, there was a long delay before my messages appeared, so i thought i had problems with my subscription. sorry for the triple post! 2. Why on [EMAIL PROTECTED] This should be on zope@zope.org well, actually i have a specific question about ImageFile internals here, thought it would fit in best here, if not - sorry. Jürgen Herrmann wrote: hi all! i have a class ImageContainer in a python product, that has an ImageFile attached, it's named 1.gif: ... image = ImageFile('1.gif', '/some/where') setattr(self.__class__, '1.gif', image) 3. Arrgh?! What _are_ you trying to do here? what are you trying to say here? this is totally unrelated to my actual problem. 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ImageFile weirdness?
hi all! i have a class ImageContainer in a python product, that has an ImageFile attached, it's named 1.gif: ... image = ImageFile('1.gif', '/some/where') setattr(self.__class__, '1.gif', image) ... i have an ImageContainer instance in my zope root. if i point my browser to http://localhost/ImageContainer/1.gif , i can see the image in the browser, everything seems fine, image is displayed. if however the image is named 1 only, e.g. ... image = ImageFile('1', '/some/where') setattr(self.__class__, '1', image) ... i notice a difference when viewing http://localhost/ImageContainer/1 . the browser pops up a download window, showing the content type is application/octet-stream. using firefox' livehttpheaders extension i found out that the content-type header is missing. if i view http://localhost/ImageContainer/1/ everything is fine however. now i peeked into App.ImageFile, where i can find a index_html() method, where the content-type header is set. viewing http://localhost/ImageContainer/1 never calls the index_html method though, http://localhost/ImageContainer/1/ obviously does. that's where i'm stuck now, who handles the ImageFile's invokation, if called like http://localhost/ImageContainer/1 ? ImageFile inherits from Acquisition.Explicit, nothing else... thanks for your attention, 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ImageFile weirdness?
hi all! i have a class ImageContainer in a python product, that has an ImageFile attached, it's named 1.gif: ... image = ImageFile('1.gif', '/some/where') setattr(self.__class__, '1.gif', image) ... i have an ImageContainer instance in my zope root. if i point my browser to http://localhost/ImageContainer/1.gif , i can see the image in the browser, everything seems fine, image is displayed. if however the image is named 1 only, e.g. ... image = ImageFile('1', '/some/where') setattr(self.__class__, '1', image) ... i notice a difference when viewing http://localhost/ImageContainer/1 . the browser pops up a download window, showing the content type is application/octet-stream. using firefox' livehttpheaders extension i found out that the content-type header is missing. if i view http://localhost/ImageContainer/1/ everything is fine however. now i peeked into App.ImageFile, where i can find a index_html() method, where the content-type header is set. viewing http://localhost/ImageContainer/1 never calls the index_html method though, http://localhost/ImageContainer/1/ obviously does. that's where i'm stuck now, who handles the ImageFile's invokation, if called like http://localhost/ImageContainer/1 ? ImageFile inherits from Acquisition.Explicit, nothing else... thanks for your attention, 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ImageFile weirdness?
hi all! i have a class ImageContainer in a python product, that has an ImageFile attached, it's named 1.gif: ... image = ImageFile('1.gif', '/some/where') setattr(self.__class__, '1.gif', image) ... i have an ImageContainer instance in my zope root. if i point my browser to http://localhost/ImageContainer/1.gif , i can see the image in the browser, everything seems fine, image is displayed. if however the image is named 1 only, e.g. ... image = ImageFile('1', '/some/where') setattr(self.__class__, '1', image) ... i notice a difference when viewing http://localhost/ImageContainer/1 . the browser pops up a download window, showing the content type is application/octet-stream. using firefox' livehttpheaders extension i found out that the content-type header is missing. if i view http://localhost/ImageContainer/1/ everything is fine however. now i peeked into App.ImageFile, where i can find a index_html() method, where the content-type header is set. viewing http://localhost/ImageContainer/1 never calls the index_html method though, http://localhost/ImageContainer/1/ obviously does. that's where i'm stuck now, who handles the ImageFile's invokation, if called like http://localhost/ImageContainer/1 ? ImageFile inherits from Acquisition.Explicit, nothing else... thanks for your attention, 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] 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
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: configure xmlns=http://namespaces.zope.org/zope; xmlns:i18n=http://namespaces.zope.org/i18n; i18n:registerTranslations directory=locales / /configure (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 )
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
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: adapter 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 )
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: adapter 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
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: adapter 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 )
[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-dev] [RfC] Removal of old stuff in Zope 2.10
+1 on all of them On Tue, December 20, 2005 07:52, Andreas Jung wrote: Hi, for next release we plan to replace several parts with the corresponding components from Zope 3 (e.g. ZPT´). Philipp is working on a proposal on that issue. In addition I would like to get rid of some old stuff that is no longer maintained and buggy: - ZopeTutorial (could be ripped off without implications and made available for download on zope.org) - HelpSys - from a programmers view pretty much useless and not very helpful. I consider to replace it with something more useful (not sure we can re-use apidoc from Zope 3 in some way, perhaps the inclusion of Dieter's Docfinder might be more useful for programmers) - Gadfly(DA) - do we really need this? We discussed this already. In my opinion the purpose of Gadfly is only educational but nothing that one really needs or uses for production. It could be removed and made available for download on zope.org. And my favourite enemy in Zope: ZClasses :-) I would like to mark them _clearly_ as an obsolete feature (DeprecationWarning, Warnings in the ZMI and the Zope Book). I _don't_ propose to remove them at some point but ppl should be aware that they are using one of the most-scary components in Zope (please no further discussion about the pros and cons of ZClasses..this discussion took already place already a bunch of times on the list). -aj ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope ) ___ 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] RFV: Unicode in Zope 2
On Mon, December 19, 2005 17:44, Andreas Jung wrote: --On 9. Dezember 2005 10:11:42 -0500 Jim Fulton [EMAIL PROTECTED] wrote: I forgot a very important need: - Common approach to Unicode We need to migrate Zope 2 to use a similar strategy. We need volunteers to brainstorm how this can be done and make one or more proposals. This is likely a prerequisite for finishing the publisher and ZPT work. I think there are two approaches. Textual content can be produced by nearly every Zope object (and its methods). Content can be composed by the basic Zope functionalities like DTML, ZPT, PyScripts and external methods (in the sense that these functionalities are able to call other objects and their methods). a) one could enforce all objects to return unicode (which would be a very hard requirement) and possibly break any application hi all! i think, a) is surely the cleaner solution. actually i always... - inlcude an content-type header and set the charset for all forms to utf8 - use :utf8:ustring/utext/ulines/utokens converters on all forms this way i always have unicode strings in my db. up to now i never had any unicode problems, expect when interfacing external systems and not doing the proper unicode conversion dance there... why not design a migration script that converts all non-ascii strings in the db to unicode strings, based on the default encoding, etc... also just some thoughts :) jürgen herrmann ps: what's especially critical here is code that handles filenames. some filesystems just don't handle unicode filenames, already had some headache there :) b) convert non-unicode content produced by Zope objects from where they are called (DTMl, ZPT, PyScript, Extmethods) to unicode. This would limit the number of places where we need to change code. The encoding of the non-unicode content could be from the 'content-type: XXX; charset=' header (if set) or as fallback from the configured zpublisher_default_encoding. An object could also set a property my_output_encoding (or so)... just-some-thoughts... -aj ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope ) ___ 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 ___ 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-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] 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 )
[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] 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 )
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 )
[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] 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 )
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] 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.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
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 dos... 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] 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
[ 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 )
[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] 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 )
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
[ 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] 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] 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] 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] 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 )
[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 )
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 )
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 )
[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] 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] input type=image name=method:action 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 )
[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: [Products.ZCatalog.Catalog.mybrains object at 0xb629798c, Products.ZCatalog.Catalog.mybrains object at 0xb40d9dec] Products.ZCatalog.Catalog.mybrains object at 0xb629798c bound method ZCatalog.getId of ZCatalog at /1/Catalog Catalog Products.ZCatalog.Catalog.mybrains object at 0xb40d9dec bound method ZCatalog.getId of ZCatalog at /1/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] 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: [Products.ZCatalog.Catalog.mybrains object at 0xb629798c, Products.ZCatalog.Catalog.mybrains object at 0xb40d9dec] Products.ZCatalog.Catalog.mybrains object at 0xb629798c bound method ZCatalog.getId of ZCatalog at /1/Catalog Catalog Products.ZCatalog.Catalog.mybrains object at 0xb40d9dec bound method ZCatalog.getId of ZCatalog at /1/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 )
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
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 RD +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
[ 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
[ 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 )
[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 )
Re: [Zope] automagic reindexing of objects
[ Jonathan wrote:] - Original Message - From: Jrgen 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 )
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 )
[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: virtualhost 1.2.3.4:443 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 /virtualhost 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): VirtualHost 66.123.23.17:443 ServerName myserver.com ServerAdmin [EMAIL PROTECTED] SSLProxyEngine on RewriteEngine On RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/https/myserver.com:443/app/$1 [L,P] /VirtualHost 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 )