[Zope-dev] Zope Tests: 87 OK, 13 Failed

2011-02-15 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Mon Feb 14 12:00:00 2011 UTC to Tue Feb 15 12:00:00 2011 UTC.
There were 100 messages: 8 from Zope Tests, 4 from buildbot at pov.lt, 31 from 
buildbot at winbot.zope.org, 11 from ccomb at free.fr, 46 from jdriessen at 
thehealthagency.com.


Test failures
-

Subject: FAILED : Zope Buildbot / zopetoolkit_win-py2.5 slave-win
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 16:08:54 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032042.html

Subject: FAILED : winbot / z3c.form_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 22:21:41 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032093.html

Subject: FAILED : winbot / z3c.rml_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 22:49:11 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032094.html

Subject: FAILED : winbot / z3c.template_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 22:58:25 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032095.html

Subject: FAILED : winbot / z3c.layer.ready2go_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:03:56 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032097.html

Subject: FAILED : winbot / z3c.formui_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:05:18 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032098.html

Subject: FAILED : winbot / z3c.tabular_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:07:33 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032099.html

Subject: FAILED : winbot / z3c.contents_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:08:30 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032100.html

Subject: FAILED : winbot / z3c.ptcompat_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:26:57 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032101.html

Subject: FAILED : winbot / z3c.pdftemplate_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:31:00 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032102.html

Subject: FAILED : winbot / z3c.coverage_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:32:32 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032103.html

Subject: FAILED : winbot / z3c.macro_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:33:19 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032104.html

Subject: FAILED : winbot / z3c.pagelet_py_265_32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 23:38:14 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032105.html


Tests passed OK
---

Subject: OK : Zope Buildbot / zope2.13_win-py2.6 slave-win
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 14:57:40 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032017.html

Subject: OK : Zope Buildbot / zope2.13_win-py2.7 slave-win
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:01:57 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032018.html

Subject: OK : Zope Buildbot / zope2.12-py2.6 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:10:35 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032019.html

Subject: OK : Zope Buildbot / zope2.13-py2.6 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:12:00 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032020.html

Subject: OK : Zope Buildbot / zope2.13-py2.7 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:13:23 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032021.html

Subject: OK : Zope Buildbot / zope2.14-py2.6 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:14:49 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032022.html

Subject: OK : Zope Buildbot / zope2.14-py2.7 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:16:17 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032023.html

Subject: OK : Zope Buildbot / zopetoolkit-1.0_win-py2.4 slave-win
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:17:33 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032024.html

Subject: OK : winbot / ztk_dev py_254_win32
From: buildbot at winbot.zope.org
Date: Mon Feb 14 15:18:37 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032025.html

Subject: OK : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Mon Feb 14 15:21:56 EST 2011
URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032026.html

Subject: OK : winbot / ztk_dev py_265_win32
From: 

[Zope-dev] schema upgrades with zope.formlib + FIX

2011-02-15 Thread Johannes Raggam
dear zopistas,

while trying to add a new schema field to an already registered plone
portlet, i got following traceback:

2011-02-14 23:11:55 ERROR Zope.SiteErrorLog 1297721515.110.63984381121
http://localhost:8880/info/uber-uns/geschichte/++contextportlets
++plone.rightcolumn/show-galleries-portlet/edit
Traceback (innermost last):
  Module ZPublisher.Publish, line 127, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 47, in call_object
  Module plone.app.portlets.browser.formhelper, line 123, in __call__
  Module zope.formlib.form, line 782, in __call__
  Module five.formlib.formbase, line 50, in update
  Module zope.formlib.form, line 745, in update
  Module zope.formlib.form, line 820, in setUpWidgets
  Module zope.formlib.form, line 408, in setUpEditWidgets
  Module zope.schema._bootstrapfields, line 173, in get
AttributeError: image_size

while - IMO - zope.schema throws that error justifiably, i think
zope.formlib should handle it more gracefully in setUpEditWidgets. i
think, this error comes with every schema upgrade for zope.formlib based
edit-forms. so, what do you think of following patch?


From bcf7e2b7cb94b145cd502ad57e1363f2e6b4a879 Mon Sep 17 00:00:00 2001
From: Johannes Raggam raggam...@adm.at
Date: Tue, 15 Feb 2011 12:38:50 +0100
Subject: [PATCH] after schema upgrades (e.g. for plone.app.portlets),
the edit screen cannot be rendered because there is no v
alue for the new field attribute. in this case, use the default value.

---
 zope/formlib/form.py |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/zope/formlib/form.py b/zope/formlib/form.py
