[Zope-Annce] New set of z3c.form* releases!
Hi everyone, in the past month more project-related work, user feedback/requests and Javascript work has driven the development of the z3c.form framework. There are many new exciting features. There were also some small refactoring changes, which might require your CSS and tests to be adjusted. Please read the changes section below carefully! As always, the demos can be run using: $ svn co svn://svn.zope.org/repos/main/z3c.formdemo/tags/1.4.0 formdemo $ cd formdemo $ python bootstrap.py $ ./bin/buildout -N $ ./bin/demo fg Thanks to Roger, Windows users should be able to run the demos this way now as well! Visually, not much has happened; there are no new demos. However, just wait until the next round of z3c.formjs* releases! Changes --- - Feature: An event handler for ``ActionErrorOccurred`` events is registered to merge the action error into the form's error collectors, such as ``form.widgets.errors`` and ``form.widgets['name'].error`` (if applicable). It also sets the status of the form. (Thanks to Herman Himmelbauer, who requested the feature, for providing use cases.) - Feature: Action can now raise ``ActionExecutionError`` exceptions that will be handled by the framework. These errors wrap the original error. If an error is specific to a widget, then the widget name is passed to a special ``WidgetActionExecutionError`` error. (Thanks to Herman Himmelbauer, who requested the feature, for providing use cases.) - Feature: After an action handler has been executed, an action executed event is sent to the system. If the execution was successful, the event is ``ActionSuccessfull`` event is sent. If an action execution error was raised, the ``ActionErrorOccurred`` event is raised. (Thanks to Herman Himmelbauer, who requested the feature, for providing use cases.) - Feature: The ``applyChanges()`` function now returns a dictionary of changes (grouped by interface) instead of a boolean. This allows us to generate a more detailed object-modified event. If no changes are applied, an empty dictionary is returned. The new behavior is compatible with the old one, so no changes to your code are required. (Thanks to Darryl Cousins for the request and implementation.) - Feature: A new ``InvalidErrorViewSnippet`` class provides an error view snippet for ``zope.interface.Invalid`` exceptions, which are frequently used for invariants. - Feature: When a widget is required, HTML-based widgets now declare a required class. - Feature: The validation data wrapper now knows about the context of the validation, which provides a hook for invariants to access the environment. - Feature: The BoolTerms term tokens are now cosntants and stay the same, even if the label has changed. The choice for the token is true and false. By default it used to be yes and no, so you probably have to change some unit tests. Functional tests are still okay, because you select by term title. - Feature: BoolTerms now expose the labels for the true and false values to the class. This makes it a matter of doing trivial sub-classing to change the labels for boolean terms. - Feature: Exposed several attributes of the widget manager to the form for convenience. The attributes are: mode, ignoreContext, ignoreRequest, ignoreReadonly. - Feature: Provide more user-friendly error messages for number formatting. - Refactoring: The widget specific class name was in camel-case. A converntion that later developed uses always dash-based naming of HTML/CSS related variables. So for example, the class name textWidget is now text-widget. This change will most likely require some changes to your CSS declarations! - Documentation: The text of ``field.txt`` has been reviewed linguistically. - Documentation: While reviewing the ``form.txt`` with some people, several unclear and incomplete statements were discovered and fixed. - Bug (IE): In Internet Explorer, when a label for a radio input field is only placed around the text describing the choice, then only the text is surrounded by a dashed box. IE users reported this to be confusing, thus we now place the label around the text and the input element so that both are surrounded by the dashed border. In Firefox and KHTML (Safari) only the radio button is surrounded all the time. - Bug: When extracting and validating data in the widget manager, invariant errors were not converted to error view snippets. - Bug: When error view snippets were not widget-specific -- in other words, the ``widget`` attribute was ``None`` -- rendering the template would fail. Enjoy! ___ Zope-Announce maillist - Zope-Announce@zope.org http://mail.zope.org/mailman/listinfo/zope-announce Zope-Announce for Announcements only - no discussions (Related lists - Users: http://mail.zope.org/mailman/listinfo/zope Developers: http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] Zope Tests: 5 OK
Summary of messages to the zope-tests list. Period Thu Aug 23 12:00:00 2007 UTC to Fri Aug 24 12:00:00 2007 UTC. There were 5 messages: 5 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Thu Aug 23 20:52:41 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-August/008231.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Thu Aug 23 20:54:12 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-August/008232.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Aug 23 20:55:43 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-August/008233.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Aug 23 20:57:14 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-August/008234.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Aug 23 20:58:45 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-August/008235.html ___ 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] buildbot failure in Zope trunk 2.4 Windows 2000 zc-bbwin6
The Buildbot has detected a failed build of Zope trunk 2.4 Windows 2000 zc-bbwin6. Buildbot URL: http://buildbot.zope.org/ Build Reason: changes Build Source Stamp: 907 Blamelist: andreasjung,darrylcousins,faassen,fdrake,janwijbrand,jayeff,jim,luciano,nathan,nouri,pcardune,philikon,rocky,rossp,srichter,tlotze,ulif,zagy BUILD FAILED: failed test sincerely, -The Buildbot ___ 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] utf-8 problem in Zope when using Localizer
Hi, because nobody in der Localizer-Mailings list react and I thinks it could be a common problem with utf-8 in zope, I ask my question here also. I use Localizer 1.2.1 and I try out some things and all looks great. After testing Localizer my next plan was to switch from encoding ISO-8859-15 to utf-8 in Zope 2.10.3 but run into Problems when inserting text through a MessageCatalog (object of Localizer). Here is what I do in Zope: 1. I add default-zpublisher-encoding utf-8 to my zope.conf and restart zope. 2. In ZMI I add the property management_page_charset and set it to utf-8 3. I add a new DTML Document and start editing. I check the encoding in my Browser and it switched to unicode (utf-8). Looks good. 4. I insert html-code and some russian chars for testing html head meta http-equiv=content-type content=text/html; charset=utf-8 /head body ...russian chars... /body /html After Saving all looks great in ZMI and also in my webbrowser. 5. Now I add one line to use a MessageCatalog: dtml-var MessageCatalog('Hallo Welt!') After that, all of my utf-8-chars are broken in my webbrowser. I check browser-encoding and it is still utf-8. In ZMI my DTML Document looks good. This line must switch something in the output-encoding in the internal page-render (I don't know, how to better explain it). Is this an error in Localizer or in Zope or have I overlook a fault? Thanks Patrick ___ 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] utf-8 problem in Zope when using Localizer
--On 24. August 2007 08:32:17 +0200 Patrick Ulmer [EMAIL PROTECTED] wrote: Hi, because nobody in der Localizer-Mailings list react and I thinks it could be a common problem with utf-8 in zope, I ask my question here also. I use Localizer 1.2.1 and I try out some things and all looks great. After testing Localizer my next plan was to switch from encoding ISO-8859-15 to utf-8 in Zope 2.10.3 but run into Problems when inserting text through a MessageCatalog (object of Localizer). Here is what I do in Zope: 1. I add default-zpublisher-encoding utf-8 to my zope.conf and restart zope. 2. In ZMI I add the property management_page_charset and set it to utf-8 3. I add a new DTML Document and start editing. I check the encoding in my Browser and it switched to unicode (utf-8). Looks good. 4. I insert html-code and some russian chars for testing html head meta http-equiv=content-type content=text/html; charset=utf-8 /head body ...russian chars... /body /html After Saving all looks great in ZMI and also in my webbrowser. 5. Now I add one line to use a MessageCatalog: dtml-var MessageCatalog('Hallo Welt!') After that, all of my utf-8-chars are broken in my webbrowser. I check browser-encoding and it is still utf-8. In ZMI my DTML Document looks good. This line must switch something in the output-encoding in the internal page-render (I don't know, how to better explain it). Is this an error in Localizer or in Zope or have I overlook a fault? The http-equiv tag means not much to browser. Try setting the content-type including the charset within the HTTP response (REQUEST.RESPONSE.setHeader(...)). -aj pgpyJCX7p3dYG.pgp Description: PGP signature ___ 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] utf-8 problem in Zope when using Localizer
Hi, 4. I insert html-code and some russian chars for testing html head meta http-equiv=content-type content=text/html; charset=utf-8 /head body ...russian chars... /body /html After Saving all looks great in ZMI and also in my webbrowser. 5. Now I add one line to use a MessageCatalog: dtml-var MessageCatalog('Hallo Welt!') After that, all of my utf-8-chars are broken in my webbrowser. I check browser-encoding and it is still utf-8. In ZMI my DTML Document looks good. This line must switch something in the output-encoding in the internal page-render (I don't know, how to better explain it). Is this an error in Localizer or in Zope or have I overlook a fault? The http-equiv tag means not much to browser. Try setting the content-type including the charset within the HTTP response (REQUEST.RESPONSE.setHeader(...)). I have checked it but it is the same problem. Browser is encoding in utf-8 correct, but the result (html sourcecode from zope) is not utf-8 anymore after inserting dtml-var MessageCatalog('Hallo Welt!') and I don't know why it changed. How can a dtml-var-tag changed the encoding for the document? Thanks, Patrick ___ 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] utf-8 problem in Zope when using Localizer
If you can, I would strongly recommend using the Zope3/Five way of doing translations and i18n in general! See here: http://worldcookery.com/files/fivei18n/ http://codespeak.net/z3/five/i18n.html I've made my site fully internationalized, localized and utf-8 using this method without resorting to any trickery. setdefaultencoding() is apparently frowned upon ... Not sure why though. Good luck! J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Ulmer Sent: August 24, 2007 04:27 To: zope@zope.org Subject: Re: [Zope] utf-8 problem in Zope when using Localizer Hi, I think I solved the problem. dtml-var MessageCatalog('Hallo Welt!').encode('utf-8') works. I read some further and found out that I should use something like import sys sys.setdefaultencoding('utf-8') I set it global in sitecustomize.py under /usr/lib/python2.4/site-packages and then dtml-var MessageCatalog('Hallo Welt!') works. Now I only must find the right place for setdefaultencoding() so it only affect my zope-instance. Regars Patrick Patrick Ulmer schrieb: I think it's the right way for a solution. Now my page is utf-8, but if the string returned from MessageCatalog have utf-8 chars and not online chars in ascii range I get this error-message: Error Type: UnicodeEncodeError Error Value: 'ascii' codec can't encode character u'\xf4' in position 3: ordinal not in range(128) ___ 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 maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Global Variable In PT
[EMAIL PROTECTED] wrote at 2007-8-23 13:47 -0400: ... I have this code (editing out the extraneous) at the beginning of a page: body bgcolor=#ff tal:define=newRow string:yes After calling some other variables (specifically rotating through a changing ¨item¨ (for item in items...)), I try and change newRow: span tal:define=global newRow item/newRow tal:omit-tag= / Then I try and call newRow: p tal:replace=newRow / But it gives me the original value. Now, if I edit the page like this: span tal:define=global newRow item/newRow tal:omit-tag= p tal:replace=newRow / /span This means, you already have found a solution to your problem: Use global consistently for your variables. I think, I also have read a specification how global and local definitions for the same variable interact. When I remember right (but I am not sure), then what you is is consistent with the specification. -- Dieter ___ 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] utf-8 problem in Zope when using Localizer
Patrick Ulmer wrote at 2007-8-24 10:26 +0200: I think I solved the problem. dtml-var MessageCatalog('Hallo Welt!').encode('utf-8') works. I read some further and found out that I should use something like import sys sys.setdefaultencoding('utf-8') I set it global in sitecustomize.py under /usr/lib/python2.4/site-packages and then dtml-var MessageCatalog('Hallo Welt!') works. Now I only must find the right place for setdefaultencoding() so it only affect my zope-instance. $INSTANCE_HOME/lib/python would be a good place for the site-customize.py. -- Dieter ___ 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] utf-8 problem in Zope when using Localizer
Doyon, Jean-Francois wrote at 2007-8-24 09:36 -0400: ... setdefaultencoding() is apparently frowned upon ... Not sure why though. Occasionally, a package writer expects that str converts to ASCII, such that try: ascii = str(unicodeStr) except UnicodeError: # non ascii can be used to check for ASCIIness. Of course, this is true only when the defaultencoding is ASCII. Fortunately, unicode(unicodeStr, 'ascii') can safely be used instead. The code above actually occured in Python's xmlrpclib. When I reported the bug, people said we should eliminate setdefaultencoding But, then, they nevertheless fixed the bug... -- Dieter ___ 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 )