Re: [Zope-dev] SVN: Zope2.buildout/trunk/ Don't pin setuptools.

2008-08-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Florian Schulze wrote:
> On 28.08.2008, at 21:22, Tres Seaver wrote:
> 
>>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Florian Schulze wrote:
>>> Log message for revision 90415:
>>>  Don't pin setuptools.
>>>  Moved zope3.cfg to versions-zope3.cfg.
>>>  Added some missing files from the Zope2 trunk.
>>>  Added dummy script which will be used to create lib/python.
>> 
>>
>>> Modified: Zope2.buildout/trunk/buildout.cfg
>>> ===
>>> --- Zope2.buildout/trunk/buildout.cfg   2008-08-27 09:32:04 UTC (rev  
>>> 90414)
>>> +++ Zope2.buildout/trunk/buildout.cfg   2008-08-27 09:33:59 UTC (rev  
>>> 90415)
>>> @@ -6,20 +6,12 @@
>>> test
>>> omelette
>>> find-links = http://download.zope.org/distribution/
>>> -unzip = true
>> I don't think zipped eggs are a win in any real scenario, except
>> possibly the goofy file-count-limited GAE.  I would strongly prefer  
>> that
>> you revert this one change (you can override it in your own
>> '~/.buildout/default.cfg').
> 
> This change is needed for the creation of the source tarball. The  
> buildout uses a custom egg directory, so this change doesn't affect  
> any other buildout installations as it would if an egg cache would be  
> used. Andreas Jung saw the changes we made and agreed to them.

Thanks for the correction / clarification.  I withdraw my request. ;)


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFItziv+gerLs4ltQ4RAv7IAKC169IDQOWE77sCHnQ10kpVpXvEZgCeJGAV
tqp8A8/xdzvD1dEapwOK3q4=
=Vjlr
-END PGP SIGNATURE-
___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Martin Aspeli
Hermann Himmelbauer wrote:
> Am Donnerstag 28 August 2008 02:35:28 schrieb Marius Gedminas:
>> On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote:
>>> On Wednesday 27 August 2008, Martin Aspeli wrote:
 This means that if the request contains the empty-marker only (no
 selection was made) for a checkbox widget (say), then the return value
 is [], rather than default (NOVALUE).

 Is that a bug? I have a custom checkbox widget derived from the
 standard checkbox widget, (z3c.formwidget.query, in fact), and I never
 get any "required missing" exceptions, even when I untick all the
 checkboxes and click OK.

 Am I missing something?
>>> I think you have a point. Have you tried changing the behavior to
>>> return "default" and see what tests fail? If no major failures come out
>>> of this, I would say change it.
>> Wait a second, maybe I'm misunderstanding this, but I certainly oppose
>> any change that would make an unchecked checkbox an error during form
>> validation.
>>
>> A required Bool field can have two values: True or False.  One is
>> represented by a checked checkbox, the other by an unchecked checkbox.
>> An unchecked checkbox is not missing input and should not trigger
>> "required missing" errors.
> 
> I see this the same way - in my application I have a similar case (Accept 
> some 
> policy by a checkbox-click). I solved this simply by checking the value in 
> the action handler and raising a WidgetExecutionError if it is unchecked.

The notion of a "required" boolean field is a bit weird anyway.

