[Zope-Checkins] SVN: Zope/branches/efge-five-events-work/lib/python/OFS/subscribers.py Move code around a bit.

2005-11-10 Thread Florent Guillaume
Log message for revision 40024:
  Move code around a bit.
  

Changed:
  U   Zope/branches/efge-five-events-work/lib/python/OFS/subscribers.py

-=-
Modified: Zope/branches/efge-five-events-work/lib/python/OFS/subscribers.py
===
--- Zope/branches/efge-five-events-work/lib/python/OFS/subscribers.py   
2005-11-10 13:06:53 UTC (rev 40023)
+++ Zope/branches/efge-five-events-work/lib/python/OFS/subscribers.py   
2005-11-10 13:41:15 UTC (rev 40024)
@@ -139,12 +139,12 @@
 def callManageBeforeDelete(ob, item, container):
 Compatibility subscriber for manage_beforeDelete.
 
+if container is None:
+return
 if getattr(aq_base(ob), 'manage_beforeDelete', None) is None:
 return
-if container is None:
-return
+maybeWarnDeprecated(ob, 'manage_beforeDelete')
 import OFS.ObjectManager # avoid circular imports
-maybeWarnDeprecated(ob, 'manage_beforeDelete')
 try:
 ob.manage_beforeDelete(item, container)
 except OFS.ObjectManager.BeforeDeleteException:

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/efge-five-events-work/ Banch has been merged.

2005-11-10 Thread Florent Guillaume
Log message for revision 40031:
  Banch has been merged.

Changed:
  D   Zope/branches/efge-five-events-work/

-=-
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ Use a better __repr__ for User objects.

2005-11-09 Thread Florent Guillaume
Log message for revision 40006:
  Use a better __repr__ for User objects.
  
  (NullUnrestrictedUser had a non-string repr that made it impossible to
  debug properly.)
  
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/AccessControl/User.py
  U   Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2005-11-09 19:39:45 UTC (rev 40005)
+++ Zope/trunk/doc/CHANGES.txt  2005-11-09 19:53:08 UTC (rev 40006)
@@ -86,6 +86,8 @@
 
 Other
 
+  - AccessControl.User: Use a better __repr__.
+
   - ZSQLMethod.manage_main: Moved the error message that warns of a
 non-existing or closed database connection next to the Connection ID
 dropdown and present it using red to increase its visibility.

Modified: Zope/trunk/lib/python/AccessControl/User.py
===
--- Zope/trunk/lib/python/AccessControl/User.py 2005-11-09 19:39:45 UTC (rev 
40005)
+++ Zope/trunk/lib/python/AccessControl/User.py 2005-11-09 19:53:08 UTC (rev 
40006)
@@ -276,7 +276,8 @@
 
 def __len__(self): return 1
 def __str__(self): return self.getUserName()
-__repr__=__str__
+def __repr__(self):
+return '%s %r' % (self.__class__.__name__, self.getUserName())
 
 
 class SimpleUser(BasicUser):

Modified: Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py
===
--- Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py 2005-11-09 
19:39:45 UTC (rev 40005)
+++ Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py 2005-11-09 
19:53:08 UTC (rev 40006)
@@ -275,7 +275,22 @@
 f = User('chris', '123', ['Manager'], [])
 self.assertEqual(f.getDomains(), ())
 
+def testRepr(self):
+f = User('flo', '123', ['Manager'], [])
+self.assertEqual(repr(f), User 'flo')
 
+def testReprSpecial(self):
+from AccessControl.User import NullUnrestrictedUser
+from AccessControl.User import nobody
+from AccessControl.User import system
+# NullUnrestrictedUser is used when there is no emergency user
+self.assertEqual(repr(NullUnrestrictedUser()),
+ NullUnrestrictedUser (None, None))
+self.assertEqual(repr(nobody),
+ SpecialUser 'Anonymous User')
+self.assertEqual(repr(system),
+ UnrestrictedUser 'System Processes')
+
 def test_suite():
 suite = unittest.TestSuite()
 suite.addTest(unittest.makeSuite(UserFolderTests))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/efge-five-events-work/ Branch to fix events with Five.

2005-11-09 Thread Florent Guillaume
Log message for revision 40012:
  Branch to fix events with Five.
  

Changed:
  A   Zope/branches/efge-five-events-work/

-=-
Copied: Zope/branches/efge-five-events-work (from rev 40011, Zope/trunk)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: moment when zope was started.

2005-11-09 Thread Florent Guillaume
If you go to the control panel of a running Zope, you'll see it display 
Running For with the correct number of seconds. So there's obviously an 
existing way for the server to know when it was started, just look how the 
control panel does it.


Florent

Victor Safronovich wrote:

VSHow could i find the moment when zope was started in Zope 2.8?
VSin  Zope  2.7  was the variable 'Zope.Startup.started', which setted to 
True when
VSzope was started.

VSBut in Zope 2.8 the variable 'Zope2.Startup.started' not changed its 
value to
VSTrue, because Zope2.Startup.start_zope was never called, instead of that 
called
VSZope2.Startup.run.run function.
   this may be fixed like in attachment.





Index: __init__.py
===
--- __init__.py (revision 39858)
+++ __init__.py (working copy)
@@ -28,13 +28,17 @@
 
 logger = logging.getLogger(Zope)

 started = False
+starter = None
 
 def get_starter():

-check_python_version()
-if sys.platform[:3].lower() == win:
-return WindowsZopeStarter()
-else:
-return UnixZopeStarter()
+global starter
+if starter is None:
+check_python_version()
+if sys.platform[:3].lower() == win:
+starter = WindowsZopeStarter()
+else:
+starter = UnixZopeStarter()
+return starter
 
 def start_zope(cfg, debug_handler):

 The function called by run.py which starts a Zope appserver.
@@ -47,11 +51,11 @@
 starter.setConfiguration(cfg)
 starter.prepare()
 
-started = True

+starter.start()
 try:
 starter.run()
 finally:
-started = False
+starter.finish()
 
 
 class ZopeStarter:

@@ -59,6 +63,8 @@
 
 Making it a class makes it easier to test.

 
+started = False
+
 def __init__(self):
 self.event_logger = logging.getLogger()
 # We log events to the root logger, which is backed by a
@@ -81,6 +87,14 @@
 def setConfiguration(self, cfg):
 self.cfg = cfg
 
+def start(self):

+global started
+self.started = started = True
+ 
+def finish(self)

+global started
+self.started = started = False
+
 def prepare(self):
 self.setupInitialLogging()
 self.setupLocale()
Index: run.py
===
--- run.py  (revision 39858)
+++ run.py  (working copy)
@@ -15,11 +15,7 @@
 def run():
  Start a Zope instance 
 import Zope2.Startup
-starter = Zope2.Startup.get_starter()
-opts = _setconfig()
-starter.setConfiguration(opts.configroot)
-starter.prepare()
-starter.run()
+Zope2.Startup.start_zope(_setconfig().configroot, None)
 
 def configure(configfile):

  Provide an API which allows scripts like zopectl to configure




___
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 )



--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: moment when zope was started.

2005-11-09 Thread Florent Guillaume

Victor Safronovich wrote:

Hello zope-dev!

   How could i find the moment when zope was started in Zope 2.8?
   in  Zope  2.7  was the variable 'Zope.Startup.started', which setted to True 
when
   zope was started.

   But in Zope 2.8 the variable 'Zope2.Startup.started' not changed its value to
   True, because Zope2.Startup.start_zope was never called, instead of that 
called
   Zope2.Startup.run.run function.


What do you suggest? If you feel the attribute 'started' should be removed 
from Zope, because it's unused, please file a new ticket in the Zope collector.


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Re: VIRTUAL_URL Failure

2005-11-09 Thread Florent Guillaume

The correct thing to use in a recent Zope is REQUEST['ACTUAL_URL'].

Florent

George Lee wrote:

Two main questions:
  (1) Does anybody *have* good documentation on VIRTUAL_URL and how it
interacts with CookieCrumbler and VirtualHostMonster?
  (2) Does anyone know how to debug VirtualHostMonster or other Python
libraries while running a Zope instance (it lives in Python not in
Zope, so I don't know if I change the code there if those changes will
actually get executed)?



For people who care to read more about what I think is going on:



Well, where is VIRTUAL_URL documented? Why doesn't Plohn do something
sane if it's not there?



It's not Plone's issue from what I can tell. CookieCrumbler, which
lives in CMF, does do something sane if VIRTUAL_URL is not there -- it
tries to create a substitute URL.

VIRTUAL_URL is set by the VirtualHostMonster. Does anyone know how to
debug it? Because it is in the python directories used to build Zope,
not in a Zope product which I know how to debug. (Is there a way to
restart python to register changes in VirtualHostMonster.py)?

Here is what I can tell of what is going on:

(1) VIRTUAL_URL is supposed to return the actual URL when there is a
Virtual Hosting Monster, for instance http://subdomain.mydomain.org
instead of http://ip:port/path/to/subdomain/object or
http://mydomain.org/path/to/subdomain/object.

(2) There's an Apache rewrite rule set to transform URL requests like
http://subdomain.org to
http://ip:port/VirtualHostBase/http/subdomain.mydomain.org before they
get sent into Zope.

(3) When VirtualHostMonster receives a request like
http://ip:port/VirtualHostBase/http/subdomain.mydomain.org, it is
supposed to return the currect object at
http://ip:port/path/to/subdomain/object and set a variable VIRTUAL_URL
http://subdomain.mydomain.org in the REQUEST variable.

(4) When navigating to an authenticated-only page, CMFCore's
CookieCrumbler sets a came_from variable to remember where to go. To
set the came_from variable, it first looks for VIRTUAL_URL. If it
doesn't find it, it uses another method to set came_from -- but this
returns an URL, and one that does not work.

(5) During login in Plone to a authenticated-only page, it uses
CMFCore's CookieCrumbler came_from variable.







I'm wondering if CookieCrumbler is supposed
to set VIRTUAL_URL given that there's a VHM installed and doesn't?


It's probably some code in the publisher or vhm. Maybe it's something
that didn't get merged from a branch or the trunk.

Your best bet is to come up with minimal (ie: no plone, no cookie
crumbler, etc) way to reproduce this and file a bug report in the collector.

Oh, and grab yourself a copy of grep and see where this should be
defined ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk




___
Zope maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )




--
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 )


[Zope-dev] Re: Memory Leak Question

2005-11-07 Thread Florent Guillaume
Could you provide details about why you think there's a leak in the code 
(what led you to Wrapper_findattr), and how to reproduce it consistently on 
a blank platform (Zope 2.8.4 preferred)?


Maybe open a bug in the collector at http://www.zope.org/Collectors/Zope/ also.

Thanks,

Florent

Dan Pozmanter wrote:

Consider it reported then.
(Sorry for the delay, I was out of the office for most of last week).

It looks like the problem is in Wrapper_findattr.

Any thoughts?

___
 
Daniel Pozmanter

Siteworx, Inc.
 
Festina Lente - Gaius Julius


-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 31, 2005 10:33 PM

To: Dan Pozmanter
Cc: zope-dev@zope.org
Subject: Re: [Zope-dev] Memory Leak Question

Nobody has yet reported a memory leak symptom against any particular
piece of Zope 2.8.X yet, AFAIK.

On Oct 31, 2005, at 6:34 PM, Dan Pozmanter wrote:



Ahoy,

  I was poking around in _Acquisition.c, and noticed my memory usage 
spiked.
Returning to the vanilla code (2.8.2-final), I noticed the same spike 
(just less pronounced).

(If you refresh the page a few gazillion times this pops up).

I would not categorize this as an actual bug report (I'd like to test 
more rigorously with a script to verify a leak), but after reading the




note on Changes for 2.8.x in the to do section, I was curious:
Is this a known issue?

If so, has there been any headway, and can I be of any assistance in 
resolving it?




--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Get rid of configure/make? (was Re: Re: SVN: Zope/trunk/ Merge philikon-zope32-integration branch. Basically, this branch entails:)

2005-11-06 Thread Florent Guillaume

Tres Seaver wrote:

Sysadmins are the target audience for the installer, not
Python programmers;  './configure  make  sudo make install is the
classic pattern for them (which is why we do Zope2 this way now).

-1 to removing './configure'.


I agree with Tres and others. -1 on removing ./configure and the 
Makefile. It's expected by all sysadmins.


And if setup.py works, then the Makefile should be just a few lines 
invoking it, so it's no real burden.


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: differences in PropertyManager._setPropValue

2005-11-03 Thread Florent Guillaume

Victor Safronovich wrote:

Hello Florent Guillaume,

Monday, October 31, 2005, 6:25:20 PM, you wrote:


FG This was changed because have mutable objects stored as properties can lead 
FG to unexpected behavior. Do you mean you have a custom proprty type called 
FG list?