index 5df88cf..0d3ade3 100755
--- a/zope/formlib/form.py
+++ b/zope/formlib/form.py
@@ -405,7 +405,11 @@ def setUpEditWidgets(form_fields, form_prefix,
context, request,
 
 if ignore_request or readonly or not widget.hasInput():
 # Get the value to render
-value = field.get(adapter)
+try:
+value = field.get(adapter)
+except AttributeError:
+# value not available after schema upgrade
+value = field.default
 widget.setRenderedValue(value)
 
 widgets.append((not readonly, widget))
-- 
1.7.1



i'm not sure if this would cause any unwanted side effects... actually i
think it won't.



regards,
johannes raggam


-- 
johannes raggam / thet
python plone zope development
http://johannes.raggam.co.at/
mailto:johan...@raggam.co.at
http://bluedynamics.com/

___
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] schema upgrades with zope.formlib + FIX

2011-02-15 Thread Hanno Schlichting
On Tue, Feb 15, 2011 at 1:21 PM, Johannes Raggam raggam...@adm.at wrote:
 while - IMO - zope.schema throws that error justifiably, i think
 zope.formlib should handle it more gracefully in setUpEditWidgets. i
 think, this error comes with every schema upgrade for zope.formlib based
 edit-forms. so, what do you think of following patch?

The usual approach is to add new attributes as class attributes to the
persistent object. Or write an actual database upgrade step, either
via something like zope.generations or with a GenericSetup upgrade
step.

But for zope.formlib it make indeed make sense to be more lenient
here. So +0 on your patch.

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] schema upgrades with zope.formlib + FIX

2011-02-15 Thread Johannes Raggam
well, for schema upgrades, also following patch seems to be necessary:


From c11064b8d8a7607d41071250f587f097f8c130a3 Mon Sep 17 00:00:00 2001
From: Johannes Raggam raggam...@adm.at
Date: Tue, 15 Feb 2011 14:29:56 +0100
Subject: [PATCH 2/2] gracefully set newvalue for upgraded schemas, where
oldvalue isn't available.

---
 zope/formlib/form.py |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/zope/formlib/form.py b/zope/formlib/form.py
index 0d3ade3..ff10168 100755
--- a/zope/formlib/form.py
+++ b/zope/formlib/form.py
@@ -532,7 +532,13 @@ def applyData(context, form_fields, data,
adapters=None):
 
 name = form_field.__name__
 newvalue = data.get(name, form_field) # using form_field as
marker
-if (newvalue is not form_field) and (field.get(adapter) !=
newvalue):
+try:
+oldvalue = field.get(adapter)
+except AttributeError:
+# value not available after schema upgrade
+# make sure that oldvalue != newwalue
+oldvalue = not bool(newvalue)
+if (newvalue is not form_field) and (oldvalue != newvalue):
 descriptions.setdefault(interface,
[]).append(field.__name__)
 field.set(adapter, newvalue)
 
-- 
1.7.1


On Tue, 2011-02-15 at 13:25 +0100, Hanno Schlichting wrote:
 On Tue, Feb 15, 2011 at 1:21 PM, Johannes Raggam raggam...@adm.at wrote:
  while - IMO - zope.schema throws that error justifiably, i think
  zope.formlib should handle it more gracefully in setUpEditWidgets. i
  think, this error comes with every schema upgrade for zope.formlib based
  edit-forms. so, what do you think of following patch?
 
 The usual approach is to add new attributes as class attributes to the
 persistent object. Or write an actual database upgrade step, either
 via something like zope.generations or with a GenericSetup upgrade
 step.
 
 But for zope.formlib it make indeed make sense to be more lenient
 here. So +0 on your patch.
 
 Hanno

-- 
johannes raggam / thet
python plone zope development
http://johannes.raggam.co.at/
mailto:johan...@raggam.co.at
http://bluedynamics.com/

___
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] Acquisition wrapped objects do not behave well on unicode call

2011-02-15 Thread Michael Howitz
Hi,

When I have an acquisition wrapped object, e. g. my_object and call:

 unicode(my_object)

The method __str__ of my_object is called even when it has an __unicode__ 
method.

See the following bin/zopectl debug session:

$ bin/zinstance debug
Starting debugger (the name app is bound to the top-level Zope object)
 import OFS.SimpleItem
 class A(OFS.SimpleItem.SimpleItem):
... def __str__(self): return '__str__ called'
... def __unicode__(self): return '__unicode__ called'
...
 a = A()
 print unicode(a)
__unicode__ called
 print unicode(a.__of__(app))
__str__ called
 print type(a.__of__(app))
type 'Acquisition.ImplicitAcquisitionWrapper'

This happens for Python 2.6 and 2.7 on Zope 2.13.4.

Is there a suggested work around?

P.S.: I also filed a bug report: 
https://bugs.launchpad.net/acquisition/+bug/719335 


Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · 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] zope.contentprovider not useable together with Zope 2.13.4

2011-02-15 Thread Hanno Schlichting
Hi.

On Tue, Feb 15, 2011 at 2:46 PM, Michael Howitz m...@gocept.com wrote:
 I tracked this down to Zope2/App/exclude.zcml where the meta.zcml of the 
 package zope.browserpage gets excluded.
 Sadly this ZCML file defines the expressiontype directive.

 What is the current way to use zope.contentprovider in a Zope2 environment?