I think you *could* interpret it so that a boolean field that's required 
really means "you have to tick this box" (e.g. an "I agree to these 
terms and conditions" type scenario).

To put it the other way - how would you have a non-required boolean 
field represented by a checkbox? You really need three states then: True 
False and None, which you can't get with a checkbox.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Martin Aspeli
Stephan Richter wrote:
> On Thursday 28 August 2008, Martin Aspeli wrote:
>> I suspect that we just need widget.SequenceWidget in z3c.form to have a
>> special case for len(self.terms)==1, i.e. it's a checkbox with only one
>> option, or maybe a special case for a BooleanField, or indeed have
>> different widgets for Boolean and ICollection fields.
> 
> Widgets should not make these sort of decisions. I think this is the 
> responsibility of the data converter. I am pretty sure that writing more 
> specific data converters will solve our problem.

In the implementation of extract() in the SequenceWidget(), the 
extract() method does this:

 def extract(self, default=interfaces.NOVALUE):
 """See z3c.form.interfaces.IWidget."""
 if (self.name not in self.request and
 self.name+'-empty-marker' in self.request):
 return []
 value = self.request.get(self.name, default)
 if value != default:
 for token in value:
 if token == self.noValueToken:
 continue
 try:
 self.terms.getTermByToken(token)
 except LookupError:
 return default
 return value


It's the 'return []' that's the problem, i.e. it's treating the return 
value when empty-marker is in place as something other than the 
'default' that the base widget class will use when the field isn't in 
the request:

 def extract(self, default=interfaces.NOVALUE):
 """See z3c.form.interfaces.IWidget."""
 return self.request.get(self.name, default)

I think to get those same semantics for sequence fields, we'll need 
something in the extract() method.

I also don't quite understand why we use [] and not NOVALUE, even when 
the field isn't required. It seems to me that the BooleanField case is 
the special case. In fact, it's somewhat weird that a BooleanField, 
which is scalar, should default to using a SequenceWidget.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Stephan Richter
On Thursday 28 August 2008, Martin Aspeli wrote:
> I suspect that we just need widget.SequenceWidget in z3c.form to have a
> special case for len(self.terms)==1, i.e. it's a checkbox with only one
> option, or maybe a special case for a BooleanField, or indeed have
> different widgets for Boolean and ICollection fields.

Widgets should not make these sort of decisions. I think this is the 
responsibility of the data converter. I am pretty sure that writing more 
specific data converters will solve our problem.

Thoughts?

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. "Zope Stephan Richter"
___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Martin Aspeli
Hermann Himmelbauer wrote:
> Am Donnerstag 28 August 2008 10:14:11 schrieb Martin Aspeli:
>> Marius Gedminas wrote:
>>> On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote:
 On Wednesday 27 August 2008, Martin Aspeli wrote:
> This means that if the request contains the empty-marker only (no
> selection was made) for a checkbox widget (say), then the return value
> is [], rather than default (NOVALUE).
>
> Is that a bug? I have a custom checkbox widget derived from the
> standard checkbox widget, (z3c.formwidget.query, in fact), and I never
> get any "required missing" exceptions, even when I untick all the
> checkboxes and click OK.
>
> Am I missing something?
 I think you have a point. Have you tried changing the behavior to
 return "default" and see what tests fail? If no major failures come out
 of this, I would say change it.
>>> Wait a second, maybe I'm misunderstanding this, but I certainly oppose
>>> any change that would make an unchecked checkbox an error during form
>>> validation.
>>>
>>> A required Bool field can have two values: True or False.  One is
>>> represented by a checked checkbox, the other by an unchecked checkbox.
>>> An unchecked checkbox is not missing input and should not trigger
>>> "required missing" errors.
>> What about the case when you have a list of options of which you need to
>> chose one or more? In that case, ticking none is a validation error.
> 
> Yes, in your case this should give a validation error. However, the case 
> where 
> someone uses a checkbox for a True/False operation is at least as common. And 
> if "no ticking" gives a validation error, this would prevent using checkboxes 
> for this case. Moreover, a checkbox is typically used to represent a "Bool" 
> schema (by default it's a choice widget, I think), so that fits well, I 
> think. 
> 
> My suggestion would be to:
> 
> - Create some schema field, e.g. "MultipleChoice":
> 
> colors = MutlipleChoice(title='Colors', values=['red', 'green', 'blue'], 
> default=['green', 'blue'], required=True)
> 
> - Register a widget for this field, which is then rendered as a bunch of 
> checkboxes.

We already have such a field - it's an ICollection field with a Choice 
value_type.

I suspect that we just need widget.SequenceWidget in z3c.form to have a 
special case for len(self.terms)==1, i.e. it's a checkbox with only one 
option, or maybe a special case for a BooleanField, or indeed have 
different widgets for Boolean and ICollection fields.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

___
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] SVN: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt as it seems impossible to upload umlauts in long_description to pypi using distutils, so I had to replace the umlauts

2008-08-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jacob Holm wrote:
> This looks like a bad idea.  You are weakening the test by removing 
> non-ascii chars here.  A better approach would have been to rewrite the 
> non-ascii chars using \N (or \u or \U) escapes.

Evem worse:  the motivation is due to a spurious inclusion of all the
doctests in the long_description of the package:  no test with any
version of the code below should be on the package page at PyPI:  this
test is not "documenting" anything.

> Michael Howitz wrote:
>> Log message for revision 90434:
>>   as it seems impossible to upload umlauts in long_description to pypi using 
>> distutils, so I had to replace the umlauts
>>
>> Changed:
>>   U   zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
>>
>> -=-
>> Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
>> ===
>> --- zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
>> 2008-08-27 11:44:57 UTC (rev 90433)
>> +++ zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
>> 2008-08-27 11:49:47 UTC (rev 90434)
>> @@ -18,8 +18,8 @@
>>  ===
>>  
>>>>> zc.sourcefactory.browser.token.fromUnicode(
>> -  ... u'somestring with umlauts öäü')
>> -  '45dadc304e0d6ae7f4864368bad74951'
>> +  ... u'somestring with strange chars #*&_;)')
>> +  'f33b8a6b56403c9d560e2ef772336798'


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFItvxu+gerLs4ltQ4RAqLmAJ40Y4KPOV5v8p5PEqXg/fmVbrHbQgCdEoOA
yugJIdCWRjiLC+uqF7f5EXg=
=y50C
-END PGP SIGNATURE-