yes, my own property of type 'list'. I don`t find any restriction on type of
the property, only in comment of the PropertyManager class:

The 'type' string must be one of the values: 'float', 'int', 'long',
'string', 'lines', 'text', 'date', 'tokens', 'selection', or
'multiple section'.

But PropertyManager support any custom types not only types descriped above.
For  example Publisher supports ':list' and ':tuple' converters (but only in
HTTPRequest.processInputs  method,  it  is  impossible  to manage 'list',
'tuple', 'records' types through converters.py module, pitifully )

FG  What's your use case for it, and why can't tuple fit the bill ?
My  code  use  the  'sort'  method of the python list type. Of course this 
is
ugly to trust the getProperty result, and my code should be manually convert
the getProperty result to list.


Indeed it should, as doing self.someprop.sort() for instance has bugs 
related to persistence if someprop is a list. The change from Zope 2.6 to 
Zope 2.7 turning all sequence properties to tuples was for this, and other, 
reasons.



of course i repaire my code, but how chould i escape from incompatible 
behavior
of  the  zope versions in future? may be write more tests to 
PropertyManager class? or
how?


That's one of the rare incompatibilities between 2.6 and 2.7. It's 
mentionned in the release notes for 2.7.0b4:


  Some property types were stored in a mutable data type (list) which could
  potentially allow untrusted code to effect changes on those properties
  without going through appropriate security checks in particular scenarios

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: SVN: Zope/trunk/ Merge philikon-zope32-integration branch. Basically, this branch entails:

2005-11-03 Thread Florent Guillaume

yuppie wrote:

Hi Philipp!


Philipp von Weitershausen wrote:


That part seems to be work in progress. I needed some time and manual
changes to set up an in-place instance for a fresh sandbox.



What changes are those? A fresh Zope trunk checkout works for me. Here's
what I did:

  $ svn co svn+ssh://[EMAIL PROTECTED]/repos/main/Zope/trunk 
Zope-trunk

  $ cd Zope-trunk
  $ ./configure



This fails if Python 2.4.2 is installed, but this worked:

  $ ./configure --with-python=/usr/bin/python2.4

[I see this is meanwhile fixed :)]


  $ make



works and returns this message:

  Zope built. Next, do 'make install' (or 'make instance'
  to run a Zope instance directly from the build directory).

following those instructions:

  $ make instance
  printf Zope 2.8.0-b1 \
/Zope-trunk/lib/python/version.txt
  /usr/bin/python2.4 /Zope-trunk/setup.py  \
 build_ext -i \
 install --skip-build --home=/Zope-trunk
  running build_ext
  running build_headers
  running install
  running install_lib
  warning: install_lib: 'build/lib.linux-i686-2.4' does not exist
-- no Python modules to install
  running install_headers
  [...]
  running install_scripts
  error: cannot copy tree 'build/scripts-2.4': not a directory
  make: *** [install] Error 1

Same problems as reported by the buildbot.


I seem to remember that if you remove the --skip-build in that generated 
command line it works. I know it took me a while too, and that I was too 
busy trying to fix tests afterward to record what I did exactly.


Anyway at least a build_scripts is missing somewhere.

Florent



Renaming build/temp.linux-i686-2.4 to build/lib.linux-i686-2.4 and 
adding build/scripts-2.4 by hand made 'make instance' run.



That worked for me (though I usually don't do the configure; make dance,
but just do an in-place build with python setup.py build -i; see also
below).



Using

  $ python2.4 setup.py build_ext -i

'works', but doesn't create a complete instance. Did you try to start 
bin/zopectl? I don't even have a bin directory.




And I didn't manage to install Zope trunk to a different location.
That seems to be completely screwed up.



Not supported anymore is the right wording here. Basically, the
configure; make; make install dance is going to go away for an SVN
checkout. A simple Makefile as we have it in Zope 3 that simply provides
shortcuts for in-place builds will probably replace it.

We're not even sure if the configure dance makes sense for a release
tarball. The only benefit of the ./configure script is that it
(presumably) chooses the right Python for you, which isn't always what
you want, anyways. At least I do ./configure --with-python=... more than
half of the times. So I could just call python setup.py install with
whatever Python I want in the first place.



Thanks for clarifying.


Cheers,

Yuppie




--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py Work correctly with event dispatching:

2005-11-02 Thread Florent Guillaume
Log message for revision 39820:
  Work correctly with event dispatching:
  - mark a test class as deprecated,
  - use a container class that implements IItem.
  
  

Changed:
  U   
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py

-=-
Modified: 
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py
===
--- 
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py
 2005-11-01 17:49:19 UTC (rev 39819)
+++ 
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py
 2005-11-01 18:44:03 UTC (rev 39820)
@@ -48,7 +48,15 @@
 raise DeleteFailed
 return SimpleItem.manage_beforeDelete(self, item, container)
 
+from Products.Five.eventconfigure import setDeprecatedManageAddDelete
+setDeprecatedManageAddDelete(ItemForDeletion)
 
+from zope.interface import implements
+from OFS.interfaces import IItem
+class ObjectManagerWithIItem(ObjectManager):
+The event subscribers work on IItem.
+implements(IItem)
+
 class ObjectManagerTests( unittest.TestCase ):
 
 def setUp(self):
@@ -62,11 +70,8 @@
 getConfiguration().debug_mode = mode
 
 def _getTargetClass( self ):
+return ObjectManagerWithIItem
 
-from OFS.ObjectManager import ObjectManager
-
-return ObjectManager
-
 def _makeOne( self, *args, **kw ):
 
 return self._getTargetClass()( *args, **kw ).__of__( FauxRoot() )

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py Move code inside try/except.

2005-11-02 Thread Florent Guillaume
Log message for revision 39829:
  Move code inside try/except.
  

Changed:
  U   
Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py

-=-
Modified: 
Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py
===
--- 
Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py
2005-11-01 21:26:30 UTC (rev 39828)
+++ 
Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py
2005-11-01 21:31:49 UTC (rev 39829)
@@ -21,11 +21,11 @@
 def setUp(self):
 transaction.begin()
 self.app = makerequest(Zope2.app())
-if not hasattr(self.app, 'error_log'):
-# If ZopeLite was imported, we have no default error_log
-from Products.SiteErrorLog.SiteErrorLog import SiteErrorLog
-self.app._setObject('error_log', SiteErrorLog())
 try:
+if not hasattr(self.app, 'error_log'):
+# If ZopeLite was imported, we have no default error_log
+from Products.SiteErrorLog.SiteErrorLog import SiteErrorLog
+self.app._setObject('error_log', SiteErrorLog())
 self.app.manage_addDTMLMethod('doc', '')
 except:
 self.tearDown()

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py Don't recurse explicitely, and shut up deprecation warnings.

2005-11-02 Thread Florent Guillaume
Log message for revision 39835:
  Don't recurse explicitely, and shut up deprecation warnings.
  

Changed:
  U   
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py

-=-
Modified: 
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py
===
--- 
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py
 2005-11-01 23:23:14 UTC (rev 39834)
+++ 
Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py
 2005-11-01 23:44:21 UTC (rev 39835)
@@ -46,8 +46,13 @@
 self.before_delete_called = True
 if self.fail_on_delete:
 raise DeleteFailed
-return SimpleItem.manage_beforeDelete(self, item, container)
 
+def manage_afterAdd(self, item, container):
+pass
+
+def manage_afterClone(self, item):
+pass
+
 from Products.Five.eventconfigure import setDeprecatedManageAddDelete
 setDeprecatedManageAddDelete(ItemForDeletion)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/philikon-zope32-integration/lib/python/ Moved more stuff from Five into Zope itself.

2005-11-02 Thread Florent Guillaume
Log message for revision 39846:
  Moved more stuff from Five into Zope itself.
  Event interfaces are now in OFS.interfaces.
  IFiveObjectClonedEvent has been renamed into IObjectClonedEvent.
  
  

Changed:
  U   Zope/branches/philikon-zope32-integration/lib/python/OFS/CopySupport.py
  U   Zope/branches/philikon-zope32-integration/lib/python/OFS/ObjectManager.py
  U   Zope/branches/philikon-zope32-integration/lib/python/OFS/SimpleItem.py
  A   Zope/branches/philikon-zope32-integration/lib/python/OFS/event.py
  U   Zope/branches/philikon-zope32-integration/lib/python/OFS/interfaces.py
  A   Zope/branches/philikon-zope32-integration/lib/python/OFS/subscribers.py
  U   
Zope/branches/philikon-zope32-integration/lib/python/Products/BTreeFolder2/BTreeFolder2.py

-=-
Modified: 
Zope/branches/philikon-zope32-integration/lib/python/OFS/CopySupport.py
===
--- Zope/branches/philikon-zope32-integration/lib/python/OFS/CopySupport.py 
2005-11-02 14:30:36 UTC (rev 39845)
+++ Zope/branches/philikon-zope32-integration/lib/python/OFS/CopySupport.py 
2005-11-02 14:51:27 UTC (rev 39846)
@@ -33,8 +33,9 @@
 from zope.event import notify
 from zope.app.event.objectevent import ObjectCopiedEvent
 from zope.app.container.contained import ObjectMovedEvent
-from Products.Five.event import ObjectWillBeMovedEvent
-from Products.Five.event import FiveObjectClonedEvent
+from OFS.event import ObjectWillBeMovedEvent
+from OFS.event import ObjectClonedEvent
+import OFS.subscribers
 
 from OFS.interfaces import ICopyContainer
 from OFS.interfaces import ICopySource
@@ -160,12 +161,9 @@
 previous call to manage_cutObjects or manage_copyObjects as the first
 argument.
 
-Also sends IObjectCopiedEvent and IFiveObjectClonedEvent
+Also sends IObjectCopiedEvent and IObjectClonedEvent
 or IObjectWillBeMovedEvent and IObjectMovedEvent.
 
-# Done here to avoid circular imports
-from Products.Five.subscribers import maybeCallDeprecated
-
 if cb_copy_data is not None:
 cp = cb_copy_data
 elif REQUEST is not None and REQUEST.has_key('__cp'):
@@ -224,9 +222,9 @@
 
 ob._postCopy(self, op=0)
 
-maybeCallDeprecated('manage_afterClone', ob)
+OFS.subscribers.maybeCallDeprecated('manage_afterClone', ob)
 
-notify(FiveObjectClonedEvent(ob))
+notify(ObjectClonedEvent(ob))
 
 if REQUEST is not None:
 return self.manage_main(self, REQUEST, update_menu=1,
@@ -359,9 +357,6 @@
 def manage_clone(self, ob, id, REQUEST=None):
 Clone an object, creating a new object with the given id.
 
-# Done here to avoid circular imports
-from Products.Five.subscribers import maybeCallDeprecated
-
 if not ob.cb_isCopyable():
 raise CopyError, eNotSupported % escape(ob.getId())
 try:
@@ -393,9 +388,9 @@
 
 ob._postCopy(self, op=0)
 
-maybeCallDeprecated('manage_afterClone', ob)
+OFS.subscribers.maybeCallDeprecated('manage_afterClone', ob)
 
-notify(FiveObjectClonedEvent(ob))
+notify(ObjectClonedEvent(ob))
 
 return ob
 

Modified: 
Zope/branches/philikon-zope32-integration/lib/python/OFS/ObjectManager.py
===
--- Zope/branches/philikon-zope32-integration/lib/python/OFS/ObjectManager.py   
2005-11-02 14:30:36 UTC (rev 39845)
+++ Zope/branches/philikon-zope32-integration/lib/python/OFS/ObjectManager.py   
2005-11-02 14:51:27 UTC (rev 39846)
@@ -46,8 +46,9 @@
 from zope.event import notify
 from zope.app.container.contained import ObjectAddedEvent
 from zope.app.container.contained import ObjectRemovedEvent
-from Products.Five.event import ObjectWillBeAddedEvent
-from Products.Five.event import ObjectWillBeRemovedEvent
+from OFS.event import ObjectWillBeAddedEvent
+from OFS.event import ObjectWillBeRemovedEvent
+import OFS.subscribers
 
 
 # the name BadRequestException is relied upon by 3rd-party code
@@ -278,9 +279,6 @@
 
 Also sends IObjectWillBeAddedEvent and IObjectAddedEvent.
 
-# Done here to avoid circular imports
-from Products.Five.subscribers import maybeCallDeprecated
-
 ob = object # better name, keep original function signature
 v = self._checkId(id)
 if v is not None:
@@ -317,7 +315,7 @@
 if not suppress_events:
 notify(ObjectAddedEvent(ob, self, id))
 
-maybeCallDeprecated('manage_afterAdd', ob, self)
+OFS.subscribers.maybeCallDeprecated('manage_afterAdd', ob, self)
 
 return id
 
@@ -334,7 +332,7 @@
 # Don't do recursion anymore, a subscriber does that.
 warnings.warn(
 %s.manage_afterClone is deprecated and will be removed in 
-Zope 2.11, you should use an IFiveObjectClonedEvent 
+  

[Zope-Coders] Re: SVN: Zope/trunk/lib/python/Testing/ZopeTestCase/ transaction.commit(1) is deprecated in favor of transaction.savepoint().

2005-11-02 Thread Florent Guillaume

Stefan H. Holek wrote:

Log message for revision 39807:
  transaction.commit(1) is deprecated in favor of transaction.savepoint().


Actually, in favor of transaction.savepoint(optimistic=True).

Florent



Changed:
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/testZODBCompat.py

-=-
Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt  2005-11-01 
12:55:46 UTC (rev 39806)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt  2005-11-01 
13:00:43 UTC (rev 39807)
@@ -1,4 +1,5 @@
 Unreleased
+- transaction.commit(1) is deprecated in favor of transaction.savepoint().
 - Don't break if Python distros ship without profile support (Debian, Ubuntu).
 - Functional.publish() would hang if it got a request_method argument other
   than GET or HEAD while omitting the stdin argument.

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/testZODBCompat.py
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/testZODBCompat.py
2005-11-01 12:55:46 UTC (rev 39806)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/testZODBCompat.py
2005-11-01 13:00:43 UTC (rev 39807)
@@ -42,7 +42,7 @@
 self.folder.addDTMLMethod('doc', file='foo')
 # _p_oids are None until we commit a subtransaction
 self.assertEqual(self.folder._p_oid, None)
-transaction.commit(1)
+transaction.savepoint()
 self.failIfEqual(self.folder._p_oid, None)
 
 def testCutPaste(self):

@@ -93,7 +93,7 @@
 self.folder.addDTMLMethod('doc', file='foo')
 # _p_oids are None until we commit a subtransaction
 self.assertEqual(self.folder._p_oid, None)
-transaction.commit(1)
+transaction.savepoint()
 self.failIfEqual(self.folder._p_oid, None)
 
 def testExport(self):

@@ -315,7 +315,7 @@
 def testSubTransactionAbort(self):
 self.folder.foo = 1
 self.failUnless(hasattr(self.folder, 'foo'))
-transaction.commit(1)
+transaction.savepoint()
 transaction.abort()
 # This time the abort nukes the foo attribute...
 self.failIf(hasattr(self.folder, 'foo'))
@@ -330,7 +330,7 @@
 def testSubTransactionAbortPersistent(self):
 self.folder._p_foo = 1
 self.failUnless(hasattr(self.folder, '_p_foo'))
-transaction.commit(1)
+transaction.savepoint()
 transaction.abort()
 # This time the abort nukes the _p_foo attribute...
 self.failIf(hasattr(self.folder, '_p_foo'))
@@ -345,7 +345,7 @@
 def testSubTransactionAbortVolatile(self):
 self.folder._v_foo = 1
 self.failUnless(hasattr(self.folder, '_v_foo'))
-transaction.commit(1)
+transaction.savepoint()
 transaction.abort()
 # This time the abort nukes the _v_foo attribute...
 self.failIf(hasattr(self.folder, '_v_foo'))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins




--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders


[Zope-dev] Re: differences in PropertyManager._setPropValue

2005-10-31 Thread Florent Guillaume

Victor Safronovich wrote:

  I  have  a question about PropertyManager._setPropValue in 2.6 and its changed
  version in 2.7-2.8.

  I found this revision
  
http://svn.zope.org/Zope/trunk/lib/python/OFS/PropertyManager.py?rev=24349view=rev

Why   in   this   method added conversion to the tuple for all the lists? May be
better check for 'lines','tokens' property type? I have a properties of type
list,  and i expect that getProperty returns the list type. This works in Zope
2.6, but broken in 2.7-2.8


This was changed because have mutable objects stored as properties can lead 
to unexpected behavior. Do you mean you have a custom proprty type called 
list? What's your use case for it, and why can't tuple fit the bill ?


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Mountpoints

2005-10-29 Thread Florent Guillaume

Chris McDonough wrote:

This merge has been done.

Since zopectl test ProductName no longer appears to do the right
thing and I can't seem to get test.py to run anything except the entire
test suite, I didn't create any new tests because I wouldn't have had
the time to create tests and run them iteratively.


Jim merged his new testrunner some time ago. Syntax has changed 
slightly, see the help (zopectl test -h). You should do for instance:


zopectl test -s you.product.name
zopectl test -s you.product.name -m module-regexp -t test-regexp

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Re: Zope hangs with 'idle in transaction'

2005-10-28 Thread Florent Guillaume

Yuan HOng wrote:

It seems zope is initiating some database transactions even though my
site only access the database for reading. And those transaction
somehow get into deadlock status and finally used up the maximun db
connection allowed for zope.

But why? How do I find out what zope is doing and why the connection
are locked up?


You can use DeadlockDebugger for that.

Florent


Any clue and direction pointing are heartily appreciated.

Regards,

--
Hong Yuan


--
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 )


[Zope-dev] Re: Why is test.py silent by default

2005-10-24 Thread Florent Guillaume

Tres Seaver wrote:

The default usecase for running tests should be a developer making
changes and running tests.  In this case, silent mode is unhelpful;
it gives no feedback until the very end of the run, which takes a
**long** time for the whole Zope2 tree.  The dots provided at
verbosity level one are good feedback for the developer:  they provide a
clue about how many tests have run, and give some chance of deducing
that the tests have hung.

Unless somebody has a compelling counter-argument, I will check in a
patch which makes verbosity level 1 (dots) the default value.  People
who want quiet mode can always pass '-q'.


+1

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Proposal] RFC2396 compatible traversal parameters

2005-10-24 Thread Florent Guillaume
 in place, this other list changes as well.

For an application, it is difficult to work with parameter lists.
Therefore, ``BaseRequest`` gets the new method ``dictifyTraversalParameters``.
It takes a parameter list as argument and returns a parameter dictionary.
It performs the same conversions and assemblies as
``ZPublisher.HTTPRequest.HTTPRequest.processInputs``. To
avoid code duplication, ``processInputs`` is refactored.

After traversal, the request gets a lazy key
``TraversalRequestCollectedParameterDict``. It makes the collected
traversal parameters available as a dictionary.

``BaseRequest`` gets a new method ``physicalPathToURL`` (that
of ``HTTPRequest`` is modified accordingly). It checks whether an object
on the path defines a ``__traversal_parameter_creation_hook__``.
If so, it is called with the request as argument and can determine
the path segment corresponding to this object. This allows
``absolute_url`` and friends to add request parameters to created
URLs. There remain some open questions with respect to virtual hosting.
I prefer that the URL parts corresponding to the virtual host
cannot be modified by traversal parameters during URL construction.





--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Mountpoints

2005-10-21 Thread Florent Guillaume

Tim Peters wrote:

I think it's worse, but mostly because a key with name name is also
an option in _related_ sections, but with unrelated meaning.  For
example, if you had a nested zeoclient section there it could also
have specified a name key, which would have nothing to do with the
zodb key named name.  Nesting options with the same name gets
confusing quickly.  OTOH, I would like the explicit key better if it
had a different name, say

zodb
  multidb-name main
  filestorage
path $DATADIR/Data.fs
  /filestorage
/zodb
zodb
  multidb-name a
  filestorage
path $DATADIR/A.fs
  /filestorage
/zodb


Yes, please. There is already confusion for cache-size, let's not repeat 
that with another key. Note that database-name is more expressive, I think 
(the multi seems like an implementation detail to me).


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Collector #1926: fixed a typo in _doAddUser when password encryption is

2005-10-20 Thread Florent Guillaume
Log message for revision 39540:
  Collector #1926: fixed a typo in _doAddUser when password encryption is
  enabled.
  
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-20 15:07:29 UTC 
(rev 39539)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-21 00:06:17 UTC 
(rev 39540)
@@ -22,6 +22,13 @@
 
- Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
+  After Zope 2.8.3
+
+Bugs Fixed
+
+  - Collector #1926: fixed a typo in _doAddUser when password
+encryption is enabled.
+
   Zope 2.8.3 (2005/10/18)
 
 Other

Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py  
2005-10-20 15:07:29 UTC (rev 39539)
+++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py  
2005-10-21 00:06:17 UTC (rev 39540)
@@ -1045,7 +1045,7 @@
 def _doAddUser(self, name, password, roles, domains, **kw):
 Create a new user
 if password is not None and self.encrypt_passwords \
-   and not self._isPasswordEncrypted(pw):
+   and not self._isPasswordEncrypted(password):
 password = self._encryptPassword(password)
 self.data[name]=User(name,password,roles,domains)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope] Re: inheriting from SimpleUserFolder's User

2005-10-20 Thread Florent Guillaume

Jürgen Herrmann wrote:

[ 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?


That's done by OFS.ObjectManager._setObject.

Florent

--
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 )


[Zope] Re: implicit vs. explicit ownership?

2005-10-20 Thread Florent Guillaume

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.


Florent

--
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 )


[Zope] Re: inheriting from SimpleUserFolder's User

2005-10-19 Thread Florent Guillaume

Jürgen Herrmann wrote:

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)?


Actually all third-party userfolders I know of reimplement allowed() in 
terms of calling getRolesInContext().


Florent

--
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 )


[Zope] Re: Testing products: Testing all in one batch

2005-10-05 Thread Florent Guillaume

Paul Winkler wrote:

- Some third-party products (e.g. CMF) ship with tests that just plain
  fail.
  If I install CMF 1.4.8 and nothing else, and run ./bin/zopectl test,
  I get 1 error and 1 failure.  This is a bit surprising from a stable
  release, I'd expect not to get any... will forward those to the CMF
  list and follow up there, if there are not already issues filed for
  these.


CMF 1.4 tests were not designed to be run through bin/zopectl test.
This was changed in CMF 1.5.

Florent

--
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 )


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ The '@' character is now allowed in object ids (RFC 1738 allows it).

2005-10-04 Thread Florent Guillaume
Log message for revision 38738:
  The '@' character is now allowed in object ids (RFC 1738 allows it).
  Expanded tests for _checkId.
  
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py
  U   Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-04 10:06:48 UTC 
(rev 38737)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-04 11:02:52 UTC 
(rev 38738)
@@ -29,6 +29,8 @@
   - Collector #1118: Added syntax to dtml-sqlgroup to support flexible
 generation of 'UPDATE' statements (bounty sponsored by Logicalware).
 
+  - The '@' character is now allowed in object ids (RFC 1738 allows it).
+
 Bugs Fixed
 
   - Collector #1863: Prevent possibly sensitive information to leak via

Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py   
2005-10-04 10:06:48 UTC (rev 38737)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py   
2005-10-04 11:02:52 UTC (rev 38738)
@@ -49,7 +49,7 @@
 XMLExportImport.magic: XMLExportImport.importXML,
 }
 
-bad_id=re.compile(r'[^a-zA-Z0-9-_~,.$\(\)# ]').search #TS
+bad_id=re.compile(r'[^a-zA-Z0-9-_~,.$\(\)# @]').search
 
 def checkValidId(self, id, allow_dup=0):
 # If allow_dup is false, an error will be raised if an object

Modified: 
Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py 
2005-10-04 10:06:48 UTC (rev 38737)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py 
2005-10-04 11:02:52 UTC (rev 38738)
@@ -303,6 +303,41 @@
 om2._setObject(ob.getId(), ob)
 self.assertRaises(DeleteFailed, om1._delObject, 'om2')
 
+def test_setObject_checkId_ok(self):
+om = self._makeOne()
+si = SimpleItem('1')
+om._setObject('AB-dash_under0123', si)
+si = SimpleItem('2')
+om._setObject('ho.bak~', si)
+si = SimpleItem('3')
+om._setObject('dot.comma,dollar$(hi)hash# space', si)
+si = SimpleItem('4')
+om._setObject('[EMAIL PROTECTED]', si)
+si = SimpleItem('5')
+om._setObject('..haha', si)
+si = SimpleItem('6')
+om._setObject('.bashrc', si)
+
+def test_setObject_checkId_bad(self):
+from zExceptions import BadRequest
+om = self._makeOne()
+si = SimpleItem('111')
+om._setObject('111', si)
+si = SimpleItem('2')
+self.assertRaises(BadRequest, om._setObject, 123, si)
+self.assertRaises(BadRequest, om._setObject, 'a\x01b', si)
+self.assertRaises(BadRequest, om._setObject, 'a\\b', si)
+self.assertRaises(BadRequest, om._setObject, 'a:b', si)
+self.assertRaises(BadRequest, om._setObject, 'a;b', si)
+self.assertRaises(BadRequest, om._setObject, '.', si)
+self.assertRaises(BadRequest, om._setObject, '..', si)
+self.assertRaises(BadRequest, om._setObject, '_foo', si)
+self.assertRaises(BadRequest, om._setObject, 'aq_me', si)
+self.assertRaises(BadRequest, om._setObject, 'bah__', si)
+self.assertRaises(BadRequest, om._setObject, '111', si)
+self.assertRaises(BadRequest, om._setObject, 'REQUEST', si)
+self.assertRaises(BadRequest, om._setObject, '/', si)
+
 def test_suite():
 suite = unittest.TestSuite()
 suite.addTest( unittest.makeSuite( ObjectManagerTests ) )

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Zope 2 trunk OFS tests failing

2005-10-04 Thread Florent Guillaume
The OFS.testObjectManager tests are failing when run in isolation on  
the Zope 2 trunk (also on the 2.8 branch). Any idea? I'll look at it  
anyway, but if someone's seen this already...


bin/zopectl test -v --libdir lib/python --dir lib/python/OFS  
testObjectManager

EF.
==
ERROR: test_delObject_exception_debug_manager  
(OFS.tests.testObjectManager.ObjectManagerTests)

--
Traceback (most recent call last):
  File /Users/fguillaume/zope/zope2/lib/python/OFS/tests/ 
testObjectManager.py, line 290, in  
test_delObject_exception_debug_manager

om._delObject(ob.getId())
  File /Users/fguillaume/zope/zope2/lib/python/OFS/ 
ObjectManager.py, line 350, in _delObject

if not getSecurityManager().getUser().has_role('Manager'):
AttributeError: 'NoneType' object has no attribute 'has_role'

==
FAIL: test_setObject_set_owner_with_emergency_user  
(OFS.tests.testObjectManager.ObjectManagerTests)

--
Traceback (most recent call last):
  File /Users/fguillaume/zope/zope2/lib/python/OFS/tests/ 
testObjectManager.py, line 104, in  
test_setObject_set_owner_with_emergency_user

, om._setObject, 'should_fail', si )
  File /usr/local/lib/python2.3/unittest.py, line 295, in  
failUnlessRaises

raise self.failureException, excName
AssertionError: EmergencyUserCannotOwn

--
Ran 19 tests in 0.077s

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope 2 trunk OFS tests failing

2005-10-04 Thread Florent Guillaume

Correction: it works on the 2.8 branch, but not the trunk.

Florent


On 4 Oct 2005, at 12:38, Florent Guillaume wrote:

The OFS.testObjectManager tests are failing when run in isolation  
on the Zope 2 trunk (also on the 2.8 branch). Any idea? I'll look  
at it anyway, but if someone's seen this already...


bin/zopectl test -v --libdir lib/python --dir lib/python/OFS  
testObjectManager

EF.
==
ERROR: test_delObject_exception_debug_manager  
(OFS.tests.testObjectManager.ObjectManagerTests)

--
Traceback (most recent call last):
  File /Users/fguillaume/zope/zope2/lib/python/OFS/tests/ 
testObjectManager.py, line 290, in  
test_delObject_exception_debug_manager

om._delObject(ob.getId())
  File /Users/fguillaume/zope/zope2/lib/python/OFS/ 
ObjectManager.py, line 350, in _delObject

if not getSecurityManager().getUser().has_role('Manager'):
AttributeError: 'NoneType' object has no attribute 'has_role'

==
FAIL: test_setObject_set_owner_with_emergency_user  
(OFS.tests.testObjectManager.ObjectManagerTests)

--
Traceback (most recent call last):
  File /Users/fguillaume/zope/zope2/lib/python/OFS/tests/ 
testObjectManager.py, line 104, in  
test_setObject_set_owner_with_emergency_user

, om._setObject, 'should_fail', si )
  File /usr/local/lib/python2.3/unittest.py, line 295, in  
failUnlessRaises

raise self.failureException, excName
AssertionError: EmergencyUserCannotOwn

--
Ran 19 tests in 0.077s

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]






--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Allowing @ in object ids

2005-10-04 Thread Florent Guillaume

Checked in for 2.8 and trunk:
http://svn.zope.org/Zope/?view=revrev=38738

Florent

Florent Guillaume wrote:
Today @ is forbidden in object ids. That's controlled by the bad_id  
regexp in OFS.ObjectManager, which tries to ensure that ids will be  
useable as URL components.


However, there's no reason to disallow this, as the URL spec (http:// 
www.ietf.org/rfc/rfc1738.txt) says:


   An HTTP URL takes the form:
  http://host:port/path?searchpart
   [...]
   Within the path and searchpart components, /, ;, ? are
   reserved.  The / character may be used within HTTP to designate a
   hierarchical structure.

Note that somewhere else in the spec, it says that @ (and others) MAY  
be reserved by some schemes, but HTTP doesn't actually make it reserved.


Furthermore, many projects have monkey-patched bad_id to allow @ and  
see no ill-effects.
Having @ in ids is very useful for various things, one of them being  to 
have email-like identifiers (think jabber for instance). There are  
other uses.


Unless there's opposition, I'll change the code to allow it.

Florent




--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] log levels

2005-10-04 Thread Florent Guillaume
Now in Zope 2 trunk, more and more components use the standard python  
logging framework.


For instance the transaction code logs at DEBUG level every  
transaction start and end (self.log.debug(...)). This makes the logs  
very verbose, and any other code I write that logs at DEBUG level  
gets drowned in it. Previously transaction logs were at TRACE level  
but this doesn't exist anymore, and the python logging framework  
doesn't have anything between INFO and DEBUG or below DEBUG.


I don't have a solution really, I can log at level BLATHER and limit  
my logs at that, but that's not very satisfying. And if zLOG is  
deprecated I'd rather avoid it.


Any idea?

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]



___
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] Re: Aquisition, UserFolder and security

2005-09-30 Thread Florent Guillaume

bruno modulix wrote:

Dieter, I didn't misunderstood your proposed solution. But some users
exist in different CPMs with different roles in each CPM. So - unless
I'm totally at lost with how Zope's security works - if User1 has role
RoleWithMuchPrivileges in Cpm1 and role RoleWithFewPrivileges in Cpm2,
he could gain RoleWithMuchPrivileges in Cpm2 just by using faked url
cpm1/cpm2/whatever_he_should_not_access_here. Worse, anyone existing in
any CPM could gain access to any other CPM just by faking url.


As Tres mentionned, that should not be possible, as it's contrary to the 
Zope Security Policy.


Can you reproduce it within a blank CPS instance using standard CPS 
products? If yes, could you explain the steps to reproduce it, and the 
versions of CPS, CMF, Zope and python you use?


Florent

--
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 )


[Zope-dev] Re: Strange security issue with Zope 2.8.1

2005-09-29 Thread Florent Guillaume

Jens Vagelpohl wrote:
I have found a strange security issue with Zope 2.8.1 that seems to  
stem from code not doing what it was supposed to do in Zope 2.7.x,  but 
which works in 2.8.1 and then causes other side effects in code  that 
relied on the broken behavior.


Symptom: In Zope 2.8.1 it is *impossible* to override a  
ClassSecurityInfo security declaration in an Archetypes-derived  content 
item. (I have a small set of unit tests that proves the  behavior under 
Zope 2.8.1 if anyone is interested)


A little background: When you register an Archetypes-derived content  
type, it will do all the generated accessor/setter method magic and  
then call InitializeClass a second time.


The code in lib/python/App/class_init.py has changed between Zope  2.7.x 
and Zope 2.8 in order to support new-style classes. To be more  precise, 
instead of manipulating the class __dict__ directly we now  use 
setattr/delattr/etc. This change seems to have un-broken code  which 
did not do what the code comments suggest. Namely, when a class  is sent 
through class_init.default_class_init__ (better known as  
Globals.InitializeClass) the class __dict__ is searched to find  objects 
that look like ClassSecurityInfo instances in order to read  and apply 
the security settings. After finding the ClassSecurityInfo  instance, it 
is force-deleted from the object (the comments say, out  of paranoia). 
However, somehow this did not work correctly in Zope  2.7.x, where the 
deletion call looked like...


del dict[key]

(dict being the class __dict__, and key being the name of the  
ClassSecurityInfo instance). Under Zope 2.8, it looks like this:


delattr(self, key)

(self being the class object).

Under Zope 2.7, the security object *would still be there* when  hitting 
InitializeClass for the second time via Archetypes'  registerType, which 
in turn meant Archetypes would not instantiate  its own 
ClassSecurityInfo instance and stuff it with the declarations  from 
whatever Archetypes-derived base class you used.


In Zope 2.8, the deletion actually works as intended - but due to  that 
fact Archetypes will instantiate its own ClassSecurityInfo and  populate 
it with the declarations from the base class that I am  trying to 
override. So the overridden settings are all overwritten  again by the 
base class declaration.


My question is, what is the reasoning behind deleting the  
ClassSecurityInfo object from the class after it has been read the  
first time? How can this be implemented in a sane way so that custom  
security declarations can be retained?


My understanding (and the way we use it when monkey patching for instance) 
is that whenevery you apply new security to a class, you create a new 
ClassSecurityInfo on it. It only defines new stuff to do. The real 
synthesized security is still stored in __ac_permissions__.


class C(SimpleItem):
security = ClassSecurityInfo()
security.declareProtected(...)
def foo(): ...

InitializeClass(C)

then later on:

security = ClassSecurityInfo()
C.security = security
security.declareProtected(...)
C.newmethod = something
InitializeClass(C)

Anyway that's what I do. I never relied on a preexisting C.security.

Florent


--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] inheritedAttribute - super

2005-09-27 Thread Florent Guillaume
Is there any problem if I change current Zope 2 trunk uses of  
inheritedAttribute into calls to super ?


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
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] Re: Parse a XML file in Zope, zopeXMLmethods Product not working in Zope 2.8.1

2005-09-27 Thread Florent Guillaume
Dieter Maurer  [EMAIL PROTECTED] wrote:
 Martin Koekenberg wrote at 2005-9-26 15:57 +0200:
  ...
 Does annyone knows a Product of method to parse xml in Zope without the 
 zopeXMLmethods product ?
 
 You can use any of the methods for XML parsing supported by Python, among
 others
 
   *  MiniDOM
 
   *  [c]ElementTree
 
   *  SAX
 
   *  pyexpat
 
   *  sgmlop
 
   *  libxml2

Also, lxml (pythonic bindings based on ElementTree API for libxml2),
which is quickly becoming the reference for Zope work.

Florent

-- 
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 )


[Zope-dev] Re: SVN: Zope/branches/Zope-2_8-branch/ - Collector #1879: applied patch by Dieter Maurer to fix a bug in

2005-09-26 Thread Florent Guillaume
This is the kind of thing that would *really* benefit from having unit
tests...

Florent


Andreas Jung  [EMAIL PROTECTED] wrote:
 Log message for revision 38586:
 - Collector #1879: applied patch by Dieter Maurer to fix a bug in 
   ac_aquire() ignoring the default argument
   
 
 Changed:
   U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
   U   Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
 
 -=-
 Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
 ===
 --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:01:37 UTC
 (rev 38585)
 +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:10:07 UTC
 (rev 38586)
 @@ -31,6 +31,9 @@
  
  Bugs Fixed
  
 +  - Collector #1879: applied patch by Dieter Maurer to fix a bug in 
 +ac_aquire() ignoring the default argument
 +
- Collector #1864, #1906: fixed header normalization in appendHeader()
  
- Collector #1899: fixed migration issue when using export/import for
 
 Modified: Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
 ===
 --- Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
 2005-09-24 12:01:37 UTC (rev 38585)
 +++ Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
 2005-09-24 12:10:07 UTC (rev 38586)
 @@ -1059,6 +1059,7 @@
PyObject *expl=0, *defalt=0;
int explicit=1;
int containment=0;
 +  PyObject *result; /* DM 2005-08-25: argument default ignored */
  
UNLESS (PyArg_ParseTupleAndKeywords(
args, kw, O|i, acquire_args+1,
 @@ -1070,12 +1071,34 @@
  
if (filter==Py_None) filter=0;
  
 +  /* DM 2005-08-25: argument default ignored -- fix it! */
 +# if 0
return Wrapper_findattr(self,name,filter,extra,OBJECT(self),1,
 explicit || 
 self-ob_type==(PyTypeObject*)Wrappertype,
 explicit, containment);
 +# else
 +  result = Wrapper_findattr(self,name,filter,extra,OBJECT(self),1,
 +   explicit || 
 +   self-ob_type==(PyTypeObject*)Wrappertype,
 +   explicit, containment);
 +  if (result == NULL  defalt != NULL) {
 +/* as Python/bltinmodule.c:builtin_getattr turn
 +   only 'AttributeError' into a default value, such
 +   that e.g. ConflictError and errors raised by the filter
 +   are not mapped to the default value.
 +*/
 +if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
 +  PyErr_Clear();
 +  Py_INCREF(defalt);
 +  result = defalt;
 +}
 +  }
 +  return result;
 +# endif
  }
  
 +
  static PyObject *
  Wrapper_inContextOf(Wrapper *self, PyObject *args)
  {


-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Allowing @ in object ids

2005-09-15 Thread Florent Guillaume
Today @ is forbidden in object ids. That's controlled by the bad_id  
regexp in OFS.ObjectManager, which tries to ensure that ids will be  
useable as URL components.


However, there's no reason to disallow this, as the URL spec (http:// 
www.ietf.org/rfc/rfc1738.txt) says:


   An HTTP URL takes the form:
  http://host:port/path?searchpart
   [...]
   Within the path and searchpart components, /, ;, ? are
   reserved.  The / character may be used within HTTP to designate a
   hierarchical structure.

Note that somewhere else in the spec, it says that @ (and others) MAY  
be reserved by some schemes, but HTTP doesn't actually make it reserved.


Furthermore, many projects have monkey-patched bad_id to allow @ and  
see no ill-effects.
Having @ in ids is very useful for various things, one of them being  
to have email-like identifiers (think jabber for instance). There are  
other uses.


Unless there's opposition, I'll change the code to allow it.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
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] Re: Using Structured Text and HTML-quote together for RSS 2.0

2005-09-09 Thread Florent Guillaume

Jonathan Cyr wrote:
That's the ticket.  You're right the CDATA solution is much better than 
html-quote'ing everything.


Many thanks,

-Jon

Peter Bengtsson wrote:


Create a python script called rssFormatter(text)::

from Products.PythonScripts.standard import structured_text, html_quote
return html_quote(structured_text(text))

Which you use later as dtml-var rssFormatter(summary)

I think for some of my RSS feeds I use CDATA, so _my_ rssFormatter()
script looks something like this::

return ![CDATA[%s]] % text

The advantage with CDATA is that you won't need to html quote things.


Which is not really true, you still have to find a way to deal with your 
string if it contains ']]' which is the end marker for CDATA.


Florent

--
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 )


[Zope] Re: ERROR(200) KeywordIndex unindex_object could not remove documentId -702398584 from index workitems_from. This should not happen.

2005-09-09 Thread Florent Guillaume

Marco Bizzarri wrote:

We are seeing traceback in the event log like this:

2005-09-09T09:28:32 ERROR(200) KeywordIndex unindex_object could not remove 
documentId -702398584 from index w

orkitems_from. This should not happen.
Traceback (most recent call last):
File 
/home/zope/zope-2.7.4/lib/python/Products/PluginIndexes/common/UnIndex.py,
line 185, in removeForward
IndexEntry
indexRow.remove(documentId)
File /home/zope/zope-2.7.4/lib/python/ZODB/Connection.py, line 599, in 
setstate

invalid = self._is_invalidated(obj)
File /home/zope/zope-2.7.4/lib/python/ZODB/Connection.py, line 628, in 
_is_invalidated

raise ReadConflictError(object=obj)
ReadConflictError: database read conflict error (oid 0x38f00c, class 
BTrees.IIBTree.IISet)


What is the meaning of the first line? Is it something we should worry 
about? (workitems_from is an index of the ZCatalog, of course).


This spurious error message has been fixed in Zope 2.7.7 last July 
(http://www.zope.org/Collectors/Zope/1832).

Florent


--
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 )


[Zope] Re: Images too (StructuredDocument size limit reduced after 2.5.1 to 2.7.5 upgrade)

2005-09-07 Thread Florent Guillaume
As Dieter already said, this is due to you having cgi-maxlen or 
http-header-max-length (when using GET) set too low in etc/zope.conf.


Florent

John Schinnerer wrote:

Aloha,

OK, it's not just StructuredDocument objects, Image objects have the
same problem, anything over about ~5-8K gets the same error message. 
Probably everything will, those are just the ones that have emerged

first for me...

Does anyone know what could be causing this?
If it's some new configuration option(s) for 'content length' in 2.7.5,
where the heck do I find and tweak them?
I don't see anything in the ZMI that would affect this, don't know
where else to look.

thanks,
John S.



To recap, my server was upgraded from zope 2.5.1 to 2.7.5 and now
StructuredDocument objects in a product I have built have a rather
small limit (about 4-6K) on how much content can be put into them.
The content is being put into them from content in a web form text
area
using a call like

self.some-structured-document-object.manage_edit(REQUEST.stx-content,
'Name of Content')

Nothing in the product was touched/changed, just the zope upgrade.

The error message now returned in the browser window when I try and
update a structured document with more than ~4-6K of content via web
form is this:

--

Site Error

An error was encountered while publishing this resource.

Error Type: ValueError
Error Value: Maximum content length exceeded

Troubleshooting Suggestions

   * The URL may be incorrect.
   * The parameters passed to this resource may be incorrect.
   * A resource that this resource relies on may be encountering an
error.

For more detailed information about the error, please refer to the
error log.

If the error persists please contact the site maintainer. Thank you
for
your patience. 


--

This error is *not* showing up in the error log viewable from the
root
of the zope instance.

thanks,
John S.






--
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 )


[Zope] Re: Defining and creating a temporary storage for each user

2005-09-06 Thread Florent Guillaume

Marco Bizzarri wrote:

Florent, thanks for your suggestion.

Could you point me on more detailed information about this topic (i.e. how 
object stored in ZODB are actually managed)?


I don't know of any document explaining that.

Is this more a ZODB mailing list question than Zope? Should I directly point 
to ZODB documentaiton?


It's definitely for the ZODB mailing-list, yes.

Florent

--
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 )


[Zope] Re: Zope scalabilty and problems

2005-09-05 Thread Florent Guillaume

Dieter Maurer wrote:



I am setting up sites using Plone and am concerned to read some of the
comments on it. Is it really that bad performance wise?



No, it is not.

It is just that the CMF is unable to fix a year long bug


It's not CMF's fault, it's only the responsibility of Windows developers 
running CMF. I for one couldn't care less.



which affects Windows only when Zope is run in debug mode:

  then each access to a filesystem directory view triggers
  a hierarchical file system scan.

  The result is a slowdown by several orders of magnitude.


I believe Tres has now fixed this.

Florent

--
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 )


[Zope] Re: Defining and creating a temporary storage for each user

2005-09-05 Thread Florent Guillaume

Marco Bizzarri wrote:
You mean mantaining just in the memory... uhmmm I should double check 
with the fact that the object in memory should mantain some reference to an 
object on the ZODB... which should be no problem at all.


Beware, an object stored in the ZODB cannot be used by another connection to 
the database. That means, by another thread, in the most common case. Except 
if you're very sure about what you're doing, the only kinds of references to 
persistent objects you should have in memory are their paths.


Florent

--
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 )


[Zope] Re: upgrade 2.5.1 to 2.7.5 causes error in product code

2005-08-31 Thread Florent Guillaume

John Schinnerer wrote:

Hello,

Thanks Tres, looks like zope 2.7.5/python 2.3.5 is triggering a genuine
full-blown error on my code

python:here.sponsors[0] != ''

if the tuple is empty, whereas 2.5.1/2.1.3 must have been returning
some equivalent of boolean 'false' when the tuple was empty.

Now I do this

python: (here.sponsors) and (here.sponsors[0] != '')

and it works again.
The second condition may be redundant now I suppose...?



Yes in earlier Zopes, changing a lines property in the ZMI to empty still 
resulted in ('',) instead of (). This has been fixed since.


Florent

--
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 )


[Zope-dev] Re: Catalog and Unicode

2005-08-11 Thread Florent Guillaume

Dieter Maurer wrote:

Florent Guillaume wrote at 2005-8-9 17:18 +0200:

We're seeing problems in one application here due to the catalog and  
interactions with Unicode. Here's what happens:


- an object is indexed with a Unicode title, so in the catalog the  
metadata tuple has for instance (u'cafe',)
- later that title is changed to latin-1, so the new metadata tuple  
would be ('caf\xe9',)


The problem is that Catalog.py has in updateMetadata() the code:

   if data.get(index, 0) != newDataRecord:
   data[index] = newDataRecord
   try:
   changed = data.get(index, 0) != newDataRecord
   except UnicodeDecodeError:
   changed = True
  if changed:
   data[index] = newDataRecord

Objections ?



I fear, you will get similar problems in the indexes.

You should avoid mixed unicode/non-unicode in fields or indexes
(or the the default encoding appropriately).


For indexes I agree, and indeed my example of Title was not ideal. But 
metadata fields can have nothing to do with indexes...


Suppose you're migrating your code from using utf-8 encoded str to unicode. 
You have no way to recatalog the thing, it will blow in updateMetadata...


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Catalog and Unicode

2005-08-09 Thread Florent Guillaume
We're seeing problems in one application here due to the catalog and  
interactions with Unicode. Here's what happens:


- an object is indexed with a Unicode title, so in the catalog the  
metadata tuple has for instance (u'cafe',)
- later that title is changed to latin-1, so the new metadata tuple  
would be ('caf\xe9',)


The problem is that Catalog.py has in updateMetadata() the code:

if data.get(index, 0) != newDataRecord:
data[index] = newDataRecord

The simple comparison in the first line provokes a  
UnicodeDecodeError, you can reproduce by a simple:


python -c u'e' == '\xe9'

This understandable, but in the case of the catalog really not  
helpful. I propose to change the code above to:


try:
changed = data.get(index, 0) != newDataRecord
except UnicodeDecodeError:
changed = True
   if changed:
data[index] = newDataRecord

Objections ?

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: CopySupport, hooks, events

2005-08-08 Thread Florent Guillaume
 bookkeeping, I don't want the event system do screw things up 
behind my back. Note for instance that in CMF reindexObjectSecurity does not 
do recursion like manage_afterAdd does, because it has optimized ways to do 
its job without recursing using objectValues().


So I strongly believe the default event system should send a simple event on 
copy (and I think I'll have to fight to get my way in Zope 3...). Now, if 
something wants to recurse, it's free to do so, and maybe send more events. 
But I want the system to be able to work without that.


Using this system, there could be a default subscriber in OFS/CopySupport.py 
that calls _afterItemCopy on the toplevel object and then does the 
recursion. The *subscriber* does the recursion, not _afterItemCopy.


But we're not there yet (no events in Zope 2), so instead of sending an 
event that's caught by a subscriber that does a recursion, this can be done 
for now by calling directly the code equivalent to the subscriber. Later 
we'll move to the event system. (And it is my hope that we can deprecate 
manage_beforeDelete  al. too.)



So I propose:

def _beforeItemMove(dest_container, dest_path):

Called before an item is moved.

dest_container may be None (since for subobjects, the
destination will not have been created yet).

dest_path is a tuple containing the physical path of
the new container (which may not yet exist).

Returns True if recursion should stop.


def _afterItemMove(source_container, source_path):

Called afer an item has been moved.

source_container may be None (since for subobjects, the
source may have been moved elsewhere).

source_path is a tuple containing the physical path of
the old container (which may no longer exist).

Returns True if recursion should stop.


def _beforeItemCopy(dest_container, dest_path):

Called before an item is copied.

dest_container may be None (since for subobjects, the
destination will not have been created yet).

dest_path is a tuple containing the physical path of
the new container (which may not yet exist).

Returns True if recursion should stop.


def _afterItemCopy(source_object):

Called after an item has been copied.

source_object is the original object.

Returns True if recursion should stop.



Note, I'm not too sure about the source_container and source_object 
parameters, they're quite expensive to maintain. I'd like to see an 
implementation to discuss this.



Florent


--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]

___
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] manage_beforeDelete, BeforeDeleteException and Redirect

2005-08-02 Thread Florent Guillaume
Arthur Lutz  [EMAIL PROTECTED] wrote:
 I'm having a bit of struggle with OFS.ObjectManager in Zope 2.7.6-final.
 In a manage_beforeDelete I want to raise a Redirect but it gets eaten up
 by in ObjectManager by a log and pass (line 307). 
 
 My question is: how do I get a Redirect through or how do I use the
 Exceptions that are actually caught (BeforeDeleteException or
 ConflictError - although the first seems more appropriate) ? 

Raise BeforeDeleteException (or a subclass) in your code in
manage_beforeDelete.

Catch it and act on it from the code that calls manage_delObjects.

Florent

-- 
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 )


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py Additional test. CMF requires this behaviour.

2005-08-01 Thread Florent Guillaume
Log message for revision 37625:
  Additional test. CMF requires this behaviour.
  

Changed:
  U   
Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py

-=-
Modified: 
Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py
===
--- 
Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py   
2005-08-01 15:13:08 UTC (rev 37624)
+++ 
Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py   
2005-08-01 16:02:49 UTC (rev 37625)
@@ -216,7 +216,18 @@
 lst = list(res[0].keys())
 self.assertEqual(lst,results)
 
+def testQueryPathReturnedInResult(self):
 
+index = self._index
+index.index_object(1, Dummy(/ff))
+index.index_object(2, Dummy(/ff/gg))
+index.index_object(3, Dummy(/ff/gg/3.html))
+index.index_object(4, Dummy(/ff/gg/4.html))
+res = index._apply_index({'path': {'query': '/ff/gg'}})
+lst = list(res[0].keys())
+self.assertEqual(lst, [2, 3, 4])
+
+
 def test_suite():
 return unittest.TestSuite((
 unittest.makeSuite(PathIndexTests),

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/Owned.py Display offending line when warning about getOwner(1) deprecation.

2005-08-01 Thread Florent Guillaume
Log message for revision 37633:
  Display offending line when warning about getOwner(1) deprecation.
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/Owned.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/Owned.py
===
--- Zope/trunk/lib/python/AccessControl/Owned.py2005-08-01 20:05:59 UTC 
(rev 37632)
+++ Zope/trunk/lib/python/AccessControl/Owned.py2005-08-01 20:08:03 UTC 
(rev 37633)
@@ -82,7 +82,7 @@
 import warnings
 warnings.warn('Owned.getOwner(1) is deprecated; '
   'please use getOwnerTuple() instead.',
-  DeprecationWarning)
+  DeprecationWarning, stacklevel=2)
 
 
 owner=aq_get(self, '_owner', None, 1)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Packages/AccessControl - Owned.py:1.19.46.5

2005-08-01 Thread Florent Guillaume
Update of /cvs-repository/Packages/AccessControl
In directory cvs.zope.org:/tmp/cvs-serv8

Modified Files:
  Tag: Zope-2_7-branch
Owned.py 
Log Message:
Merge from 37633 on trunk:
Display offending line when warning about getOwner(1) deprecation.


=== Packages/AccessControl/Owned.py 1.19.46.4 = 1.19.46.5 ===
--- Packages/AccessControl/Owned.py:1.19.46.4   Fri Mar 12 11:58:29 2004
+++ Packages/AccessControl/Owned.py Mon Aug  1 16:09:15 2005
@@ -76,7 +76,7 @@
 import warnings
 warnings.warn('Owned.getOwner(1) is deprecated; '
   'please use getOwnerTuple() instead.',
-  DeprecationWarning)
+  DeprecationWarning, stacklevel=2)
 
 
 owner=aq_get(self, '_owner', None, 1)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py Merge from 37625 on trunk:

2005-08-01 Thread Florent Guillaume
Log message for revision 37638:
  Merge from 37625 on trunk:
  
  Additional test. CMF requires this behaviour.
  
  

Changed:
  U   
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py
===
--- 
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py
2005-08-01 20:15:07 UTC (rev 37637)
+++ 
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py
2005-08-01 20:16:54 UTC (rev 37638)
@@ -216,7 +216,18 @@
 lst = list(res[0].keys())
 self.assertEqual(lst,results)
 
+def testQueryPathReturnedInResult(self):
 
+index = self._index
+index.index_object(1, Dummy(/ff))
+index.index_object(2, Dummy(/ff/gg))
+index.index_object(3, Dummy(/ff/gg/3.html))
+index.index_object(4, Dummy(/ff/gg/4.html))
+res = index._apply_index({'path': {'query': '/ff/gg'}})
+lst = list(res[0].keys())
+self.assertEqual(lst, [2, 3, 4])
+
+
 def test_suite():
 return unittest.TestSuite((
 unittest.makeSuite(PathIndexTests),

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/Zope.py Put warning on a single line.

2005-07-27 Thread Florent Guillaume
Log message for revision 37481:
  Put warning on a single line.
  

Changed:
  U   Zope/trunk/lib/python/Zope.py

-=-
Modified: Zope/trunk/lib/python/Zope.py
===
--- Zope/trunk/lib/python/Zope.py   2005-07-27 13:38:39 UTC (rev 37480)
+++ Zope/trunk/lib/python/Zope.py   2005-07-27 13:56:04 UTC (rev 37481)
@@ -20,8 +20,7 @@
 sys.modules['Zope'] = Zope2
 
 import warnings
-warnings.warn(The Zope package has been renamed to Zope2.\n
-  Import of a package named 'Zope' is deprecated\n
-  and will be disabled starting in Zope 2.11.\n
-  ,
+warnings.warn(The Zope package has been renamed to Zope2. 
+  Import of a package named 'Zope' is deprecated 
+  and will be disabled starting in Zope 2.11.,
   DeprecationWarning, stacklevel=2)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Zope.py Put warning on a single line.

2005-07-27 Thread Florent Guillaume
Log message for revision 37482:
  Put warning on a single line.
  

Changed:
  U   Zope/branches/Zope-2_8-branch/lib/python/Zope.py

-=-
Modified: Zope/branches/Zope-2_8-branch/lib/python/Zope.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/Zope.py2005-07-27 13:56:04 UTC 
(rev 37481)
+++ Zope/branches/Zope-2_8-branch/lib/python/Zope.py2005-07-27 13:58:22 UTC 
(rev 37482)
@@ -20,8 +20,7 @@
 sys.modules['Zope'] = Zope2
 
 import warnings
-warnings.warn(The Zope package has been renamed to Zope2.\n
-  Import of a package named 'Zope' is deprecated\n
-  and will be disabled starting in Zope 2.11.\n
-  ,
+warnings.warn(The Zope package has been renamed to Zope2. 
+  Import of a package named 'Zope' is deprecated 
+  and will be disabled starting in Zope 2.11.,
   DeprecationWarning, stacklevel=2)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope] Exception in Zope 2.8.0

2005-07-25 Thread Florent Guillaume
Pascal Peregrina  [EMAIL PROTECTED] wrote:
 Just got this exception at startup :
   File
 /lmn/build/Frontier/20050618/opt/Zope-2.8.0-final/lib/python/ZODB/FileStora
 ge/FileStorage.py, line 1733, in read_index
 if prev:
 NameError: global name 'prev' is not defined
 
 My Data.fs may be corrupted, but this is not the point : looking at the
 source code, I think it should be h.prev and not prev (in the if
 statement).

Tim has already fixed this in the trunk.

Florent

-- 
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 )


Re: [Zope] Traceback Lines for Send Mail Error

2005-07-25 Thread Florent Guillaume
Asad Habib  [EMAIL PROTECTED] wrote:
 Maurer, I am certain that this is a Zope issue that has not been figured
 out as yet. I was even able to connect to my SMTP server via the Terminal
 application on a Mac. Do I have any other options?

You should do a network trace to see what makes the SMTP server puke.

Florent

-- 
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 )


Re: [Zope] Traceback Lines for Send Mail Error

2005-07-25 Thread Florent Guillaume

Please stay on the list.

I meant a real tcp trace, like ethereal.


On 25 Jul 2005, at 16:22, Asad Habib wrote:


Hello. I used traceroute and it did not return any errors.

- Asad


On Mon, 25 Jul 2005, Florent Guillaume wrote:



Asad Habib  [EMAIL PROTECTED] wrote:

Maurer, I am certain that this is a Zope issue that has not been  
figured
out as yet. I was even able to connect to my SMTP server via the  
Terminal

application on a Mac. Do I have any other options?



You should do a network trace to see what makes the SMTP server puke.

Florent




--
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 )


[Zope-Coders] Checkin messages

2005-07-22 Thread Florent Guillaume
If someone does a checkin but is not subscribed with the correct mail  
to the zope-checkins list, the checkin doesn't appear there.


This sucks.
A number of checkins have gone under the radar in the last few months.

Could the checkin lists be changed to allow non-member posts?
Or, if that's too much filtering work because of spam, could the  
generated checkin message come from a fixed [EMAIL PROTECTED] email  
that would be subscribed to the list (but receive no mail)?


Thanks,
Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders


Re: [Zope-Coders] Checkin messages

2005-07-22 Thread Florent Guillaume

On 22 Jul 2005, at 17:09, Tim Peters wrote:

In contrast, the zope-checkins list admin is still listed as Ken
Mannheimer, and I doubt he pays attention to that duty anymore.
Someone else should volunteer to take it over.


Ok I can do that. I'm used to mailman.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders


Re: [Zope-dev] Re: Event Timer Service for Zope 2.8

2005-07-22 Thread Florent Guillaume
Dylan Jay  [EMAIL PROTECTED] wrote:
 Tres Seaver wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Chris' ClockServer removes the need for such a thread, by hooking
  ZServer's mainloop to generate the faux request needed to kick off
  async processing.  A crontab - like schedule can be driven equally
  well from ClockScheduler as from a separate thread.
 
 So what's wrong with including ClockServer in the core or making it 
 easier to install? (ie not having to put packages in the python path 
 which is hard with some hosting arrangements)
 
 And what's the argument against a core scheduler regardless of a clock? 
 Isn't running background tasks a common need amoungst many very 
 different tools and therefore a interstructure issue?

Myself I'm for having ClockServer in the core, if Chris and others agree.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Running unit tests, LOGging errors

2005-07-20 Thread Florent Guillaume
Using Zope 2.8 when I run the unit tests (bin/zopectl test ...) from  
a checkout (make instance), I have none of the LOGged errors  
appearing in the ouput.
However if instead I use make then mkzopeinstance with another  
directory, running the tests make the errors appear in the output.

There are no other differences in my setup.

Anyone know why and where this behaviour is triggered ?

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
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] SQL null to None patch

2005-07-20 Thread Florent Guillaume
Andrew Veitch  [EMAIL PROTECTED] wrote:
 Is there any chance of getting Dieter Maurer's one line patch into  
 the next bug fix release?
 
 http://www.zope.org/Collectors/Zope/556
 
 It would be hugely helpful to us.

It would need some kind of unit tests.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Re: Zope Foundation Update

2005-07-20 Thread Florent Guillaume
Godefroid Chapelle  [EMAIL PROTECTED] wrote:
 There is nothing against the ZF : there is sthing against ZC being the 
 sole owner of the TMs when the current value of it has been established 
 by the community as a whole, especially out of USA.
 
 This is why I support the proposal made by a few members of the 
 community to have the ZF own the TMs and that would give a perpetual 
 license to Zope Corporation to use it.

This is beyond my understanding. ZC created Zope. ZC created the brand.
ZC is called Zope Corp. Why on earth would they relinquish the core
asset that is their trademark and branding? It's theirs. They're giving
the full use of it to the community. What's wrong with that? Why do you
want, require, more?

The current state of what ZC proposes doesn't prevent anyone from doing
anything reasonable.

Give them your hand, and they'll ask for your arm...

Florent

-- 
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 )


Re: [Zope] should stream iterator be used for ZODB-generated string file?

2005-07-20 Thread Florent Guillaume
Petri Savolainen  [EMAIL PROTECTED] wrote:
 We have an application whereby multimegabyte strings, each generated 
 from the contents of several thousands of small objects in ZODB, are 
 downloaded from zope as a CSV files. A particular CSV file is typically 
 downloaded once or twice a day at a maximum.
 
 The major issue is that it takes a long time for the download to start. 
 Would it be possible to use a stream iterator (introduced in zope 2.7.1) 
 or should we simply do chunks of REQUEST.write() ? What are the 
 requirements for using chunked REQUEST.write - do some specific HTTP 
 headers need to be set or does zope take care of it all?

You may need to set the Content-Length yourself, if you want it.
Otherwise REQUEST.write is pretty simple to use.
The only thing is that it ties up a Zope thread during the output.

 Any advice or specific pointers would be appreciated. I've googled all I 
 could find about the stream iterators, serving blobs etc. but all the 
 info seems to be focused on serving large filesystem-based data. I am 
 not sure what parts of that info applies to an use case that involves 
 reading data from ZODB, or if stream iterators make sense for the use 
 case at all.
 
 I guess we could generate a temporary file and then serve that using a 
 stream iterator.

It would still take time to generate the temporary file, though.

 I understand some parts of the zope machinery could 
 perhaps be released faster that way, but I wonder if the benefits are 
 worth the extra step.

If you do it properly you end up handing off the file to the asyncore
machinery which frees your Zope threads to do other more intersting
things than serving bytes.

Florent


-- 
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 )


Re: [Zope] Reg Zope Installation Problem

2005-07-19 Thread Florent Guillaume
praba kar  [EMAIL PROTECTED] wrote:
 I try to install zope 2.7.0.

Stop right here. Zope 2.7.0 is hopelessly outdated. Use Zope 2.7.6.

Florent

-- 
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 )


Re: [Zope] Versioned connectors from ZODB

2005-07-11 Thread Florent Guillaume
ZODB versions are deprecated, unsupported, buggy and hard to use. Don't
use them.

Florent

Etienne Labuschagne  [EMAIL PROTECTED] wrote:
 If I get a versioned connection from the ZODB:
 
 conn = Zope.DB.open(version=myVersion)
 root = conn.root()
 app = root['Application']
 
 # do some stuff
 
 get_transaction().commit()
 conn.close()
 
 Are the changes now in a version?  How do I get those changes rolled
 into the trunk version of the ZODB?  I guess all objects changed in
 the version will now be locked to that version until I apply the
 version changes to the trunk?


-- 
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 )


Re: [Zope] Versioned connectors from ZODB

2005-07-11 Thread Florent Guillaume

Please stay on the list.

On 11 Jul 2005, at 16:19, Mark Barratt wrote:

Florent Guillaume wrote:
ZODB versions are deprecated, unsupported, buggy and hard to use.  
Don't

use them.


Understood. Alternative mechanisms which achieve the same object?


Well that depends on your objective, and you haven't told us what you  
want to do from a functional point of view.


Florent

--
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 )


Re: [Zope] getSecurityManager() vs. AUTHENTICATED_USER

2005-07-09 Thread Florent Guillaume
Peter Bengtsson  [EMAIL PROTECTED] wrote:
 Dieter Maurer [EMAIL PROTECTED] wrote:
  Peter Bengtsson wrote at 2005-7-8 13:24 +0100:
  I've learnt that it's better to use getSecurityManager instead of
  REQUEST.AUTHENTICATED_USER
  because it's more secure. Other than that, what is the difference.
  
  The security manager could be changed (e.g. with newSecurityManager).
  getSecurityManager would report the change but not AUTHENTICATED_USER.
  
 
 newSecurityManager ??
 never heard of that. The __doc__ says
  Set up a new security context for a request for a user 
 
 What is this used for? I'm guessing it's something we use in unittests
 and stuff.

It's used whenever some code has to act as if it was another user.

The only use I find in core Zope code is when a temporary container for
session objects calls its notify method. It does so as an anonymous user
instead of the logged-in one.

But third-party code can use it too. CPS does, for instance.

Florent

-- 
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 )


[Zope-dev] Default ZODB cache size

2005-07-08 Thread Florent Guillaume
How about boosting the default ZODB cache_size to something less  
ridiculous than the default 4000 ?
I propose changing etc/zope.conf.skel to have an explicit value of  
2.


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
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] RAMCacheManager and object size

2005-07-08 Thread Florent Guillaume
The RAMCacheManager does a costly pseudo-pickling of the objects it  
stores to compute their size, but that information is only used in  
the statistics screen.


1. how about not computing size by default?

2. or, how about using the size to have a cache threshold based on  
the size. That would help manage memory consumption better. Has  
anybody done something like that?


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
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] OT: These PHP guys are so funny

2005-07-05 Thread Florent Guillaume
They use buggy eval() in their XMLRPC code, which of course causes  
massive security problems, notably with RSS...


http://www.gulftech.org/?node=researcharticle_id=00088-07022005
http://news.netcraft.com/archives/2005/07/04/ 
php_blogging_apps_vulnerable_to_xmlrpc_exploits.html


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Re: Re: zopectl debug, 2.8.0 local zeo, Data.fs.lock file locking error

2005-07-05 Thread Florent Guillaume
Running zopectl debug runs your normal instance with additional debug
breakpoints and pdb started. So in the same way that you cannot start
the same instance twice, you cannot start your instance and a zopectl
debug at the same time.

Florent

Jeff Kowalczyk  [EMAIL PROTECTED] wrote:
 Chris McDonough wrote:
  If you dont think it's file permissions, one thing this could also be...
  is your data.fs on an NFS partition?  flock doesn't work well on NFS.
 
 This is a local ReiserFS partition. The zope and zeo are on the local
 machine, communicating over port .
 
 I just checked, and it is not the 'zopectl debug' that fails, it is the
 second connection to the running zeo; if you run zopectl debug first, that
 starts, and the normal zope service will fail instead.
 
 I just did a chmod 666 Data.fs.lock
 -rw-rw-rw-  1 zope zope   6 Jul  4 22:15 Data.fs.lock
 
 And to my surprise, that doesn't change the second zeo connection problem,
 either.


-- 
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 )


Re: [Zope] About Zope 2.7.7

2005-07-05 Thread Florent Guillaume
Pascal Peregrina  [EMAIL PROTECTED] wrote:
 I just finished upgrading our production servers to Zope 2.8.0 (from Zope
 2.7.6)
 Today I noticed that Zope 2.7.7 is under development... and it contains some
 interesting bug fixes (the one concerning if modified since header handling
 for example).

If you notice a bug fixed in 2.7.* but not in 2.8.* then it's an
oversight by the bug fixer, or a regression. Please report it to this
list or in the collector.

Florent

-- 
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 )


Re: [Zope-dev] 2.9 goals

2005-07-04 Thread Florent Guillaume
Martijn Faassen  [EMAIL PROTECTED] wrote:
  Here's something else that would be nice: PAS.
  
  Maybe not right at this moment... but I would like to see that, too.
 
 I wonder whether it's possible to expose zope 3's authentication system 
 to Zope 2, though that may be too much of a mismatch between security 
 systems.

Yeah this crossed my mind too. I'll look at it at some point, it doesn't
strike me as overly complex.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Weird proxy role behaviour

2005-07-04 Thread Florent Guillaume
Andreas Jung  [EMAIL PROTECTED] wrote:
 I created a PyScript through the ZMI:
 
 from AccessControl import getSecurityManager()
 print getSecurityManager().getUser().getRoles()
 print getSecurityManager().getUser().getRolesInContext(context)
 return printed
 
 The script has the proxy role 'Manager'.
 
 When I call the script as Anyonmous User then the output is always
 ('Anonymous',) for both calls. This happens with Zope 2.7.0, 2.7.6 and Zope 
 2.8.0. Shouldn't I see the Manager role in the output or am I just 
 brain-dead today?

Proxy roles are designed to provide additional rights to the restricted
python machinery executing some Python Script or DTML. They don't
propagate to the code called by them.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] 2.9 goals

2005-07-01 Thread Florent Guillaume
Chris McDonough  [EMAIL PROTECTED] wrote:
 I'd like to propose/sponsor/promise-to-finish the following for
 inclusion in 2.9.  If anyone has fears/doubts/problems with specific
 things, please let me know.  I can also start a 2.9 project on the wiki
 with this info; if other folks have features they want, maybe they can
 post them here and we can put together a release plan.
 
 Definitely:
 
 - Chris Theune's blob support for ZODB (currently on the
   ctheune-blobsupport branch in ZODB's SVN repo)

+1 !

 - Speed up large PUTs: 
   http://mail.zope.org/pipermail/zope-dev/2005-April/024617.html

+1

 - Implement RESPONSE.isClientConnected() to be able to tell if
   the client that made the request is still connected (allow
   long-running app code the possibility to abort processing
   if it notices the client is not connected).

Nice, I can see the use for that too.

 Maybe:
 
 - Include ClockServer: http://plope.com/software/ClockServer

+10 on it, something like that has really been needed for ages.

 - ZODB connection policies, which will allow you to associate
   a thread pool with a particular set of ZServer servers.
   This will allow sites which are having resource exhaustion problems
   (e.g. running out of threads, running out of database connections) to
   continue to be accessible via servers running on special ports for
   debugging and maintenance purposes.  It should also allow site admins
   to associate a particular thread pool with connections from spiders
   and other cache-busters by associating particular user agents
   or other request parameters with a thread pool.
   Work towards this was done on the chrism-zserver-connection-policies-branch
   branch in CVS a while back.  See
 http://cvs.zope.org/Zope/lib/python/ZServer/?only_with_tag=chrism-zserver-connection-policies-branch

Nice too.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] 2.9 goals

2005-07-01 Thread Florent Guillaume
Chris McDonough  [EMAIL PROTECTED] wrote:
 I'd like to propose/sponsor/promise-to-finish the following for
 inclusion in 2.9.

Here's something else that would be nice: PAS.

Although it hasn't been tested much, so we should include it as early as
possible in the 2.9 cycle (i.e., why not now ? :)

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Problems with PageTemplates on Zope 2.8

2005-06-25 Thread Florent Guillaume
Morten W. Petersen [EMAIL PROTECTED] wrote:
 I have an application called the Issue Dealer which I'm porting to Zope
 2.8.  However, whenever I try to access a PageTemplate which makes use
 of a page template macro it just hangs and consumes all available CPU.
 
 Any ideas what could be wrong here, or how I could debug it?

Use DeadlockDebugger.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] automagic reindexing of objects

2005-06-22 Thread Florent Guillaume
Have a look at how CPS uses this hook to delay indexing to the end of  
the transaction.


Code is at http://svn.nuxeo.org/trac/pub/file/CPSCore/trunk/ 
IndexationManager.py


Then in all objects for which we want to delay indexing, we replace  
the reindexObject() method with:


def reindexObject(self, idxs=[]):
Schedule object for reindexation

get_indexation_manager().push(self, idxs=idxs)

And the IndexationManager calls _reindexObject at the end of the  
transaction.


This is done for instance in http://svn.nuxeo.org/trac/pub/file/ 
CPSCore/trunk/ProxyBase.py


Florent


On 22 Jun 2005, at 14:58, Jürgen Herrmann wrote:


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



--
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 )


Re: [Zope] Getting information about current method

2005-06-20 Thread Florent Guillaume
Peter Bengtsson  [EMAIL PROTECTED] wrote:
 On 6/17/05, Jan-Ole Esleben [EMAIL PROTECTED] wrote:
  It's an application instance wrapped in a list; it seems to be
  identical to self, actually - self.REQUEST['URL'] and
  self.REQUEST.PARENTS[0].REQUEST['URL'] are the same. However, the two
  REQUESTs are not the identical object (== returns False).
  
 
 Then I don't know. 
 (The application instance is none other than zope itself. )
 I can honestly not think of a way to extract this information. I've
 even tried setting up a simple example method and I couldn't get hold
 of the zodb name of the external method that is called.

You can go the low-level route: Using the inspect module, you can get to
the stack frames of your callers, and then inspect the local variables
there. There must be one that can get you the information you want.

See the docstrings of the functions in the inspect module for details.

Florent

-- 
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 )


Re: [Zope] automagic reindexing of objects

2005-06-20 Thread Florent Guillaume
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 )


Re: [Zope-dev] Zope 2.9 goals

2005-06-17 Thread Florent Guillaume
  Just an idea: 
  One thing that would be interesting and increase the Z3 compatibility
  is to use traversing adapters, and then, of course, make a default
  adapter that implements Zope2 traversing for objects that does not
  have a traversing adapter.
  
  Stupid or brilliant? :)
 
 I know Florent had some ideas of doing this integration too. It's an 
 interesting idea.
 
 That said, I don't think we should add this to Zope 2.9, unless a 
 developer gets really enthusiastic in the near future and takes 
 responsibility for this.

My idea was to do a big cleanup of Zope 2's traversal mechanisms. The
problem is that it will by necessity get rid some of the idiosyncrasies
(read: cruft and incoherences) of the current one, and in the process
probably break stuff. Which means it has to be optional, which adds even
more complexity to the code :( So in the end the realities of backward
compatibility are a big hurdle.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Verbose security for Zope 2.8 or 2.9

2005-06-16 Thread Florent Guillaume
Shane Hathaway  [EMAIL PROTECTED] wrote:
 Florent Guillaume wrote:
  What is the dependency on the python implementation, is it just
  _embed_permission_in_roles ? Didn't you succeed in patching the C
  version too in some earlier versions of VerboseSecurity ?
 
 Currently, the C code makes no attempt to raise verbose errors.  I've
 never patched the C code, although I doubt it would be very difficult.
 (Perhaps you're referring to previous monkey patches that replaced a
 method implemented in C with a Python version.)

Yes that must have been that.

Florent

 Anyone familiar with the security machinery is welcome to give it a
 shot. :-)

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Verbose security for Zope 2.8 or 2.9

2005-06-15 Thread Florent Guillaume
 I've written a patch against the Zope trunk that integrates the
 functionality of the VerboseSecurity product into the Zope core.

Excellent, thanks.

 To enable verbose security, apply the patch, recompile and reinstall
 using make, then add the following lines to etc/zope.conf:
 
   security-policy-implementation python
   verbose-security on

What is the dependency on the python implementation, is it just
_embed_permission_in_roles ? Didn't you succeed in patching the C
version too in some earlier versions of VerboseSecurity ?

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Re: undo many things

2005-06-15 Thread Florent Guillaume
Rakotomandimby (R12y) Mihamina [EMAIL PROTECTED] wrote:
 J Cameron Cooper [EMAIL PROTECTED] :
  Also, can you not just undo one page at a time? I don't generally try
  undoing anything too far off as a rule, since I don't expect it to work.
 
 No, It was a CPS upgrade.
 The concerned object is the CPS site.
 
 I made the update, then we saw that we had to undo it, because some
 documents behaved wrong. You can guess we made many test before deciding
 to undo the upgrade. So we have to get back far in the past... very far...
 
 Four pages.
 
 I dont know how to use script as Dieter suggested. 
 Is there any tips to start? 

Change the occurences of 20 in lib/python/App/Undo.py into something bigger.

Florent

-- 
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 )


Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1792: applied patch for broken ZClasses

2005-06-13 Thread Florent Guillaume
 Modified: Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py
 ===
 --- Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py 2005-06-10 
 23:57:01 UTC (rev
 30750)
 +++ Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py 2005-06-11 
 06:20:42 UTC (rev
 30751)
 @@ -56,15 +56,20 @@
  ExtensionClass.pmc_init_of(result)
  return result
  
 +# copy_reg.py:_slotnames() tries to use this attribute as a cache.
 +# Dont allow this attribute to be written as it may cause us
 +# to register with the data_manager.
 +__slotnames__ = property(None)
 +
  def __setattr__(self, name, v):
 +super(ZClassPersistentMetaClass, self).__setattr__(name, v)
  if not ((name.startswith('_p_') or name.startswith('_v'))):
  self._p_maybeupdate(name)
 -super(ZClassPersistentMetaClass, self).__setattr__(name, v)

Not caused by this patch, but shouldn't this be '_v_' instead of '_v' ?
ZODB/persistentclass.py has the same code, by the way...

Florent

  
  def __delattr__(self, name):
 +super(ZClassPersistentMetaClass, self).__delattr__(name)
  if not ((name.startswith('_p_') or name.startswith('_v'))):
  self._p_maybeupdate(name)
 -super(ZClassPersistentMetaClass, self).__delattr__(name)
  


-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1792: applied patch for broken ZClasses

2005-06-13 Thread Florent Guillaume
 Modified: Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py
 ===
 --- Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py 2005-06-10 
 23:57:01 UTC (rev
 30750)
 +++ Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py 2005-06-11 
 06:20:42 UTC (rev
 30751)
 @@ -56,15 +56,20 @@
  ExtensionClass.pmc_init_of(result)
  return result
  
 +# copy_reg.py:_slotnames() tries to use this attribute as a cache.
 +# Dont allow this attribute to be written as it may cause us
 +# to register with the data_manager.
 +__slotnames__ = property(None)
 +
  def __setattr__(self, name, v):
 +super(ZClassPersistentMetaClass, self).__setattr__(name, v)
  if not ((name.startswith('_p_') or name.startswith('_v'))):
  self._p_maybeupdate(name)
 -super(ZClassPersistentMetaClass, self).__setattr__(name, v)

Not caused by this patch, but shouldn't this be '_v_' instead of '_v' ?
ZODB/persistentclass.py has the same code, by the way...

Florent

  
  def __delattr__(self, name):
 +super(ZClassPersistentMetaClass, self).__delattr__(name)
  if not ((name.startswith('_p_') or name.startswith('_v'))):
  self._p_maybeupdate(name)
 -super(ZClassPersistentMetaClass, self).__delattr__(name)
  


-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1792: applied patch for broken ZClasses

2005-06-13 Thread Florent Guillaume
Andreas Jung  [EMAIL PROTECTED] wrote:
 --On 13. Juni 2005 17:15:40 +0200 Florent Guillaume [EMAIL PROTECTED] wrote:
  Not caused by this patch, but shouldn't this be '_v_' instead of '_v' ?
  ZODB/persistentclass.py has the same code, by the way...
 
 
 Likely you're right. Wanna fix it? :-)

Sure, but first I wanted to understand a bit the inheritance of code
between ZODB/persistentclass.py and ZClasses/_pmc.py. The __setattr__
and __getattr__ code appear to be similar in these two files (although
apparently inheritance cannot be done), so I wondered if the recent fix
in _pmc.py appear was needed in persistentclass.py too. Probably only
Jim knows that code well.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] proxydict problems in 2.8b2 with Localizer

2005-06-07 Thread Florent Guillaume
Lennart Regebro  [EMAIL PROTECTED] wrote:
 I get TypeError: object does not support item assignment in  lin 46
 och class_init.py.
 
 The offending code is d['_implicit__name__'] = 1 and this is because
 d is a proxydict. This in turn is caused by Localizer having a class
 as a class attribute:
 manage_attributesForm = LocalDTMLFile
 Apparently, Zope thinks that this class attribute needs a name, but
 there isn't one.

I fixed this for the upcoming 2.8.0:

  http://svn.zope.org/Zope/?rev=30675view=rev

See the unit test for a minimal case.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py Fixed unit test.

2005-06-01 Thread Florent Guillaume
Log message for revision 30588:
  Fixed unit test.

Changed:
  U   Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py 
2005-05-31 22:54:13 UTC (rev 30587)
+++ Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py 
2005-06-01 10:27:10 UTC (rev 30588)
@@ -375,8 +375,8 @@
 
 def testStrftimeUnicode(self):
 dt = DateTime('2002-05-02T08:00:00+00:00')
-self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'),
- u'Le 02/05/2002 \xe0 10h00')
+ok = dt.strftime('Le %d/%m/%Y a %Hh%M').replace('a', u'\xe0')
+self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'), ok)
 
 def test_suite():
 return unittest.makeSuite(DateTimeTests)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/DateTime/tests/testDateTime.py Fixed unit test.

2005-06-01 Thread Florent Guillaume
Log message for revision 30589:
  Fixed unit test.

Changed:
  U   Zope/trunk/lib/python/DateTime/tests/testDateTime.py

-=-
Modified: Zope/trunk/lib/python/DateTime/tests/testDateTime.py
===
--- Zope/trunk/lib/python/DateTime/tests/testDateTime.py2005-06-01 
10:27:10 UTC (rev 30588)
+++ Zope/trunk/lib/python/DateTime/tests/testDateTime.py2005-06-01 
10:28:40 UTC (rev 30589)
@@ -375,8 +375,8 @@
 
 def testStrftimeUnicode(self):
 dt = DateTime('2002-05-02T08:00:00+00:00')
-self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'),
- u'Le 02/05/2002 \xe0 10h00')
+ok = dt.strftime('Le %d/%m/%Y a %Hh%M').replace('a', u'\xe0')
+self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'), ok)
 
 def test_suite():
 return unittest.makeSuite(DateTimeTests)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py Added test for strftime with unicode pattern.

2005-05-31 Thread Florent Guillaume
Log message for revision 30570:
  Added test for strftime with unicode pattern.
  

Changed:
  U   Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py 
2005-05-31 14:30:17 UTC (rev 30569)
+++ Zope/branches/Zope-2_8-branch/lib/python/DateTime/tests/testDateTime.py 
2005-05-31 14:58:17 UTC (rev 30570)
@@ -373,7 +373,10 @@
 dt2 = DateTime('2040/01/30 11:33 GMT-2')
 self.assertEqual(dt1.strftime('%d/%m/%Y %H:%M'), 
dt2.strftime('%d/%m/%Y %H:%M'))
 
-
+def testStrftimeUnicode(self):
+dt = DateTime('2002-05-02T08:00:00+00:00')
+self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'),
+ u'Le 02/05/2002 \xe0 10h00')
 
 def test_suite():
 return unittest.makeSuite(DateTimeTests)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/DateTime/tests/testDateTime.py Merged revision 30570 from Zope-2_8-branch:

2005-05-31 Thread Florent Guillaume
Log message for revision 30571:
  Merged revision 30570 from Zope-2_8-branch:
  
  Added test for strftime with unicode pattern.
  

Changed:
  U   Zope/trunk/lib/python/DateTime/tests/testDateTime.py

-=-
Modified: Zope/trunk/lib/python/DateTime/tests/testDateTime.py
===
--- Zope/trunk/lib/python/DateTime/tests/testDateTime.py2005-05-31 
14:58:17 UTC (rev 30570)
+++ Zope/trunk/lib/python/DateTime/tests/testDateTime.py2005-05-31 
16:00:54 UTC (rev 30571)
@@ -373,7 +373,10 @@
 dt2 = DateTime('2040/01/30 11:33 GMT-2')
 self.assertEqual(dt1.strftime('%d/%m/%Y %H:%M'), 
dt2.strftime('%d/%m/%Y %H:%M'))
 
-
+def testStrftimeUnicode(self):
+dt = DateTime('2002-05-02T08:00:00+00:00')
+self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'),
+ u'Le 02/05/2002 \xe0 10h00')
 
 def test_suite():
 return unittest.makeSuite(DateTimeTests)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope] Finding an object in a folder

2005-05-27 Thread Florent Guillaume
Paul Winkler  [EMAIL PROTECTED] wrote:
 On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote:
  Paul Winkler wrote:
  
  marker = ()
  if getattr(some_object, marker) is not marker:
  
  For good measure, I wonder if that should be a [], no a ()?
 
 What's wrong with a tuple? There's no reason to mutate the marker. 

The whole point of a marker is that it is unique, so cannot be confused
with a legitimate value of the object examined.

And all empty tuples are equal.

In python 2.3, the idiom most commonly found is to use marker = object().

Florent

-- 
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 )


Re: [Zope] newbie question

2005-05-25 Thread Florent Guillaume
Barry Drake  [EMAIL PROTECTED] wrote:
 I'm getting an error in CMFCore.utils in the
 _mergedLocalRoles function.  The error is:
 
 Exception Type  TypeError
 Exception Value can only concatenate tuple (not
 list)
 to tuple

Note, this problem is due to a non-core product somewhere incorrectly
managing local roles, and passing them as tuples instead of lists. All
the internals of Zope (and here, CMF) assume that __ac_local_roles__ is
a dict of string-list.

Florent


-- 
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 )


Re: [Zope] Hiding HTML URL

2005-05-19 Thread Florent Guillaume
David H  [EMAIL PROTECTED] wrote:
 If I might disagree, keeping a stable URL is not, by itself,  
 user-defeating.  For example, user's do not like browser history 
 clutter with subfolders and objects - all from the same application. 

Speaking for myself, often I'm not looking for a website in my history
but for a specific page. Often I remember the website, not the page. The
history feature of the browser should be intelligent enough to allow
grouping by website. That's not a server problem.

 Also, we do not want a user to open browser history and click 
 www.myApp.com/updateChartOfAccounts.  Because that would be out of 
 context.  Sure you can respond with an error message.  But why should 
 they see it in the first place?

They shouldn't, the application should be written in such a way that
this is a POST, and it won't appear in the history.

 With a stable URL they just click www.myApp.com and they get the main 
 page - every time.

That's what bookmarks are for. You're trying to force your ideas of
bookmarking and history management to the users.

 The question remains - is there an elegant solution to this.

What you call stable URL everybody else calls cloaking or jailing.
It *is* hostile to the user.

Florent

-- 
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 )


Re: [Zope] Zope stops responding on hpux

2005-05-08 Thread Florent Guillaume
Samuel Bieri  [EMAIL PROTECTED] wrote:
 When I click on a tal-object (Page Template) to edit it, then zope 
 stops responding. No error is logged, nothing. I even cannot stop zope 
 anymore with zopectl stop or control-c if started with runzope. It 
 seems that zope silently crashes...

You may want to try DeadlockDebugger.

Florent

-- 
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 )


[Zope-dev] Re: [Zope-Coders] BTreeFolder2 for Zope 2.8?

2005-04-25 Thread Florent Guillaume
Andreas Jung  [EMAIL PROTECTED] wrote:
 Any objections to move BTreeFolder2 into the Zope core for Zope 2.8?
 BTF is widely used in  the Zope, CMF  Plone world and it would not hurt
 to ship it with Zope.

+1!

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Windows Binaries for 2.8b1

2005-04-25 Thread Florent Guillaume
Tim Peters  [EMAIL PROTECTED] wrote:
 LOL -- the attempt to send my last msg to Christian from my gmail
 account got blocked:
 
 This is an automatically generated Delivery Status Notification
 
 Delivery to the following recipient failed permanently:
 
 [EMAIL PROTECTED]
 
 Technical details of permanent failure:
 PERM_FAILURE: SMTP Error (state 9): 553 5.3.0 Spam blocked see:
 http://spamcop.net/bl.shtml?64.233.184.203

Yeah this goes to show that you have to be extremely careful in choosing
your RBL sources... And that spamcop is definitely not a good one.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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 )


<    1   2   3   4   5   6   >