Re: [Zope-dev] Status of github migration

2013-01-10 Thread Alexandre Garel

Le 10/01/2013 11:23, Patrick Gerken a écrit :

Hi,

I wanted to fix some logging in Products.SiteErrorLog, but I am 
confused where to go to.


here it is, part of Zope module : 
http://svn.zope.org/Zope/trunk/src/Products/SiteErrorLog/


___
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] Request for comment on zope.schema patch for bug 969350

2012-04-02 Thread Alexandre Garel

Le 30/03/2012 22:54, Marius Gedminas a écrit :

On Fri, Mar 30, 2012 at 06:36:13PM +0200, Alexandre Garel wrote:

Hello,

I fill a bug report for zope.schema :

"zope.schema does not handle well nested object fields"
https://bugs.launchpad.net/zope.schema/+bug/969350

my patch change a particular behaviour (binding of Choice field
nested in Object field)

I explain why on the ticket.

Any comment would be appreciated.

Here's the diff attached to that bug:


Thanks for taking time.

As you can see below I'm ok for all your comment but one, which needs 
further discussion.



Index: src/zope/schema/tests/test_objectfield_nested.py
===
--- src/zope/schema/tests/test_objectfield_nested.py(révision 0)
+++ src/zope/schema/tests/test_objectfield_nested.py(révision 0)
@@ -0,0 +1,74 @@
+##
+#
+# Copyright (c) 2001, 2002 Zope Foundation and Contributors.

Probably should be 2012 ;)


Hum copy/paste killed me :-)


+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##
+"""This test exercises Object fields in the case of nestment inside list

s/netsment/nesting/, although the sentence could use some rewriting.


ok for nesting

+to verify binding correcly happens at validation time
+"""
+
+from unittest import TestCase, TestSuite, main, makeSuite
+
+from zope.interface import Interface, implementer
+from zope.schema import Choice, Object, Set
+from zope.schema.interfaces import IContextSourceBinder, WrongContainedType
+from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
+from zope.testing.cleanup import CleanUp
+
+
+@implementer(IContextSourceBinder)
+class EnumContext(object):
+
+def __call__(self, context):
+return SimpleVocabulary([
+SimpleTerm(value=v, token=v, title='Letter %s' % v)
+for v in context])
+
+
+class IMultipleChoice(Interface):
+choices = Set(value_type=Choice(source=EnumContext()))
+
+
+@implementer(IMultipleChoice)
+class Choices(object):
+
+def __iter__(self):
+return iter(range(5))  # to have EnumSource work

EnumSource?  Do you mean EnumContext?


Yes, I'll correct


+
+def __init__(self, choices):
+self.choices = choices
+
+
+class IFavorites(Interface):
+fav = Object(title=u"Favorites number", schema=IMultipleChoice)
+
+
+class ObjectNestedTest(CleanUp, TestCase):
+"""Test the Object Field in cases of nested fields"""
+
+def test_validate_nested(self):
+context = range(5)

This is a bit confusing.  IField.bind() is usually passed a context that
is an object that has an attribute with that field.  You're passing a
list of numbers.  Would the test also work if you had context = object()?
In fact as I just wan't to test validation, I did use a range. I would 
of course work with an object which is iterable (because EnumContext 
needs it)

+# must not raise
+IFavorites['fav'].bind(context).validate(Choices(set([1, 3])))
+# checking against dictionnary do work

I don't see any dictionaries...  Perhaps you meant 'checking of set
values against the source works'?

Hum sorry, that may be a copy/paste remainder there again :-/


+self.assertRaises(
+WrongContainedType,
+IFavorites['fav'].bind(context).validate, Choices(set([1, 8])))
+
+
+def test_suite():
+suite = TestSuite()
+suite.addTest(makeSuite(ObjectNestedTest))
+return suite
+
+
+if __name__ == '__main__':
+main(defaultTest='test_suite')
Index: src/zope/schema/_field.py
===
--- src/zope/schema/_field.py   (révision 124803)
+++ src/zope/schema/_field.py   (copie de travail)
@@ -492,12 +492,7 @@
  if not IMethod.providedBy(schema[name]):
  try:
  attribute = schema[name]
-if IChoice.providedBy(attribute):
-# Choice must be bound before validation otherwise
-# IContextSourceBinder is not iterable in validation
-bound = attribute.bind(value)
-bound.validate(getattr(value, name))
-elif IField.providedBy(attribute):
+if IField.providedBy(attribute):

[Zope-dev] Request for comment on zope.schema patch for bug 969350

2012-03-30 Thread Alexandre Garel

Hello,

I fill a bug report for zope.schema :

"zope.schema does not handle well nested object fields"
https://bugs.launchpad.net/zope.schema/+bug/969350

my patch change a particular behaviour (binding of Choice field nested 
in Object field)


I explain why on the ticket.

Any comment would be appreciated.

Alex

___
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 4 release management

2012-02-01 Thread Alexandre Garel

Le 01/02/2012 14:21, Lennart Regebro a écrit :


I do think the big issue is where to host it. Yes, fine, people have
opinions on git vs svn vs hg, etc. But that boils down to 25%
technical arguments, 25% what you are used to 25% what everyone else
uses and then 30% religion to make sure the bucket overflows.


Disclaimer : Though I use zope libs every day, I'm not a comitter nor 
member of foundation.


I'm a bit amazed by this argumentation. I think one important thing is 
that subversion is centralized while dvcs are not.


With dvcs everyone got full history of zope libs. I personally find it a 
big pro for a free software.
More over with dvcs someone may fork a product on his side (a branch of 
his own, not on a zope server) and make it evolve, still having ability 
to merge updates (and auto merge in dvcs are superior to the one found 
in subversion).


All I see here is usability not religion ;-)

Now about github, I may say that gitorious.org exists and is 
free-software and gitosis + gitweb are on most linux distribs and offers 
same features as today's zope svn. I think the same can be said for hg. 
But really github/bitbucket is just hosting, it's not like subversion, 
you got all your data and history at home also, so you can leave github 
as soon as you want (if you do not use other features).


Finally, moving a subversion repo to git is really easy (and I think 
it's the same with hg)


Hope this helps.

Alex

--
Alexandre Garel
06 78 33 15 37

___
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] beta.zope.org (www.zope.org relaunch project)

2011-05-10 Thread Alexandre Garel
Le 10/05/2011 17:11, Alexandre Garel a écrit :
> (...)
>
> """
> http://dolmen-project.org/ Dolmen is a web framework based upon some
> parts of grok and ztk. It targets advanced developers building custom
> applications.
> """
Sorry, it's http://www.dolmen-project.org/ instead of  
http://dolmen-project.org/

-- 
Alexandre Garel
06 65 04 50 81

___
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] beta.zope.org (www.zope.org relaunch project)

2011-05-10 Thread Alexandre Garel
Hello,

Thank for this new site, that's great work.

I would propose to add a "related projects" section in 
http://beta.zope.org/the-world-of-zope

This would be a place to site pyramid http://pylonsproject.org/ (for its 
use of ZCA and other ztk libs) and the dolmen project.

We prefer to be in related as our future will use only some parts of 
grok / ztk

"""
http://dolmen-project.org/ Dolmen is a web framework based upon some 
parts of grok and ztk. It targets advanced developers building custom 
applications.
"""

___
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 )