___
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] SVN: Zope2.buildout/trunk/ Don't pin setuptools.

2008-08-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Florian Schulze wrote:
> Log message for revision 90415:
>   Don't pin setuptools.
>   Moved zope3.cfg to versions-zope3.cfg.
>   Added some missing files from the Zope2 trunk.
>   Added dummy script which will be used to create lib/python.



> Modified: Zope2.buildout/trunk/buildout.cfg
> ===
> --- Zope2.buildout/trunk/buildout.cfg 2008-08-27 09:32:04 UTC (rev 90414)
> +++ Zope2.buildout/trunk/buildout.cfg 2008-08-27 09:33:59 UTC (rev 90415)
> @@ -6,20 +6,12 @@
>  test
>  omelette
>  find-links = http://download.zope.org/distribution/
> -unzip = true

I don't think zipped eggs are a win in any real scenario, except
possibly the goofy file-count-limited GAE.  I would strongly prefer that
you revert this one change (you can override it in your own
'~/.buildout/default.cfg').


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFItvsO+gerLs4ltQ4RAhyAAJsHs5HAQkPXNJvsfD0iFZeklVS4SgCffjyb
aptTF4I+sOOeCSJV2uMuIm0=
=vILK
-END PGP SIGNATURE-

___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Marius Gedminas
On Thu, Aug 28, 2008 at 05:26:20PM +0200, Hermann Himmelbauer wrote:
> Am Donnerstag 28 August 2008 10:14:11 schrieb Martin Aspeli:
> > What about the case when you have a list of options of which you need to
> > chose one or more? In that case, ticking none is a validation error.
> 
> Yes, in your case this should give a validation error. However, the case 
> where 
> someone uses a checkbox for a True/False operation is at least as common. And 
> if "no ticking" gives a validation error, this would prevent using checkboxes 
> for this case. Moreover, a checkbox is typically used to represent a "Bool" 
> schema (by default it's a choice widget, I think), so that fits well, I 
> think. 
> 
> My suggestion would be to:
> 
> - Create some schema field, e.g. "MultipleChoice":
> 
> colors = MutlipleChoice(title='Colors', values=['red', 'green', 'blue'], 
> default=['green', 'blue'], required=True)

colors = Set(type=u"Choose your favourite colors",
 value_type=Choice(values=['red', 'green', 'blue']),
 min_length=1)

> - Register a widget for this field, which is then rendered as a bunch of 
> checkboxes.

I think there is a multi-selection widget based on checkboxes, that
works on Sets of Choices.  It's not the default widget (the default is a
multi-selection list box), and while it is registered as being valid for
sets, it always tries to store a list in the content object.

I'm writing from memory, so I may have gotten some details wrong.

Marius Gedminas
-- 
The typewriter was invented by Hungarian immigrant Qwert Yuiop, who left his
"signature" on the keyboard.
-- "Kim"


signature.asc
Description: Digital signature
___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Stephan Richter
On Wednesday 27 August 2008, Marius Gedminas wrote:
> > I think you have a point. Have you tried changing the behavior to
> > return "default" and see what tests fail? If no major failures come out
> > of this, I would say change it.
>
> Wait a second, maybe I'm misunderstanding this, but I certainly oppose
> any change that would make an unchecked checkbox an error during form
> validation.
>
> A required Bool field can have two values: True or False.  One is
> represented by a checked checkbox, the other by an unchecked checkbox.
> An unchecked checkbox is not missing input and should not trigger
> "required missing" errors.

