Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

Zope2 debug-mode vs ZCML dev-mode, ZCML conditionals

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


thomas at thomas-lotze

Aug 3, 2009, 11:49 PM

Post #1 of 6 (736 views)
Permalink
Zope2 debug-mode vs ZCML dev-mode, ZCML conditionals

We recently ran into an issue with debug/development mode when making
z3c.hashedresource work with Zope2: The package implements different
behaviour depending on whether the dev-mode feature is enabled in the ZCML
of a Zope3 application, and we sort of expected this feature to be
automatically enabled or disabled in a Zope2 application using Five when
Zope2 debug-mode is switched on or off, resp. As this doesn't seem to be
the case, we were wondering a few things:

- Is Zope2 debug mode semantically equivalent to ZCML dev-mode, i.e.
should the two be linked to each other in the first place?

- If so, is it a bug that ZCML dev-mode isn't controlled by Zope2 debug
mode in a Five application? Or is it and we're just missing something?

- If the the two should be connected but aren't, what's the best way to
fix things? Should this be fixed in Five? Otherwise, how to achieve
switching on the ZCML dev-mode feature the right way?

Independently of these questions, wouldn't it make sense for ZCML to have,
in addition to "feature" and "installed", a conditional verb "expression"
that allows referencing a Python expression defined in a module whose
boolean value to use for deciding the condition?

--
Thomas



_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
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 )


lists at zopyx

Sep 14, 2009, 11:04 PM

Post #2 of 6 (561 views)
Permalink
Re: Zope2 debug-mode vs ZCML dev-mode, ZCML conditionals [In reply to]

On 15.09.09 08:00, Thomas Lotze wrote:
> I asked this a month ago without getting any responses, so I'll give it
> one more try:
>
> We recently ran into an issue with debug/development mode when making
> z3c.hashedresource work with Zope2: The package implements different
> behaviour depending on whether the dev-mode feature is enabled in the ZCML
> of a Zope3 application, and we sort of expected this feature to be
> automatically enabled or disabled in a Zope2 application using Five when
> Zope2 debug-mode is switched on or off, resp. As this doesn't seem to be
> the case, we were wondering a few things:
>
> - Is Zope2 debug mode semantically equivalent to ZCML dev-mode, i.e.
> should the two be linked to each other in the first place?
>

What is the ZCML dev-mode?

Andreas
Attachments: lists.vcf (0.31 KB)


tl at gocept

Sep 14, 2009, 11:27 PM

Post #3 of 6 (565 views)
Permalink
Re: Zope2 debug-mode vs ZCML dev-mode, ZCML conditionals [In reply to]

Andreas Jung wrote:

> On 15.09.09 08:00, Thomas Lotze wrote:
>> - Is Zope2 debug mode semantically equivalent to ZCML dev-mode, i.e.
>> should the two be linked to each other in the first place?
>>
> What is the ZCML dev-mode?

It's a so-called ZCML "feature" that can be used with ZCML conditionals.
It can be switched on like this:

<meta:provides feature="devmode"/>

and used elsewhere like this:

<adapter zcml:condition="have devmode" factory="foo.bar.baz"/>

--
Thomas



_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
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 )


lists at zopyx

Sep 14, 2009, 11:30 PM

Post #4 of 6 (565 views)
Permalink
Re: Zope2 debug-mode vs ZCML dev-mode, ZCML conditionals [In reply to]

On 15.09.09 08:27, Thomas Lotze wrote:
> Andreas Jung wrote:
>
>
>> On 15.09.09 08:00, Thomas Lotze wrote:
>>
>>> - Is Zope2 debug mode semantically equivalent to ZCML dev-mode, i.e.
>>> should the two be linked to each other in the first place?
>>>
>>>
>> What is the ZCML dev-mode?
>>
> It's a so-called ZCML "feature" that can be used with ZCML conditionals.
> It can be switched on like this:
>
> <meta:provides feature="devmode"/>
>
> and used elsewhere like this:
>
> <adapter zcml:condition="have devmode" factory="foo.bar.baz"/>
>
I can not remember having seen any support this feature.
If you need it, please add it to the Zope 2 trunk (however too late
for the Zope 2.12 release, sorry :-))

Andreas
Attachments: lists.vcf (0.31 KB)


tl at gocept

Sep 14, 2009, 11:35 PM

Post #5 of 6 (559 views)
Permalink
Re: Zope2 debug-mode vs ZCML dev-mode, ZCML conditionals [In reply to]

Andreas Jung wrote:

> I can not remember having seen any support this feature. If you need it,
> please add it to the Zope 2 trunk

I'll see about it ASAP.

> (however too late for the Zope 2.12 release, sorry :-))

That's fine.

--
Thomas



_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
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 )


hanno at hannosch

Sep 14, 2009, 11:38 PM

Post #6 of 6 (562 views)
Permalink
Re: Zope2 debug-mode vs ZCML dev-mode, ZCML conditionals [In reply to]

On Tue, Sep 15, 2009 at 8:00 AM, Thomas Lotze <tl [at] gocept> wrote:
> - Is Zope2 debug mode semantically equivalent to ZCML dev-mode, i.e.
>  should the two be linked to each other in the first place?

I don't know what kind of functionality is usually switched on by the
zcml dev-mode. Are there any common examples?

Dev mode in Zope2 is turned on automatically if you run the process in
foreground mode and is very common to use. If any of the things
controlled by zcml dev mode affect performance or startup time in a
noticeable bad way, that would be worrying. If it's only additional
logging, development and debug helpers being switched on, that sounds
like the same type of functionality.

> - If so, is it a bug that ZCML dev-mode isn't controlled by Zope2 debug
>  mode in a Five application? Or is it and we're just missing something?

Not a bug. Just not a feature implemented yet ;)

> - If the the two should be connected but aren't, what's the best way to
>  fix things? Should this be fixed in Five? Otherwise, how to achieve
>  switching on the ZCML dev-mode feature the right way?

I'd assume you'd need to add some logic into Five for this. Probably
register a different zcml handler for the directive as done for most
of the handlers.

I'd be +1 on this, if there's no performance or otherwise noticeable
drawback from it :)

Hanno
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
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 RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.