Re: [Zope-dev] zope.site.hooks

2009-10-09 Thread Fabio Tranchitella
* 2009-10-07 22:40, Martijn Faassen wrote:
 I think it would be interesting to review zope.component.zcml and see how
 it depends on security, and see whether we cannot make the dependency
 optional too.

I fully agree with this, and the main reason why I use a package like
repoze.zcml is to get rid of the (unnecessary) dependency on zope.security.

The only problem with making the dependency on zope.security optional is
related to the permission attribute in the zope.component ZCML
directives, which is a zope.security.zcml.Permission.

All the proxying stuff can be made optional with conditional imports.  I
think the only solution to make zope.security optional without removing the
permission attribute is to do something like:

try:
from zope.security.zcml import Permission
except ImportError:
from zope.schema import TextLine as Permission

Do anybody else has better ideas?

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


Re: [Zope-dev] zope.site.hooks

2009-10-09 Thread Martijn Faassen
Fabio Tranchitella wrote:
[snip]
  All the proxying stuff can be made optional with conditional imports.
  I think the only solution to make zope.security optional without
  removing the permission attribute is to do something like:

  try:
 from zope.security.zcml import Permission
  except ImportError:
 from zope.schema import TextLine as Permission

Thanks for that feedback, that's indeed a good point to bring up.

Time for some conclusions in this thread so that Thomas or someone else 
can proceed if they want to.