Good point. I am going to watch the discussion a little more. :-)

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. "Zope Stephan Richter"
___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Hermann Himmelbauer
Am Donnerstag 28 August 2008 10:14:11 schrieb Martin Aspeli:
> Marius Gedminas wrote:
> > On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote:
> >> On Wednesday 27 August 2008, Martin Aspeli wrote:
> >>> This means that if the request contains the empty-marker only (no
> >>> selection was made) for a checkbox widget (say), then the return value
> >>> is [], rather than default (NOVALUE).
> >>>
> >>> Is that a bug? I have a custom checkbox widget derived from the
> >>> standard checkbox widget, (z3c.formwidget.query, in fact), and I never
> >>> get any "required missing" exceptions, even when I untick all the
> >>> checkboxes and click OK.
> >>>
> >>> Am I missing something?
> >>
> >> I think you have a point. Have you tried changing the behavior to
> >> return "default" and see what tests fail? If no major failures come out
> >> of this, I would say change it.
> >
> > Wait a second, maybe I'm misunderstanding this, but I certainly oppose
> > any change that would make an unchecked checkbox an error during form
> > validation.
> >
> > A required Bool field can have two values: True or False.  One is
> > represented by a checked checkbox, the other by an unchecked checkbox.
> > An unchecked checkbox is not missing input and should not trigger
> > "required missing" errors.
>
> What about the case when you have a list of options of which you need to
> chose one or more? In that case, ticking none is a validation error.

Yes, in your case this should give a validation error. However, the case where 
someone uses a checkbox for a True/False operation is at least as common. And 
if "no ticking" gives a validation error, this would prevent using checkboxes 
for this case. Moreover, a checkbox is typically used to represent a "Bool" 
schema (by default it's a choice widget, I think), so that fits well, I 
think. 

My suggestion would be to:

- Create some schema field, e.g. "MultipleChoice":

colors = MutlipleChoice(title='Colors', values=['red', 'green', 'blue'], 
default=['green', 'blue'], required=True)

- Register a widget for this field, which is then rendered as a bunch of 
checkboxes.

Best Regards,
Hermann


-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
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] zopeproject generated zope3 app and mod_wsgi

2008-08-28 Thread Fernando Correa Neto
Hello there,

First off all, I don't have a blog so I'll be posting it here.

Yesterday I decided to setup a zopeproject generated app with mod_wsgi
and I would like to share my experience.
I am going to skip the part of setting up mod_wsgi with apache because
I think this very well documented.

My environment:

zopeproject generated app sitting at:

   /opt/zope3/app

using python located at:

   /usr/local

buildout-eggs located at:

  /opt/buildout-eggs

For testing purposes, I've added www.foo.com to my /etc/hosts so when
I tried to reach www.foo.com it would resolve to my local machine.

Then we have virtual hosting config (www.foo.com.config in my test case) :

WSGIRestrictStdout Off
WSGIPythonHome /usr/local
WSGIDaemonProcess foo user=fcorrea group=users threads=1
maximum-requests=1 python-path=/opt/buildout-eggs/


 ServerName www.foo.com
 WSGIScriptAlias /site /opt/zope3/app/bin/zope3.wsgi
 WSGIProcessGroup foo
 WSGIPassAuthorization On
 WSGIReloadMechanism Process
 SetEnv HTTP_X_VHM_HOST http://www.foo.com/site
 SetEnv PASTE_CONFIG /opt/zope3/app/deploy.ini


I created this file based on the one that Carlos de la Guardia created
for grok and did some minor changes to make it work for zope3.

Things I needed to do:

Add the  WSGIRestrictStdout Off directive because for some reason zope
was trying to write something to sys.stdout and mod_wsgi didn't let it
do it.
Modify WSGIPythonHome and pointed to my custom python installation
Modify WSGIDaemonProcess and set python-path to my buildout-eggs directory

It turns out that zopeproject doesn't generate a .wsgi file for you so
you need to create one and it need to look like this:

(zope3.wsgi file based on the one repoze.grok generates)

import os, sys
sys.path.append('/opt/zope3/app/src')
from paste.deploy import loadapp

ini = '/opt/zope3/app/deploy.ini'
application = loadapp('config:%s' % ini)

Well, at this point I thought I was good to go and figured that
something was still missing.
After getting IOErros with zope trying to write logs to
/home/fcorrea/logs/z3.log instead of /opt/zope3/app/log/z3.log, I
rushed to repoze IRC channel and asked for help since they are leading
zope on wsgi stuff.
Chris McDonough again provided some guidance on trying to debug and
asked me to change the user and check if zope would try to write the
logs into that user's home directory and he was right.
That pointed me out that I needed to hardcode the z3.log and Data.fs
paths in my /opt/zope3/app/zope.conf so it would look like this:

  
  path /opt/zope3/app/log/z3.log
  formatter zope.exceptions.log.Formatter
  