Hhm, I wasn't aware that this was possible at all so far. I thought we
only made zope.viewlet available in Zope2 via Products.Five.viewlet.

 I had the following idea to fix this issue:

 * move the registration of the directive from meta.zcml into 
 meta-expressiontype.zcml
 * include meta-expressiontype.zcml of zope.browserpage
 * include meta-expressiontype.zcml in our project to get around the exclusion 
 of Zope2

 Are there any better ideas?

I think you need a five.contentprovider package for this to work correctly.

The expressiontype function in zope.browerpage.metaconfigure uses
zope.pagetemplate.engine.Engine.registerType.
zope.pagetemplate.engine.Engine is a module global, but the wrong one
in a Zope 2 context.

To get the correct TAL engine in Zope 2, you need to call
Products.PageTemplates.Expressions.getEngine, which returns a module
global from that module. Otherwise you get a wrong context. The
trusted version is accessible via
Products.Five.browser.pagetemplatefile.getEngine. You can then call
registerType on both of these engines.

Also note that you need to use
Products.Five.pagetemplatefile.ViewPageTemplateFile to register
templates. The ZCML directives available in Zope 2 use that one. The
zope.pagetemplate based classes don't work correctly inside Zope 2.

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] Acquisition wrapped objects do not behave well on unicode call

2011-02-15 Thread Hanno Schlichting
On Tue, Feb 15, 2011 at 2:35 PM, Michael Howitz m...@gocept.com wrote:
 When I have an acquisition wrapped object, e. g. my_object and call:

 unicode(my_object)

 The method __str__ of my_object is called even when it has an __unicode__ 
 method.

Acquisition wrappers only fill the tp_repr and tp_str slot and as far
as I can tell there's no tp_unicode slot in PyObject_HEAD_INIT.

So I'm not sure how to add the C equivalent of a __unicode__ to the
Wrappertype and XaqWrappertype PyExtensionClasses. It would probably
have to do a lookup for a __unicode__ method on the wrapped instance,
call it if it exists and otherwise call its own __str__ - essentially
duplicating the logic of the string type.

My C-fu is too weak to attempt this. The workaround is to call
unicode(aq_base(my_object)).

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 )


[Zope-dev] z3c.formjs widgetselector customization

2011-02-15 Thread Simon Elbaz
Hi,
I use z3c.formjs in a project and would like to customize the selector id
used into jsaction.handler for form field.
Since the z3c.formui templates add -row suffix to the widget id, I need
also to add the -row suffix to the selector id in the event handler.

Here is the code in jsaction.py:

  # Step 1: Get the handler.
  handlers = widget.form.jshandlers.getHandlers(widget.field)
  # Step 2: Create a selector.
  selector_cls = queryUtility(interfaces.IWidgetSelector)
  if selector_cls is None:
  selector = WidgetSelector(widget)
  else:
  selector = selector_cls(widget)

If it is a good idea, how could I apply it to svn repository ?

Thx,
Simon
___
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] z3c.formjs widgetselector customization

2011-02-15 Thread Stephan Richter
On Tuesday, February 15, 2011, Simon Elbaz wrote:
 If it is a good idea, how could I apply it to svn repository ?

You can become a committer and check it into the Zope SVN repository. (I can 
be your reference.)

Feel free to make any changes to z3c.formjs you like. I can also aid you at 
making a release later.

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. Zope Stephan Richter
___
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] Acquisition wrapped objects do not behave well on unicode call

2011-02-15 Thread Christian Zagrodnick
On 2011-02-15 15:26:28 +0100, Hanno Schlichting said:

 On Tue, Feb 15, 2011 at 2:35 PM, Michael Howitz m...@gocept.com wrote:
 When I have an acquisition wrapped object, e. g. my_object and call:
 
 unicode(my_object)
 
 The method __str__ of my_object is called even when it has an 
 __unicode__ method.
 
 Acquisition wrappers only fill the tp_repr and tp_str slot and as far
 as I can tell there's no tp_unicode slot in PyObject_HEAD_INIT.
 
 So I'm not sure how to add the C equivalent of a __unicode__ to the
 Wrappertype and XaqWrappertype PyExtensionClasses. It would probably
 have to do a lookup for a __unicode__ method on the wrapped instance,
 call it if it exists and otherwise call its own __str__ - essentially
 duplicating the logic of the string type.

Jup.

 
 My C-fu is too weak to attempt this.

Heh. My C-fu is also rather weak but I might try it if there are no 
objections.  (or there is somebody hacking it in 5 minutes …)

 The workaround is to call
 unicode(aq_base(my_object)).

Yes, but that's not really an option.

Regards,
-- 
Christian Zagrodnick · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 4 · 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 )