* we should move the zope.site.hooks in and make it optionally dependent 
on zope.security (if it's available). I think we should go ahead with 
this now.

* zope.copmonent.zcml has two issues:

   * it needs an [zcml] extra with quite a few extra dependencies that
 are not needed for normal zope.component use

   * it's dependent on zope.security. Fabio for one has a use case
 where this dependency isn't needed, and it'd be simpler if it
 could have all-python dependencies.

To resolve the zope.component.zcml issue, I'm going to redo a proposal I 
did a while ago but ended up in an endless discussion then.

I propose we create a new zope.componentzcml package that contains the 
zope.component.zcml code. This package is *optionally* dependent on 
zope.security as well as zope.proxy. It should work with just a 
dependency on zope.i18nmessageid and zope.configuration. We should 
figure out a way to test out both situations somehow. Ideas?

This will net us:

* a zope.component package with a lot less extra dependencies. Some 
packages that depend now on the dependency-heavy zope.site can now 
depend on zope.component, which should flatten our dependency structure 
quite a bit. It can be used without zope.security being available.

* a zope.componentzcml package. Whenever a package says it needs 
zope.component [zcml] we're going to say it needs 
zope.componentzcml. I think that's a very minor upgrade issue if we 
mark it well in the CHANGES.txt. It can be used without zope.security 
and zope.proxy being available (the goal should be usability without C 
compiled extensions). It can also *not* be used at all and repoze.zcml 
can be used. Such a deployment then won't have the confusing extra 
implementation of ZCML now in zope.component.

Optional dependencies aren't perfect, but I think this would mean a step 
forward so we should go ahead.

Regards,

Martijn

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


[Zope-dev] Zope Tests: 8 OK

2009-10-09 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Oct  8 12:00:00 2009 UTC to Fri Oct  9 12:00:00 2009 UTC.
There were 8 messages: 8 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Oct  8 20:45:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012736.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Oct  8 20:47:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012737.html

Subject: OK : Zope-2.12 Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Oct  8 20:49:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012738.html

Subject: OK : Zope-2.12-alltests Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Oct  8 20:51:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012739.html

Subject: OK : Zope-2.12 Python-2.6.2 : Linux
From: Zope Tests
Date: Thu Oct  8 20:53:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012740.html

Subject: OK : Zope-2.12-alltests Python-2.6.2 : Linux
From: Zope Tests
Date: Thu Oct  8 20:55:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012741.html

Subject: OK : Zope-trunk Python-2.6.2 : Linux
From: Zope Tests
Date: Thu Oct  8 20:57:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012742.html

Subject: OK : Zope-trunk-alltests Python-2.6.2 : Linux
From: Zope Tests
Date: Thu Oct  8 20:59:54 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-October/012743.html

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


[Zope-dev] ZTK sprint at ploneconf2009 Budapest

2009-10-09 Thread Adam GROSZER
Hello,

Feel free to join at

http://www.coactivate.org/projects/ploneconf2009-ztk-sprint/project-home

-- 
Best regards,
 Adam GROSZER  mailto:agros...@gmail.com
--
Quote of the day:
Democracy is a form of government in which it is permitted to wonder
aloud what the country could do under first-class management.  -
Senator Soaper 

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


[Zope-dev] five.localsitemanager and unregisterUtility

2009-10-09 Thread Sylvain Viollon
Hello,

   I used to use those features in Silva. It work well with 0.4, but
   it's broken in 1.x. (I have tests in Silva testing that).

   This have to do with the wrapping (to remember the aquisition path)
   of an utility which is done inside the registry by registerUtility,
   which breaks the unregisterUtility.

   unregisterUtility is checking that the component you want to
   unregister is the same than the one which is in the registry, for
   the same specification, which is not true, because the one in the
   registry in wrapped with a ComponentPathWrapper (in register).

   If you do grep unregisterUtility in five.localsitemanager, you have
   no match, but the site API defines both, so they should both
   works (and so be tested).

   I volunteer myself to add test (and fix it) in the SVN, as I need
   that fix.

   Does anyone have an objection with that ?

   Does any official maintainer will do a release (1.1.1, as it will be
   a bug fix) afterwards ?

   (of course, the trunk will need to be fixed if the same problem is
   present, and no, I do not want to use the trunk, but the 1.x branch).

   Best regards,

   Sylvain Viollon


-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.site.hooks

2009-10-09 Thread Fabio Tranchitella
* 2009-10-09 13:59, Martijn Faassen wrote:
 I propose we create a new zope.componentzcml package that contains the
 zope.component.zcml code. This package is *optionally* dependent on 
 zope.security as well as zope.proxy. It should work with just a
 dependency on zope.i18nmessageid and zope.configuration. We should figure
 out a way to test out both situations somehow. Ideas?

zope.component's dependencies are:

install_requires=['setuptools',
  'zope.interface',
  'zope.event',
  ],
The extra dependencies are:

extras_require = dict(
hook = ['zope.hookable'],
persistentregistry = ['ZODB3'],
zcml = ['zope.configuration',
'zope.security',
'zope.proxy',
'zope.i18nmessageid',
],
test = ['ZODB3',
'zope.testing',
'zope.hookable',
'zope.location',
],
docs = ['z3c.recipe.sphinxdoc'],
),

Considering that we are not really getting rid of all the extras, instead of
creating a new package I'd rather make the dependency on zope.security and
zope.proxy optional in zope.component: it is possible to do it with conditional
imports, and we are not breaking any application already depending on
zope.component[zcml], unless they need zope.security but they are not directly
depending on it (which is bad and wrong, in any case).

Note that we are already using conditional imports in zope.component._api.
Anyway, I'm fine with what Martijn proposed if nobody else supports my
idea.

Best regards,
Fabio
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Testrunner option for running tests in random order?!?

2009-10-09 Thread Christian Theune
Hi,

On 10/08/2009 03:28 PM, Jonathan Ballet wrote:
 Hi Christian,
 
 On Fri, Oct 2, 2009 at 2:00 PM, Christian Theune c...@gocept.com wrote:
 Hi,

 I *thought* the test runner had a feature to run tests in randomized
 order, but I can't find it. Is that something that Zope 2 had and that
 was never ported to zope.testing?

 I couldn't find in the history either.

 /me is confused.
 
 I was about to send the same mail today, but I found out your mail before.
 
 I didn't find anything relative to random tests in Zope 2 (but I'm not
 familiar at all with Zope 2, so I'm pretty sure I could have missed
 something), and I ended up writing a new feature for zope.testing's
 testrunner.
 
 I made a branch 'shuffle-tests', available on the Mercurial repository
 at http://bitbucket.org/multani/zope.testing-shuffle/ , which adds two
 new options:

   * --shuffle to randomize the order of the tests in a layer (layers
 are not yet randomized, I didn't look at it yet);
   * --shuffle-seed XXX, to initialize the RNG with a specific value,
 which allows to reproduce a specific randomization of tests (inspired
 by this thread 
 http://lists.idyll.org/pipermail/testing-in-python/2009-April/001812.html
 )

Sounds right. It could even be folded into a single option:

--shuffle[=XXX]

 It's not yet ready-to-commit: it still misses tests (tricky to write)
 and more documentation.

That's what working branches are for. You do have commit rights, don't you?

It's not that tricky to test: seed the RNG from outside the tests.

 However, feedbacks are welcome!

Thanks for the work!

Christian

-- 
Christian Theune · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope-dev] five.localsitemanager and unregisterUtility