Instead of the defaults generated by zopeproject that looks like this:

  
  path log/z3.log
  formatter zope.exceptions.log.Formatter
  

After changing the paths I thought I was going to see my nice app's
front page in there but there was one more error in apache's log
related to apidoc.


[Thu Aug 28 12:06:13 2008] [error] [client 127.0.0.2]
ZopeXMLConfigurationError: File "/opt/zope3/app/apidoc.zcml", line
3.2-3.60
[Thu Aug 28 12:06:13 2008] [error] [client 127.0.0.2]
ConfigurationError: ('Invalid value for', 'package', 'ImportError:
Module zope.app has no global preference')

For some reason, apidoc didn't work with my mod_wsgi setup..but heck,
I was going production with the website so who cares about apidoc
right now anyway? So that's what I did. Went back to my
/opt/zope3/app/site.zcml and commented out the apidoc snippet, which
recommends you to turn it off when going production BTW.

So that's it. It is working now and it took me about 1.5h to get it
going and I still don't know if I did it correctly. Does anyone have
any feedback on this? Anyone running plain zope3 with mod_wsgi?
I would be interested in feedback on how to improve this.

Best Regards,
Fernando
___
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] [Checkins] SVN: zope.size/trunk/bootstrap.py Added support to bootstrap on Jython.

2008-08-28 Thread Benji York
On Wed, Aug 27, 2008 at 7:46 PM, Georgy Berdyshev
<[EMAIL PROTECTED]> wrote:
> Log message for revision 90507:
>  Added support to bootstrap on Jython.

It strikes me that if you're going to be doing this for a lot of
packages, you might be better off setting up an external to the
canonical bootstrap script and just fixing it.

It'll have to be an external to
svn+ssh://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap since
Subversion doesn't do externals to individual files.

The zope.introspector project is one example taking this approach:
svn+ssh://svn.zope.org/repos/main/zope.introspector/trunk
-- 
Benji York
Senior Software Engineer
Zope Corporation
___
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] zope.testing.doctest bug

2008-08-28 Thread Benji York
On Thu, Aug 28, 2008 at 6:35 AM, Chris Withers <[EMAIL PROTECTED]> wrote:
> The problem is that the function prints output before raising the
> exception. If I take the printed output away, the doctest passes fine.
> However, especially with dumym fixtures common in doctests, that printed
> output needs to be seen to test that things are happening as they should
> prior to the exception being raised.

For the forked doctest in zope.testing, the Zope 3 project's bug tracker
in Launchpad would be appropriate.

I suspect Python's doctest has the same bug; checking that and reporting
the bug to them would be good too.  They may have already fixed it, if
so we can copy their fix.
-- 
Benji York
Senior Software Engineer
Zope Corporation
___
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] Zope Tests: 4 OK, 1 Unknown

2008-08-28 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Wed Aug 27 11:00:00 2008 UTC to Thu Aug 28 11:00:00 2008 UTC.
There were 5 messages: 5 from Zope Tests.


Unknown
---

Subject: UNKNOWN : Zope-2.8 Python-2.3.6 : Linux
From: Zope Tests
Date: Wed Aug 27 20:40:12 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010075.html


Tests passed OK
---

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Wed Aug 27 20:41:42 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010076.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Wed Aug 27 20:43:12 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010077.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Wed Aug 27 20:44:44 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010078.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Wed Aug 27 20:46:14 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010079.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] zope.testing.doctest bug

2008-08-28 Thread Chris Withers
Hi All,

Here's an example from a python interpretter session:

Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> def test():
...   print "hello"
...   raise Exception()
...
 >>> test()
hello
Traceback (most recent call last):
   File "", line 1, in ?
   File "", line 3, in test
Exception

...which doesn't behave the same as a doctest:

Failed example:
 test()
Exception raised:
 Traceback (most recent call last):
   File "zope.testing-3.6.0-py2.4.egg\zope\te
sting\doctest.py", line 1356, in __run

   File "", line 1, in ?
 test()
   File "", line 3, in test
 raise Exception()
 Exception

The problem is that the function prints output before raising the 
exception. If I take the printed output away, the doctest passes fine.
However, especially with dumym fixtures common in doctests, that printed 
output needs to be seen to test that things are happening as they should 
prior to the exception being raised.

Where should I log this bug?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Martin Aspeli
Marius Gedminas wrote:
> On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote:
>> On Wednesday 27 August 2008, Martin Aspeli wrote:
>>> This means that if the request contains the empty-marker only (no
>>> selection was made) for a checkbox widget (say), then the return value
>>> is [], rather than default (NOVALUE).
>>>
>>> Is that a bug? I have a custom checkbox widget derived from the standard
>>> checkbox widget, (z3c.formwidget.query, in fact), and I never get any
>>> "required missing" exceptions, even when I untick all the checkboxes and
>>> click OK.
>>>
>>> Am I missing something?
>> I think you have a point. Have you tried changing the behavior to 
>> return "default" and see what tests fail? If no major failures come out of 
>> this, I would say change it.
> 
> Wait a second, maybe I'm misunderstanding this, but I certainly oppose
> any change that would make an unchecked checkbox an error during form
> validation.
> 
> A required Bool field can have two values: True or False.  One is
> represented by a checked checkbox, the other by an unchecked checkbox.
> An unchecked checkbox is not missing input and should not trigger
> "required missing" errors.

What about the case when you have a list of options of which you need to 
chose one or more? In that case, ticking none is a validation error.

Martin


-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

___
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] [Checkins] SVN: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt as it seems impossible to upload umlauts in long_description to pypi using distutils, so I had to replace t

2008-08-28 Thread Christian Theune
On Wed, 2008-08-27 at 17:07 +0200, Michael Howitz wrote:
> Am 27.08.2008 um 14:21 wrote Jacob Holm:
> 
> > This looks like a bad idea.  You are weakening the test by removing  
> > non-ascii chars here.  A better approach would have been to rewrite  
> > the non-ascii chars using \N (or \u or \U) escapes.
> 
> According to Christian Then this suggestion does not help as the test  
> should test real umlauts.
> So I'll try harder on preparing the long_description (encoding it to  
> unicode by myself before distutils tries to do) and revert the test.

No, my suggestion was that this wouldn't fix your issue with distutils.
(Only work around it).

Encoding them using \NN would allow the doctest to ignore any encoding
of the source file as the unicode would be *represented* by ascii
characters.

This would then display correctly on PyPI though ... hmm. 

-- 
Christian Theune · [EMAIL PROTECTED]
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: This is a digitally signed message part
___
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] z3c.form - extraction from sequence widget

2008-08-28 Thread Hermann Himmelbauer
Am Donnerstag 28 August 2008 02:35:28 schrieb Marius Gedminas:
> On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote:
> > On Wednesday 27 August 2008, Martin Aspeli wrote:
> > > This means that if the request contains the empty-marker only (no
> > > selection was made) for a checkbox widget (say), then the return value
> > > is [], rather than default (NOVALUE).
> > >
> > > Is that a bug? I have a custom checkbox widget derived from the
> > > standard checkbox widget, (z3c.formwidget.query, in fact), and I never
> > > get any "required missing" exceptions, even when I untick all the
> > > checkboxes and click OK.
> > >
> > > Am I missing something?
> >
> > I think you have a point. Have you tried changing the behavior to
> > return "default" and see what tests fail? If no major failures come out
> > of this, I would say change it.
>
> Wait a second, maybe I'm misunderstanding this, but I certainly oppose
> any change that would make an unchecked checkbox an error during form
> validation.
>
> A required Bool field can have two values: True or False.  One is
> represented by a checked checkbox, the other by an unchecked checkbox.
> An unchecked checkbox is not missing input and should not trigger
> "required missing" errors.

I see this the same way - in my application I have a similar case (Accept some 
policy by a checkbox-click). I solved this simply by checking the value in 
the action handler and raising a WidgetExecutionError if it is unchecked.

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
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] [Checkins] SVN: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt as it seems impossible to upload umlauts in long_description to pypi using distutils, so I had to replace t

2008-08-28 Thread Michael Howitz
Am 27.08.2008 um 14:21 wrote Jacob Holm:

> This looks like a bad idea.  You are weakening the test by removing  
> non-ascii chars here.  A better approach would have been to rewrite  
> the non-ascii chars using \N (or \u or \U) escapes.

According to Christian Then this suggestion does not help as the test  
should test real umlauts.
So I'll try harder on preparing the long_description (encoding it to  
unicode by myself before distutils tries to do) and revert the test.

Yours sincerely,
-- 
Michael Howitz · [EMAIL PROTECTED] · 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
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 )