2009-10-09 Thread Hanno Schlichting
Hi Sylvain.

I'm including Michael here, who's added the mentioned feature in the
first place.

On Fri, Oct 9, 2009 at 2:22 PM, Sylvain Viollon sylv...@infrae.com wrote:
   I used to use those features in Silva. It work well with 0.4, but
   it's broken in 1.x. (I have tests in Silva testing that).

   This have to do with the wrapping (to remember the aquisition path)
   of an utility which is done inside the registry by registerUtility,
   which breaks the unregisterUtility.

   unregisterUtility is checking that the component you want to
   unregister is the same than the one which is in the registry, for
   the same specification, which is not true, because the one in the
   registry in wrapped with a ComponentPathWrapper (in register).

   If you do grep unregisterUtility in five.localsitemanager, you have
   no match, but the site API defines both, so they should both
   works (and so be tested).

   I volunteer myself to add test (and fix it) in the SVN, as I need
   that fix.

   Does anyone have an objection with that ?

No objection, please go ahead.

   Does any official maintainer will do a release (1.1.1, as it will be
   a bug fix) afterwards ?

Sure, ping me once you are done and I'll cut a new release. Michael,
do you want to test anything, before I do a new release?

   (of course, the trunk will need to be fixed if the same problem is
   present, and no, I do not want to use the trunk, but the 1.x branch).

There were some changes to the registerUtility code on trunk
(incorporating bug fixes from zope.component), but these had to do
with re-registering utilities and the implicit unregister that happens
during that.

As unregisterUtility is still not overridden, I suspect the same
problem still exits and your tests should show that.

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


Re: [Zope-dev] Testrunner option for running tests in random order?!?

2009-10-09 Thread Jonathan Ballet
Hey,

On Fri, Oct 9, 2009 at 2:33 PM, Christian Theune c...@gocept.com wrote:
   * --shuffle to randomize the order of the tests in a layer (layers
 are not yet randomized, I didn't look at it yet);
   * --shuffle-seed XXX, to initialize the RNG with a specific value,
 which allows to reproduce a specific randomization of tests (inspired
 by this thread 
 http://lists.idyll.org/pipermail/testing-in-python/2009-April/001812.html
 )

 Sounds right. It could even be folded into a single option:

 --shuffle[=XXX]

I'm not sure how to do that, considering those use cases:

 * the user doesn't want to shuffle its tests and so, doesn't set --shuffle
 * the user want to shuffle its tests, without specifying an order,
and use --shuffle
 * the user want to shuffle its tests in specific order, and use --shuffle=42

If I want this option to have an optional value, I think I must set a
default value to the option. But then, how to make the distinction
between the two first cases? I might miss something I don't know in
option parsing, but I didn't find anything...

 It's not yet ready-to-commit: it still misses tests (tricky to write)
 and more documentation.

 That's what working branches are for. You do have commit rights, don't you?

I don't (personally) have commit rights, but my boss (sdouche) has.
I'll see with him.


Thanks for your advices!

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


Re: [Zope-dev] Testrunner option for running tests in random order?!?

2009-10-09 Thread Benji York
On Fri, Oct 9, 2009 at 8:51 AM, Jonathan Ballet
jonathan.bal...@securactive.net wrote:
 If I want this option to have an optional value, I think I must set a
 default value to the option. But then, how to make the distinction
 between the two first cases? I might miss something I don't know in
 option parsing, but I didn't find anything...

I'd try the same approach as default options in Python functions.  Make
the default None (which isn't a valid seed) and then you can tell the
difference.
-- 
Benji York
Senior Software Engineer
Zope Corporation
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.site.hooks

2009-10-09 Thread Martijn Faassen
Fabio Tranchitella wrote:
[snip]
 Anyway, I'm fine with what Martijn proposed if nobody else supports my
 idea.

I'm okay with *not* doing the split up and going with your idea, but I 
think eventually such a split up would simplify things. One advantage 
would be that someone could examine repoze.zcml and not see distracting 
ZCML implementations in zope.component *too*.

Regards,

Martijn

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


Re: [Zope-dev] Testrunner option for running tests in random order?!?

2009-10-09 Thread Jonathan Ballet
Hi,

On Fri, Oct 9, 2009 at 3:30 PM, Benji York be...@zope.com wrote:
 On Fri, Oct 9, 2009 at 8:51 AM, Jonathan Ballet
 jonathan.bal...@securactive.net wrote:
 If I want this option to have an optional value, I think I must set a
 default value to the option. But then, how to make the distinction
 between the two first cases? I might miss something I don't know in
 option parsing, but I didn't find anything...

 I'd try the same approach as default options in Python functions.  Make
 the default None (which isn't a valid seed) and then you can tell the
 difference.

That's what I originally though, but then, how can I make the
difference between 'the user has not set --shuffle' (the option's
value is then None), and 'the user has set the --shuffle option, but
without specifying a seed' (then the option's value is None again)?

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


[Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-09 Thread Hermann Himmelbauer
Hi,
I once in the while get the following warning in my Zope 3 log, which I'd like 
to resolve:

2009-10-07T14:35:41 WARNING ZopePublication Competing writes/reads 
at /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklist/index.html: 
database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree, serial 
this txn started with 0x0381388ca6804966 2009-10-07 12:28:39.023700, serial 
currently committed 0x03813893b087d0cc 2009-10-07 12:35:41.374343)

I wonder how I can find out, to which attribute this applies, I do know the 
view and the class, probably BTrees.OOBTree.OOBTree, but don't know the 
attribute itself.

Any clues?

Best Regards,
Hermann

-- 
herm...@qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-09 Thread Shane Hathaway
Hermann Himmelbauer wrote:
 Hi,
 I once in the while get the following warning in my Zope 3 log, which I'd 
 like 
 to resolve:
 
 2009-10-07T14:35:41 WARNING ZopePublication Competing writes/reads 
 at 
 /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklist/index.html: 
 database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree, serial 
 this txn started with 0x0381388ca6804966 2009-10-07 12:28:39.023700, serial 
 currently committed 0x03813893b087d0cc 2009-10-07 12:35:41.374343)

That URL looks like it should only be reading the database, but the fact 
that you get a conflict error suggests that the code behind that URL is 
writing to the database.  If I were you, I would first ensure that read 
operations never write to the database.

Shane

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


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-09 Thread Roger Ineichen
Hi Hermann

 Betreff: Re: [Zope-dev] ZODB Competing read/writes: How to 
 find out which attribute?
 
 Hermann Himmelbauer wrote:
  Hi,
  I once in the while get the following warning in my Zope 3 
 log, which 
  I'd like to resolve:
  
  2009-10-07T14:35:41 WARNING ZopePublication Competing 
 writes/reads at 
  
 /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklis
t/index.html:
  database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree, 
  serial this txn started with 0x0381388ca6804966 2009-10-07 
  12:28:39.023700, serial currently committed 0x03813893b087d0cc 
  2009-10-07 12:35:41.374343)
 
 That URL looks like it should only be reading the database, 
 but the fact that you get a conflict error suggests that the 
 code behind that URL is writing to the database.  If I were 
 you, I would first ensure that read operations never write to 
 the database.

just a hint, sometimes session get accessed with session[key]
wich will force a write operation. If so, you can prevent creating
a new session by using session.get(key, someDefaultValue)

Regards
Roger Ineichen

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

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


[Zope-dev] Zope 2 documentation

2009-10-09 Thread Baiju M
Hi Jens,
I was looking at Zope 2 documentation.  To generate this site :
http://docs.zope.org/zope2/

we use the buildout available here, is it ?
svn://svn.zope.org/repos/main/zope2docs/trunk

So, can I remove the buildout available inside zdgbook and zope2book ?

Also it looks like this patch is required to generate it locally:
-x--x-x-
Index: buildout.cfg
===
--- buildout.cfg(revision 104937)
+++ buildout.cfg(working copy)
@@ -16,6 +16,7 @@
 recipe = zc.recipe.egg
 eggs =
 Sphinx
+docutils
 interpreter = stxpy
 scripts =
 sphinx-build
Index: Makefile
===
--- Makefile(revision 104937)
+++ Makefile(working copy)
@@ -3,7 +3,7 @@

 # You can set these variables from the command line.
 SPHINXOPTS=
-SPHINXBUILD   = sphinx-build
+SPHINXBUILD   = ./bin/sphinx-build
 PAPER =

 # Internal variables.
-x--x-x-

May be we can pin the versions of Sphinx  docutils.

Regards,
Baiju M
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )