Re: [Zope-dev] (optional) CSRF protection in zope.formlib

2013-10-01 Thread Jan-Wijbrand Kolman

On 9/18/13 4:41 PM, Jan-Wijbrand Kolman wrote:

I've been working on CSRF protection for zope.formlib.


Anyone else interested in this feature?

We made an internal release of zope.formlib with this functionality and 
so far we found no issues in using it in production.


After updating zope.formlib's tests to also run on Python 3, I could 
merge this feature soon. Unless of course, someone objects :-)


kind regards, jw


___
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] (optional) CSRF protection in zope.formlib

2013-09-18 Thread Jan-Wijbrand Kolman

Hi,

I've been working on CSRF protection for zope.formlib.

I have a csrfprotection branch in my zope.formlib fork on github. The 
changes against the current zope.formlib mainline can be found here:


https://github.com/janwijbrand/zope.formlib/compare/csrfprotection

When creating form components based on zope.formlib.form.FormBase, one 
can enable this protection just by setting the attribute ``protected`` 
to True on the component.


This implementation is based on the following assumptions:

* We do not want to keep server-side state(!)

* An attacker that attempts CSRF cannot get to information stored in 
cookies that are meant for the domain of the (forged) request.


* The token stored in the cookie is sufficiently random and long, to be 
practically unguessable by the attacker.


* The form submit is deemed valid as long as the token in the cookie is 
identical to a hidden input value that is part of the form submit.


My questions:

* Do you find this feature useful enough to be, in principle, included 
in zope.formlib?


* I'd like to kindly request someone to review my branch and provide 
feedback.


The included test cases describe a few more questions and concerns about 
this implementation.


Thank you in advance!

kind regards, jw

___
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] (optional) CSRF protection in zope.formlib

2013-09-18 Thread Jan-Wijbrand Kolman

On 9/18/13 5:26 PM, Leonardo Rochael Almeida wrote:

+1 for implementing convenient CSRF.

I wonder if you could make your implementation more orthogonal by
implementing a CSRF field/widget, and make your `protected` attribute
simply trigger the inclusion of this field implicitly.

This way you wouldn't need to change the `*pageform.pt
http://pageform.pt` templates like you do now, and
`setupToken()`/`checkToken()` would move to the widget code.


I've considered and experimented with that approach. However, as soon as 
you do more complex things with setting up fields in your own form 
component, things potentially get hairy.


Furthermore, the form machinery tries to get values from the context 
object (in edit forms for example), for each field and tries to set 
values for this field on the context object when handling the submit. 
This would make handling this field special in way I didn't like.


But yes, the compromise in my implementation is, that you need to render 
the hidden input field yourself if you overwrite the default templates 
- and you most probably do.


For example, grok.formlib does bring its own default templates for 
forms. I'd need to update that package in case this implementation is 
accepted and lands.


regards, jw

___
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] github etiquette

2013-09-17 Thread Jan-Wijbrand Kolman

Hi,

I wonder if there is a formal or informal write-up of how to nicely 
contribute code to the repositories under the zopefoundation umbrella.


Back in the subversion days I would branch a project, amend code, write 
tests, commit this to the repository, ask for feedback on the list, and, 
when deemed acceptable, merge my changes back to the project's trunk, 
perhaps even make a release of the project.


Yesterday I wanted to add a small feature to zope.formlib and wondered 
whether I should:


1) clone the canonical zope.formlib repository, make a branch, do my 
work, push the changes, ask for feedback on the list and eventually 
merge the branch to the mainline.


or

2) fork the repository, make a branch in the fork, do my work, push the 
changes to my fork, and issue a pull request.


The latter is what I did, without explicitly asking for feedback. 
Luckily someone did give me feedback (thanks!) :-)


Now that I mended the pull request, should I merge the pull request 
myself? Or is the current etiquette that someone else should merge the 
pull request?


My apologies in case I missed an obvious document or reference somewhere 
that describes the way we should work with the zopefoundation's 
codebase...


kind regards, jw

___
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] github etiquette

2013-09-17 Thread Jan-Wijbrand Kolman

On 9/17/13 12:04 PM, Jan-Wijbrand Kolman wrote:
snip

2) fork the repository, make a branch in the fork, do my work, push the
changes to my fork, and issue a pull request.

The latter is what I did, without explicitly asking for feedback.
Luckily someone did give me feedback (thanks!) :-)

Now that I mended the pull request, should I merge the pull request
myself? Or is the current etiquette that someone else should merge the
pull request?


This is what I did just now.
Kind regards, jw

___
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] github etiquette

2013-09-17 Thread Jan-Wijbrand Kolman

On 9/17/13 1:00 PM, Marius Gedminas wrote:

On Tue, Sep 17, 2013 at 12:04:04PM +0200, Jan-Wijbrand Kolman wrote:

I wonder if there is a formal or informal write-up of how to
nicely contribute code to the repositories under the
zopefoundation umbrella.


I don't think so.  I'd like to see one.


I think we're writing it Right Now :-)

regards, jw


___
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] github etiquette

2013-09-17 Thread Jan-Wijbrand Kolman

On 9/17/13 1:47 PM, Jim Fulton wrote:

I strongly prefer that the reviewer do the merge.

I'd also really like reviewers to take their responsibility
seriously, making comments and suggestions where appropriate.

Software review, done well, improves the software, and, more
importantly, improves the developers.


I agree - I know I get better from recieving feedback :-)

Is this reviewer role something someone takes upon himself? I mean, if 
I see a pull request for a code base that I know, I could review the 
request?


Or do we acknowledge a group of people that generally do reviews (again 
formally of informally, I don't mind, I'm not looking for official 
procedures)?


In any case, a second pair of eyes before merging is very helpful!

regards, jw

p.s. Another thing I noticed: some of the discussion about changes and 
patches and fixes now shift from the mailinglist to github. This is 
fine, I guess.


___
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] github etiquette

2013-09-17 Thread Jan-Wijbrand Kolman

On 9/17/13 3:32 PM, Jim Fulton wrote:

On Tue, Sep 17, 2013 at 8:32 AM, Jan-Wijbrand Kolman

Is this reviewer role something someone takes upon himself? I mean, if I
see a pull request for a code base that I know, I could review the request?


These are good questions.  I probably don't have satisfying answers.

The short answer is that I think people who contribute to a project
should view review as one of their duties.  For better or worse, this is
somewhat informal.

If you don't get a review in a timely manner, try posting to the
appropriate mailing list to request a review.


Works for me :-)
regards, jw


___
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] Zope.schema extension with marker interface

2013-06-07 Thread Jan Van Hees
Hi

 

A bit of context first:

We have a zope application, using zope.schema to define our objects. The
problem is, we have circular references, units contain references to persons
and persons contain references to units.

For schema validation, this is solved by subclassing zope.schema.Object and
making it aware of reference objects and contained objects. So far so good.

 

Now I'm working on z3c.schema2json (originally by Paul Wilson), allowing
zope.schema defined objects to be converted to a dictionary structure. The
problem I encounter here is that there is no awareness of reference or
containment. This causes endless recursion going from person to unit back to
person back to unit, . .

 

A clean way to solve this, would be adding a marker interface
IReference/ILazyLoad, . ., to the reference objects. If the serializer
encounters the IReference interface, it can be skipped for serialization.
The same concept could probably be used for the schema validation.

 

To me the best place to add this marker interface is in
zope.shema.interfaces, because it's actually working on zope.schema. I'm
happy to fork zope.schema on github and make it working, but I'd like your
feedback on this, before I start working on it. 

 

Pro's, con's? Scenarios I miss?

 

 

___
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] request for more package migrations to github

2013-03-22 Thread Jan-Wijbrand Kolman

Hi,

Stephan, may I kindly request a few more package migrations to github?

Here's the list:

groktoolkit
grokcore.errorview
grokcore.permission
grokcore.registries
grokcore.resource
grokui.admin
hurry.query
hurry.workflow
z3c.bcrypt
zc.relation
zc.relationship
zopetoolkit

Thank you *very much* in advance!

regards, jw

___
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 more package migrations to github

2013-03-22 Thread Jan-Wijbrand Kolman

On 3/22/13 12:59 PM, Stephan Richter wrote:

On Friday, March 22, 2013 10:23:21 AM Jan-Wijbrand Kolman wrote:

zopetoolkit


Is everyone ok with me moving this? Hanno mentioned that several external
tools depend on the SVN location and the move was delayed because of that. I
think this package also does not have the traditional tags, branches, trunk
structure.


Aha, ok, sorry, I missed that part. It just struck me as odd that it 
wasn't converted yet. Do not take my word for it :-)



JW, I'll convert all other packages.


Great! Thanks!

regards, jw


___
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] procedures for moving package to github and porting to Python 3

2013-03-04 Thread Jan-Wijbrand Kolman

On 3/1/13 5:29 PM, Stephan Richter wrote:

On Friday, March 01, 2013 02:37:34 PM Jan-Wijbrand Kolman wrote:

 megrok.menu


It's done now, but it lost its 0.1 tag due to a conversion issue.


Great! And thanks again!


regards, jw


___
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] procedures for moving package to github and porting to Python 3

2013-03-01 Thread Jan-Wijbrand Kolman

Hi,

Disclaimer: it's been a while since I actively followed zope-dev and 
grok-dev. So, please forgive me my ignorance.


Spurred by the recent ZTK-2.0 discussion, I'm trying to get back on 
track on the topics of 1) migrating package to github and 2) porting 
packages to Python 3.


As a first step, I'd like to get the packages directly related to Grok 
moved over to github.


Could someone perhaps tell me if there's a guideline document, some kind 
of recipe, or perhaps a conclusive posting on the mailinglist on how 
to proceed on this topic?


Thanks in advance for any pointers!!

kind regards, jw

___
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] procedures for moving package to github and porting to Python 3

2013-03-01 Thread Jan-Wijbrand Kolman

On 3/1/13 10:17 AM, Marius Gedminas wrote:

On Fri, Mar 01, 2013 at 09:51:05AM +0100, Jan-Wijbrand Kolman wrote:

Disclaimer: it's been a while since I actively followed zope-dev and
grok-dev. So, please forgive me my ignorance.


A single up-to-date web page sure beats reading months of list archives.


:-)


Spurred by the recent ZTK-2.0 discussion, I'm trying to get back on
track on the topics of 1) migrating package to github and 2) porting
packages to Python 3.

As a first step, I'd like to get the packages directly related to
Grok moved over to github.

Could someone perhaps tell me if there's a guideline document, some
kind of recipe, or perhaps a conclusive posting on the mailinglist
on how to proceed on this topic?


My attempt at this: https://gist.github.com/mgedmin/4944724

AFAIK Stephan migrated most of the zope.* packages using this process.


Ok, thanks. I've read it, but will need to re-read it a couple of times 
more I guess :)


It seem to me the best next step would be to just pick a random 
grokcore.* package and to just try it. I'll pick, well, grokcore.component.


If I understand correctly, there's two things I need to ask someone to do:

* create a repository at https://github/zopefoundation/grokcore.component

* ask permission to use the authors.txt mapping svn usernames to real 
names and email addresses.


Again, thanks for the information.

regards, jw

___
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] procedures for moving package to github and porting to Python 3

2013-03-01 Thread Jan-Wijbrand Kolman

On 3/1/13 2:23 PM, Marius Gedminas wrote:

On Fri, Mar 01, 2013 at 11:24:31AM +0100, Jan-Wijbrand Kolman wrote:

On 3/1/13 10:17 AM, Marius Gedminas wrote:

My attempt at this: https://gist.github.com/mgedmin/4944724

AFAIK Stephan migrated most of the zope.* packages using this process.


Stephan tells me there are scripts at
https://github.com/zopefoundation/zope.githubsupport
that can do the entire process (create repo, convert history, upload
it), if you've the right permissions on Github (few people do).  So
perhaps the easiest thing is to ask for the package to be converted.


I just read Stephan's reply pointing to that script.

I have no idea whether I have the right permissions.

I do see someone just created an empty grokcore.component repository on 
github (thanks whoever did that! :-)  )


I could surely ask others to do the work for me, though I had the 
impression everyone could take care of the packages he/she cares about :-)


The list that I intended to start off with is roughly:

   grok
   grokcore.annotation
   grokcore.catalog
   grokcore.chameleon
   grokcore.component
   grokcore.content
   grokcore.formlib
   grokcore.json
   grokcore.layout
   grokcore.message
   grokcore.rest
   grokcore.security
   grokcore.site
   grokcore.startup
   grokcore.traverser
   grokcore.view
   grokcore.viewlet
   grokcore.xmlrpc
   grokproject
   grokui.admin
   grokui.base
   martian
   megrok.menu
   zope.errorview
   zope.fanstatic
   z3c.autoinclude
   z3c.evalexception
   z3c.flashmessage
   zc.catalog

Since the grokcore.component repo is there now, I'll follow my initial 
plan and try to get that migrated from svn to github as a first step.


kind regards, jw




___
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] procedures for moving package to github and porting to Python 3

2013-03-01 Thread Jan-Wijbrand Kolman

On 3/1/13 1:39 PM, Stephan Richter wrote:

AFAIK Stephan migrated most of the zope.* packages using this process.


Yes, I have, except that I use a one does it all script published here:

https://github.com/zopefoundation/zope.githubsupport


Aha, great!


All you need to do is to create a zope.cfg that works for you. I can quickly
create repositories for you if you send me a list of (pkg_name, pkg_title)
tuples.


I just compiled a list in another reply in this thread.


Jim will announce a secret location for the authors.txt file in the next days
on the ZF mailing list.


You mean the ZF mailinglist that only ZF members can join?

Thanks for the pointers so far!

regards, jw


___
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] procedures for moving package to github and porting to Python 3

2013-03-01 Thread Jan-Wijbrand Kolman

On 3/1/13 2:49 PM, Stephan Richter wrote:

On Friday, March 01, 2013 02:37:34 PM Jan-Wijbrand Kolman wrote:

I do see someone just created an empty grokcore.component repository on
github (thanks whoever did that! :-)  )


It is actually fully converted. :-)


LOL - cool!


I am going to adjust my script to allow mutliple conversions at once. I will
take care of your list.


Really?! Thanks!!

regards, jw

___
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] ZTK 2.0 process

2013-02-27 Thread Jan-Wijbrand Kolman
Hi,

On 2/26/13 5:04 PM, Hanno Schlichting wrote:
 Hi.
 
 The process for a ZTK 2.0 release isn't really well defined. I'm not
 sure if Jan-Wijbrand and Christophe are still interested in working on
 ZTK releases.

I'm personally and from a business-perspective still interested in the
ZTK and to have Grok to be a relevant (to the ZTK process) consumer of
the ZTK.

That said, I've been off of the radar for a while concerning the ZTK
because: 1) busy and 2) Grok's proven to be fairly stable and thus did
not need much maintenance for quite a while.

So:

* Thanks Stephan and Hanno to get this ball rolling again

* Thanks to whoever ported so many of the ZTK packages to Python 3 already!

* I'll need to blow of some dust from my ZTK-knowledge and how Grok is
using it to give you useful input to your questions.

regards, jw

___
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] ZTK 2.0 process

2013-02-27 Thread Jan-Wijbrand Kolman
Hi,

On 2/26/13 7:26 PM, Hanno Schlichting wrote:
snip
 Our rule for inclusion in the ZTK is: Whatever library is used by at
 least two out of the three frameworks (BlueBream, Grok, Zope).
 
 Given that BlueBream hasn't seen any release beyond a 1.0 about two
 years back, I'm not sure it's active or relevant anymore. Grok isn't
 seeing frequent releases, but there was a 1.5.5 mid last year.
 
 If you compare the version list from the last ZTK 1.1.5
 (http://download.zope.org/zopetoolkit/index/1.1.5/zopeapp-versions.cfg)
 and Grok 1.5.5 (http://grok.zope.org/releaseinfo/1.5.5/versions.cfg),
 you'll notice that Grok already overwrites the version requirement for
 half of the non-deprecated packages with its own versions. And as I
 said, Zope isn't using any of them anymore for a long time.
 
 So I don't see any value in testing and promising stability for those
 zope.app packages, when there aren't any shared consumers for the
 specific versions.
 
 And the actually used versions by Grok are:
 zope.app.applicationcontrol, zope.app.appsetup, zope.app.debug -
 renaming those to a non zope.app prefix doesn't make a lot of sense
 for me either - as they are all about a specific app server
 configuration and not generally reusable libraries.

Agreed, from a Grok perspective: if there is no shared interested
anymore in the zope.app.* packages, Grok will need to take up
maintainership for those itself. In a way we already did by upping the
versions of several of those package already.

The zope.app.* packages that really are in use for a vanilla Grok-based
application are zope.app.applicationcontrol, zope.app.appsetup and
zope.app.debug and zope.app.wsgi.

If there would be a strong drive from the Grok community to have Python
3 compatibility, they (and that includes me :) ) should port those
zope.app.* packages or build the equivalents.

I'll make note of this on the Grok dev list as well.

regards, jw





___
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.formlib's action decorator return Action() object, not the decorated function. Why?

2012-09-18 Thread Jan-Wijbrand Kolman
On 9/16/12 07:28 , Marius Gedminas wrote:
 On Fri, Sep 14, 2012 at 01:44:30PM +0200, Jan-Wijbrand Kolman wrote:
 The reason I came across this issue is trying to improve the test
 coverage of the application I'm building somewhat closer to 100% and
 found that the form actions implementation *appeared* not to be covered
 at all - even if there clearly are tests for these.
 
 How are you measuring coverage?

The coverage reports as generated by the zope.testrunner ``--coverage``
option, then z3c.coverage to render the reports into html.

 How are you testing the handlers?

In this specific case, I noticed the handlers seemed not be called
(according to the coverage report) when using a test browser
submitting a form.

But I didn't try anything else just yet except for running that test
again with a patched zope.formlib - where the decorated would return the
function - and then the coverage was up :-)

 I'm asking because I haven't encountered this issue in my projects --
 form action handlers show up in my test coverage just fine.
 
 I tried having the decorator just returning the function, and at least
 all zope.formlib's tests themselves do pass.

 Would anyone mind if I would change the behaviour of the decorator?
 
 I have unit tests that invoke view.handle_foo_button.handler() directly,
 because they assume zope.formlib's @action replaces the
 handle_foo_button method with an Action.  Your change would break my
 tests, but they would be trivial to fix, so my vote would be -0, with
 the request of a larger version bump to indicate backwards-incompatibility.

Ok, clear.

Thanks for the feedback!

regards, jw

___
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.formlib's action decorator return Action() object, not the decorated function. Why?

2012-09-18 Thread Jan-Wijbrand Kolman
On 9/16/12 09:38 , Wichert Akkerman wrote:
 On Sep 16, 2012, at 07:28, Marius Gedminas mar...@gedmin.as wrote:
 
 On Fri, Sep 14, 2012 at 01:44:30PM +0200, Jan-Wijbrand Kolman wrote:
 After years and years of heavily using zope.formlib it suddenly struck
 me that the zope.formlib.form.action decorator returns an Action()
 object instead of the decorated function (this action object is also
 added to the form's actions sequence as a side effect of the decorator).

 I know wonder: Why?

 (I've no clue.)
 
 Another effect of this is probably that you can use sphinx's autodoc for 
 actions which would be unfortunate.

Ah, good catch. Didn't think of that yet...
regards, jw


___
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] zope.formlib's action decorator return Action() object, not the decorated function. Why?

2012-09-14 Thread Jan-Wijbrand Kolman
Hi,

After years and years of heavily using zope.formlib it suddenly struck
me that the zope.formlib.form.action decorator returns an Action()
object instead of the decorated function (this action object is also
added to the form's actions sequence as a side effect of the decorator).

I know wonder: Why?

I cannot find a use case for wanting the action object added to the
class members under the name of the decorated function. But maybe there is?

The reason I came across this issue is trying to improve the test
coverage of the application I'm building somewhat closer to 100% and
found that the form actions implementation *appeared* not to be covered
at all - even if there clearly are tests for these.

I tried having the decorator just returning the function, and at least
all zope.formlib's tests themselves do pass.

Would anyone mind if I would change the behaviour of the decorator?

Kind regards, jw



___
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.intid and zope.keyreference.interfaces.NotYet exception (patch)

2012-07-04 Thread Jan-Wijbrand Kolman
On 7/3/12 15:06 , Hanno Schlichting wrote:
 On Tue, Jul 3, 2012 at 1:56 PM, Jan-Wijbrand Kolman
 janwijbr...@gmail.com wrote:
 At the end of this post, I pasted the diff from the current zope.intid
 trunk against your fork on bitbucket. Maybe this would make it easier
 for others to comment on it?
 
 It would be easier to read if you did the diff against the base
 version the fork was started from. Or otherwise update the fork with
 the changes done in the meantime.
 
 I see a bunch of unrelated changes in there, like the
 implements/implementer changes. I'm not sure what else is unrelated to
 the proposed change.

Ow, well, yes you are right. I didn't investigate too deeply either and
I do not know the revision the fork was based on. Maybe I just didn't
look hard enough.

I just wanted to see if we could get a little feedback by posting the
diff over here, instead for others to have to go through this just see
what the proposed changes are. Being the messenger so to say.

Did you stop looking at the diff once you noticed it was created
suboptimally? Would it help to find out the base revision and post a
diff again? I guess Cykooz would know the revision of the common base?

regards, jw



___
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.intid and zope.keyreference.interfaces.NotYet exception (patch)

2012-07-03 Thread Jan-Wijbrand Kolman
On 1/24/12 23:49 , Cykooz wrote:
 2012/1/25 Marius Gedminas mar...@gedmin.as:

 http://foundation.zope.org/agreements is where you can find the
 committer agreement form.
 
 Thanks.
 But I have one problem. I do not know any of the existing Committer
 who can vouch for me.

Bringing up a rather old thread:

Cykooz, was there any kind of follow up on this discussion? Are you
basically using a forked zope.keyreference for the time being?

Kind regards, jw


___
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-06-12 Thread Jan-Carel Brand
Hi Patrick

On Mon, 2012-06-11 at 18:36 +0200, Patrick Gerken wrote:

snip

 Since I most often look for the history of something in SVN, I decided
 to finally make a git mirror for myself to quickly find the history of
 anything I might ever want.
 Since its for history only, I just imported the complete SVN repo as
 one git repo. So this is cannot be used as an alternative source for
 mr.developer. It is really only useful for history searching.
 
 Just for the case that somebody else might have an interest, I put it
 on github. Cloning will not make your harddisk explode, but you should
 have at least 750K Inodes available. A little vserver I used
 initially, did not have that many inodes. My dev machine has 6M Inodes
 (df -ih shows that)
 
 Even with the full svn history, looking up the full history of some
 file is superfast, with a regular hdd even. git status is something I
 woudn't do again, and updating the repo from svn is quite slow.
 
 If anybody is interested, the repo is here:
 
 https://github.com/do3cc/zope

Thanks for taking the effort to do this. 

The fact that one can see code diffs with git log -p is for me a
killer feature.

Do you also sync the git repo with new changes from the svn repo?

J-C

___
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] New release for zope.schema

2012-03-23 Thread Jan-Carel Brand
On Thu, 2012-03-22 at 23:03 +0200, Marius Gedminas wrote:
 On Thu, Mar 22, 2012 at 07:04:29PM +0100, Jan-Carel Brand wrote:
  On Thu, 2012-03-22 at 19:39 +0200, Marius Gedminas wrote:
   $ virtualenv -p python3.2 py32
   $ py32/bin/python setup.py develop
   ... this takes a long time... I miss my buildout egg cache ...
   $ py32/bin/pip install zope.testrunner
   $ py32/bin/pip install zope.testing  # have to install test extras by 
   hand?
   $ py32/bin/zope-testrunner --test-path=src
   ...
   Ran 255 tests with 1 failures and 0 errors in 0.206 seconds.
  
  lol. Yeah, it took me a while to figure it out as well. 
  
  I instead ran: python setup.py test
  
  That also works.
 
 D'oh! :-)
 
  Yeah, as Brian mentioned:
  https://bugs.launchpad.net/zope.interface/+bug/911851
 
 Given that zope.schema already requires Python 2.6 or newer, I've committed
 this fix:
 
 --- src/zope/schema/tests/test_choice.py(revision 124693)
 +++ src/zope/schema/tests/test_choice.py(working copy)
 @@ -16,7 +16,7 @@
  import unittest
  
  from six import u
 -from zope.interface import implements
 +from zope.interface import implementer
  from zope.schema import vocabulary
  from zope.schema import Choice
  from zope.schema.interfaces import ConstraintNotSatisfied
 @@ -114,8 +114,8 @@ class Vocabulary_ChoiceFieldTests(unitte
  self.assertRaises(ValueError, choice.validate, value)
  
 
 +@implementer(IContextSourceBinder)
  class SampleContextSourceBinder(object):
 -implements(IContextSourceBinder)
  def __call__(self, context):
  return SampleVocabulary()


Thanks! That fixed the last bug.

I've now released zope.schema 4.1.0.
http://pypi.python.org/pypi/zope.schema/4.1.0

-JC 

___
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] New release for zope.schema

2012-03-23 Thread Jan-Carel Brand
On Fri, 2012-03-23 at 12:29 +0100, Jan-Carel Brand wrote:
 On Fri, 2012-03-23 at 12:16 +0100, Adam GROSZER wrote:
  Hello,
  
  On Thu, 22 Mar 2012 19:04:29 +0100 you wrote:
   Ok, I'll release tomorrow morning when I'm fresh.
  
  
  HOLD, winbot has a problem:
  
  FAILED : winbot / zope.schema_py_265_32
  Build: http://winbot.zope.org/builders/zope.schema_py_265_32/builds/454
 
 Oh! Damn. This is after the release.
 
 The error is this:
 
  ValueError: path 'src/zope/schema/tests/' cannot end with '/'
  
 Which seems related to the MANIFEST.in file I added.
 
 I've removed now the trailing slash. Hopefully that'll fix it.

Hi Adam

I guess you saw that Winbot is now happy again:
http://winbot.zope.org/builders/zope.schema_py_265_32/builds/456

This means we need a 4.1.1 release, right?

___
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] New release for zope.schema

2012-03-22 Thread Jan-Carel Brand
On Thu, 2012-03-22 at 12:19 +0100, Jan-Carel Brand wrote:

big snip

 Thanks for the review.
 
 I've committed my changes and ran the tests with Python 2.6 and 2.7. 
 I don't have Python 3.x handy but will compile the latest and test with
 that as well.

Ok, I tested zope.schema in python 3.2.2 and there were some errors in
test_vocabulary.py that I fixed.

They were all related to the KeysView and ValuesView objects (being
returned by keys() and values() on an OrderedDict) not being indexable.

There is however still one more error when testing with Python 3.2.2,
but this is related to the IContextSourceBinder validation changes made
by rogerineichen.

First the error:

 FAIL: test_validate_source
 (zope.schema.tests.test_choice.ContextSourceBinder_ChoiceFieldTests)
 --
 Traceback (most recent call last):
   File
 /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/tests/test_choice.py,
  line 133, in test_validate_source
 choice = Choice(source=s)
   File
 /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/_field.py,
 line 281, in __init__
 IContextSourceBinder.providedBy(vocabulary))
 AssertionError
 
The vocabulary is of type SampleContextSourceBinder from test_choice.py,
which does implement IContextSourceBinder.

 class SampleContextSourceBinder(object):
 implements(IContextSourceBinder)
 def __call__(self, context):
 return SampleVocabulary()
 
Looking at it in pdb:

 (Pdb) p vocabulary
 zope.schema.tests.test_choice.SampleContextSourceBinder object at
 0x3236310
 (Pdb) pp vocabulary.__provides__.__iro__
 (InterfaceClass zope.interface.Interface,)
 
Just to double-check, I looked at this vocabulary in Python 2.7:

 (Pdb) vocabulary.__provides__.__iro__
 (InterfaceClass zope.schema.interfaces.IContextSourceBinder,
 InterfaceClass zope.interface.Interface)
 
There it *does* provide IContextSourceBinder.

Any ideas why this vocabulary doesn't provide it in Python 3?

Regards
JC

___
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] New release for zope.schema

2012-03-22 Thread Jan-Carel Brand
On Thu, 2012-03-22 at 19:07 +0200, Marius Gedminas wrote:
 On Thu, Mar 22, 2012 at 12:19:39PM +0100, Jan-Carel Brand wrote:
  On Wed, 2012-03-21 at 19:58 +0200, Marius Gedminas wrote:
   Also, would you like to have PyPI access to zope.schema, so that you can
   do the release yourself?  If so, tell us your PyPI username.
  
  Sure, my pypi username is: jcbrand
 
 You now have PyPI access to zope.schema.
 
 
 One detail I may have forgotten to mention about the release process:
 sometimes setup.py sdist produces an incomplete archive.  This happens
 every time Subversion changes its working tree format, until somebody
 patches setuptools to understand it.  I think subversion 1.7 changed the
 format again; I don't know if setuptools can handle it yet -- I'm still
 on svn 1.6 myself.
 
 So it may be a good idea to run python setup.py sdist and compare the
 file list in dists/*.tar.gz with the file list in the current PyPI
 archive, before you actually do the release with fullrelease.  Actually
 zest.releaser's fullrelease has lots of continue? [y/n] prompts that
 let you do the inspection before the final upload.  I just feel better
 when I do it by hand, on those rare occasions when I'm not sure about
 the state of my setuptools after a distro upgrade.  YMMV.  And the
 chances of breakage are low, and people generally notice it pretty
 quickly, and uploading a fixed 4.1.1 is easy (edit MANIFEST.in to make
 sure everything is included), so I don't even know why I'm mentioning
 all this.  For completeness, I guess...

Thanks, it's helpful.

setuptools also doesn't play nicely with git. So I've had to edit
MANIFESET.in before. I'll double check manually.

There is however still the Python 3 bug in zope.schema. (See my previous
post).

___
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] New release for zope.schema

2012-03-22 Thread Jan-Carel Brand
On Thu, 2012-03-22 at 19:39 +0200, Marius Gedminas wrote:
 On Thu, Mar 22, 2012 at 03:27:20PM +0100, Jan-Carel Brand wrote:
  On Thu, 2012-03-22 at 12:19 +0100, Jan-Carel Brand wrote:
   Thanks for the review.
   
   I've committed my changes and ran the tests with Python 2.6 and 2.7. 
   I don't have Python 3.x handy but will compile the latest and test with
   that as well.
  
  Ok, I tested zope.schema in python 3.2.2 and there were some errors in
  test_vocabulary.py that I fixed.
 
 I'm in awe of your dedication.  I myself don't even know how to run the
 zope.schema testsuite under Python 3:
 
 $ python3.2 bootstrap.py 
   File bootstrap.py, line 63
 exec 
 urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
^
 SyntaxError: invalid syntax
 
 Well, ok, I may be exaggerating a bit.
 
 $ virtualenv -p python3.2 py32
 $ py32/bin/python setup.py develop
 ... this takes a long time... I miss my buildout egg cache ...
 $ py32/bin/pip install zope.testrunner
 $ py32/bin/pip install zope.testing  # have to install test extras by 
 hand?
 $ py32/bin/zope-testrunner --test-path=src
 ...
 Ran 255 tests with 1 failures and 0 errors in 0.206 seconds.

lol. Yeah, it took me a while to figure it out as well. 

I instead ran: python setup.py test

That also works.

  There is however still one more error when testing with Python 3.2.2,
  but this is related to the IContextSourceBinder validation changes made
  by rogerineichen.
  
  First the error:
  
   FAIL: test_validate_source
   (zope.schema.tests.test_choice.ContextSourceBinder_ChoiceFieldTests)
   --
   Traceback (most recent call last):
 File
   /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/tests/test_choice.py,
line 133, in test_validate_source
   choice = Choice(source=s)
 File
   /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/_field.py,
   line 281, in __init__
   IContextSourceBinder.providedBy(vocabulary))
   AssertionError
   
  The vocabulary is of type SampleContextSourceBinder from test_choice.py,
  which does implement IContextSourceBinder.
  
   class SampleContextSourceBinder(object):
   implements(IContextSourceBinder)
   def __call__(self, context):
   return SampleVocabulary()
   
  Looking at it in pdb:
  
   (Pdb) p vocabulary
   zope.schema.tests.test_choice.SampleContextSourceBinder object at
   0x3236310
   (Pdb) pp vocabulary.__provides__.__iro__
   (InterfaceClass zope.interface.Interface,)
   
  Just to double-check, I looked at this vocabulary in Python 2.7:
  
   (Pdb) vocabulary.__provides__.__iro__
   (InterfaceClass zope.schema.interfaces.IContextSourceBinder,
   InterfaceClass zope.interface.Interface)
   
  There it *does* provide IContextSourceBinder.
  
  Any ideas why this vocabulary doesn't provide it in Python 3?
 
 This smells like a bug in zope.interface, and not in zope.schema:
 
 $ py32/bin/python
 Python 3.2.2 (default, Sep  5 2011, 22:09:30) 
 [GCC 4.6.1] on linux2
 Type help, copyright, credits or license for more information.
  from zope.interface import Interface, implements
  class IFoo(Interface): pass
 ... 
  class Foo(object): implements(IFoo)
 ... 
  IFoo.implementedBy(Foo)
 False
  IFoo.providedBy(Foo())
 False
 
 In other words I don't think it should block the release of zope.schema.

Yeah, as Brian mentioned:
https://bugs.launchpad.net/zope.interface/+bug/911851

Ok, I'll release tomorrow morning when I'm fresh.

___
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] New release for zope.schema

2012-03-21 Thread Jan-Carel Brand
Hi folks

What needs to be done for a new release of zope.schema? (4.1)
And is there anything I can do to help speed it up?

Even just an alpha/beta release would be very helpful.

Thanks
JC
svn --non-interactive diff http://svn.zope.org/repos/main/zope.schema/tags/4.0.1 http://svn.zope.org/repos/main/zope.schema/trunk
Index: CHANGES.txt
===
--- CHANGES.txt	(.../tags/4.0.1)	(revision 124658)
+++ CHANGES.txt	(.../trunk)	(revision 124658)
@@ -2,6 +2,18 @@
 CHANGES
 ===
 
+4.1 (unreleased)
+--
+
+- Add TreeVocabulary for nested tree-like vocabularies.
+
+- Fix broken Object field validation where the schema contains a Choice with
+  ICountextSourceBinder source. In this case the vocabulary was not iterable
+  because the field was not bound and the source binder dien't return the 
+  real vocabulary. Added simple test for IContextSourceBinder validation. But a
+  test with an Object field with a schema using a Choice with
+  IContextSourceBinder is still missing.
+
 4.0.1 (2011-11-14)
 --
 
Index: setup.py
===
--- setup.py	(.../tags/4.0.1)	(revision 124658)
+++ setup.py	(.../trunk)	(revision 124658)
@@ -19,6 +19,7 @@
 Setup for zope.schema package
 
 import os
+import sys
 from setuptools import setup, find_packages
 
 def read(*rnames):
@@ -60,8 +61,18 @@
 suite.addTest(mod.test_suite())
 return suite
 
+REQUIRES = [
+'setuptools',
+'zope.interface = 3.6.0',
+'zope.event',
+'six',
+]
+
+if sys.version_info  (2 , 7):
+REQUIRES += ['ordereddict'],
+
 setup(name='zope.schema',
-  version = '4.0.1',
+  version = '4.1dev',
   url='http://pypi.python.org/pypi/zope.schema',
   license='ZPL 2.1',
   description='zope.interface extension for defining data schemas',
@@ -81,11 +92,8 @@
   namespace_packages=['zope',],
   extras_require={'test': ['zope.testing'],
   'docs': ['z3c.recipe.sphinxdoc']},
-  install_requires=['setuptools',
-'zope.interface = 3.6.0',
-'zope.event',
-'six',
-   ],
+  install_requires=REQUIRES,
+  
   classifiers=[
 Development Status :: 5 - Production/Stable,
 Intended Audience :: Developers,
Index: src/zope/schema/fields.txt
===
--- src/zope/schema/fields.txt	(.../tags/4.0.1)	(revision 124658)
+++ src/zope/schema/fields.txt	(.../trunk)	(revision 124658)
@@ -116,6 +116,9 @@
 The vocabulary interface is simple enough that writing a custom vocabulary is
 not too difficult itself.
 
+See for example zope.schema.vocabulary.TreeVocabulary for another
+IBaseVocabulary supporting vocabulary that provides a nested, tree-like structure.
+
 Choices and Collections
 ---
 
@@ -156,3 +159,4 @@
 
 This level of indirection may be unnecessary for some applications, and can be
 disabled with simple ZCML changes within `zope.app`.
+
Index: src/zope/schema/vocabulary.py
===
--- src/zope/schema/vocabulary.py	(.../tags/4.0.1)	(revision 124658)
+++ src/zope/schema/vocabulary.py	(.../trunk)	(revision 124658)
@@ -13,14 +13,19 @@
 ##
 Vocabulary support for schema.
 
+try:
+from collections import OrderedDict
+except:
+from ordereddict import OrderedDict
+
 from zope.interface.declarations import directlyProvides, implementer
 from zope.schema.interfaces import ValidationError
 from zope.schema.interfaces import IVocabularyRegistry
 from zope.schema.interfaces import IVocabulary, IVocabularyTokenized
+from zope.schema.interfaces import ITreeVocabulary
 from zope.schema.interfaces import ITokenizedTerm, ITitledTokenizedTerm
 
 # simple vocabularies performing enumerated-like tasks
-
 _marker = object()
 
 @implementer(ITokenizedTerm)
@@ -68,6 +73,7 @@
 if interfaces:
 directlyProvides(self, *interfaces)
 
+@classmethod
 def fromItems(cls, items, *interfaces):
 Construct a vocabulary from a list of (token, value) pairs.
 
@@ -80,8 +86,8 @@
 
 terms = [cls.createTerm(value, token) for (token, value) in items]
 return cls(terms, *interfaces)
-fromItems = classmethod(fromItems)
 
+@classmethod
 def fromValues(cls, values, *interfaces):
 Construct a vocabulary from a simple list.
 
@@ -96,8 +102,8 @@
 
 terms = [cls.createTerm(value) for value in values]
 return cls(terms, *interfaces)
-fromValues = classmethod(fromValues)
 
+@classmethod
 def createTerm(cls, *args):
 Create a single term from data.
 
@@ -105,7 +111,6 @@
 a term of the appropriate type from the arguments.
 

Re: [Zope-dev] TreeVocabulary in zope.schema.vocabulary

2012-02-06 Thread Jan-Carel Brand
On Mon, 2012-01-30 at 15:42 +0100, Charlie Clark wrote:
 Am 30.01.2012, 14:33 Uhr, schrieb Jan-Carel Brand li...@opkode.com:
 
 ... lots cut ...
 
  Yes, the values must be unique, because we do value lookups.
  The title attr doesn't have to be unique though. You could have a
  Forestry department for two different regions. The title will be the
  same, but the value and token attrs can't.
 
 I think the tests should be extended to show that this also includes  
 nesting because this is non-obvious. ie. I believe that the region Izmir  
 is within the state of Izimir in Turkey.

Ok, I've added the method *test_nonunique_values_and_tokens* to the
tests.

  This should be possible by calling _getPathToTreeNode during one
  of the passes through _flattenTree. getTermPath would then just need to  
  do
  a lookup on this.
 
  I don't like the way the path_node gets implicitly populated during a
  call to _flattenTree.
 
 hm, okay. Personally, I think you should be able to populate your  
 dictionaries with only a single pass through the terms. However, as this  
 only needs to happen when the application starts we don't need to worry  
 too much about the performance.

I think you're right, so I've refactored _flattenTree and _getPathIndex
into a single method _populateIndexes that populates all three indexes
with one tree-traversal.

  I'd rather have a separate method that calculates the path and then
  explicitly assign it to self.path_node.
  In any case, there is now a node_index in the code
  snip
 
   but I don't see the advantage of
   cls.createTerm(*args) over SimpleTerm(*args)
   See above. createTerm is there to let developers override it and
   provide their own term objects.
 
  Do you have a concrete use case for this?
  Not really, but that doesn't mean it doesn't exist.
 
 Then someone will speak up for it if they need it or do their own  
 subclassing/composition as required. Otherwise it's just food for warts.

  Remember that createTerm is a
  convenience method only. Frankly, I don't see the need for it in what  
  is a
  fairly specialised class.
 
  I like consistency and symmetry, so if SimpleVocabulary has it, as an
  add-on developer I'd expect for TreeVocabulary to also have it.
  I don't however feel very strongly about it though, and I wanna get this
  done, so I removed it.
 
 Well, we could always think about removing it from SimpleVocabulary: it's  
 not in the interface so no subclass actually has the right to depend on  
 it. ;-)

Looking at the documentation in fields.txt I see the following:

 A vocabulary must minimally be able to determine whether it contains a
 value, to create a term object for a value, and to return a query
 interface (or None) to find items in itself.
 
So it looks like someone thinks that any vocabulary must be able to
create a term object. Thoughts on that?

I think I'm now finished and have implemented everybody's suggestions
and improvements.

The TreeVocabulary now has a terms_factory attribute which is an
OrderedDict by default and which can be overridden in a subclass to an
alternative datastructure. It also implements IEnumerableMapping.

All the TreeVocabulary methods are covered by tests and I tested with
Python 2.6 and Python 2.7.

If there aren't any more objections, I'd like to now merge with trunk.

Regards
J-C


 
 

___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-30 Thread Jan-Carel Brand
On Sun, 2012-01-29 at 16:17 +0100, Charlie Clark wrote:

snip

  From the zope.schema 4.0.0 release notes:
  Port to Python 3. This adds a dependency on six and removes support for
  Python 2.5
 
 Shouldn't that also mean a preference of
 for key in _dict over for key in _dict.keys() ?
 
 Though you might prefer .items() in _getPathToTreeNode()
 
 i.e
 def _getPathToTreeNode(self, tree, node)
 
  path = []
  for parent, child in tree.items():
  if node == parent.value:
  return [node]
  path = self._getPathToTreeNode(child, node)
  if path:
  path.insert(0, parent.value)
  break
  return path

Thanks, I've taken this code from the diff file you gave.

  So if we want to use OrderedDict (which is from Python = 2.7), we just
  need to bridge the Python 2.6 version with the ordereddict package:
  http://pypi.python.org/pypi/ordereddict/1.1
  This would introduce a new dependency for zope.schema on Python 2.6, I
  don't know if that's acceptable or not.
 
 I think it's perfectly justified in this case and similar to what has  
 happened with other libraries like ElementTree in the past that have made  
 life easier and subsequently been adopted by the standard library.

Marius and Souheil, what do you think about this? I think it probably
still makes sense to have a dict_factory as Souheil suggested, but then
we make the default type OrderedDict and not dict.

Any objections?

  In setup.py one could specify the extra dependency only for Python 
  2.7:
 
  import sys
 
  REQUIRES = ['setuptools',
 'zope.interface = 3.6.0',
 'zope.event',
 'six',
]
 
  if sys.version_info  (2 , 7):
  REQUIRES += ['ordereddict'],
 
  setup(
  # [...]
  install_requires=REQUIRES,
  # [...]
 
 Yep.

snip

  I however don't see how one could use a generator for the recursive
  methods that return dictionaries.
  With regards to the recurse method (now called _getPathToTreeNode), I
  don't see how one could use a generator in a more efficient manner than
  the normal recursion that's being used currently.
  I played around with it and the best I could come up with is this:
 def generator(_dict, value, path=[]):
  if value in _dict.keys():
  yield path+[value]
 for key in _dict.keys():
  for path in recurse(_dict[key], value, path+[key]):
  if value in path:
  yield path
  You still have to recurse through the different branches until you find
  the node that you are looking for and you still need to store the path
  in a list. So what would be the added value?
  What's more, the generator returns a list within a list, like so:
  [['Regions', 'Germany', 'Bavaria']], which I find clunky.
 
 You're probably right. I think I was getting ahead of myself wondering  
 about possible issues with deeply nested vocabularies. 

 Any real improvement would probably involve a node index. 
 I notice that the examples do not allow for departments in regions to have 
 the same name as  
 the region (common enough in some countries) so you could simply add the  
 index keyed by node value with the path as the value when the class is  
 created. 

Yes, the values must be unique, because we do value lookups. 

The title attr doesn't have to be unique though. You could have a
Forestry department for two different regions. The title will be the
same, but the value and token attrs can't.

 This should be possible by calling _getPathToTreeNode during one  
 of the passes through _flattenTree. getTermPath would then just need to do  
 a lookup on this.

I don't like the way the path_node gets implicitly populated during a
call to _flattenTree. 

I'd rather have a separate method that calculates the path and then
explicitly assign it to self.path_node.

In any case, there is now a node_index in the code :)

snip

  but I don't see the advantage of
  cls.createTerm(*args) over SimpleTerm(*args)
  See above. createTerm is there to let developers override it and
  provide their own term objects.
 
 Do you have a concrete use case for this? 

Not really, but that doesn't mean it doesn't exist.

 Remember that createTerm is a  
 convenience method only. Frankly, I don't see the need for it in what is a  
 fairly specialised class.

I like consistency and symmetry, so if SimpleVocabulary has it, as an
add-on developer I'd expect for TreeVocabulary to also have it.

I don't however feel very strongly about it though, and I wanna get this
done, so I removed it.

J-C

___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-30 Thread Jan-Carel Brand
On Fri, 2012-01-27 at 11:50 +0100, Souheil CHELFOUH wrote:
 Yes, Marius got exactly what I meant, this is how I usually make the
 not-so-pluggable stuff pluggable :)
 About the fact to release it out of zope.schema, it's also to be able
 to make it live a bit and prove itself.
 Then, including it and changing the API can be easily justified. I'm
 not afraid of the changes in zope.schema.
 z3c.form is not the only form option, I'll probably use it in
 dolmen.forms that came from zeam.form.
 So, whatever you decide, we'll try to make it easy for you to contribute.
 It tends to get to complicated to do anything in zope, lately :)

Ok, I've implemented the idea of the dict_factory, making sure to
implement all the methods required by IEnumerableMapping and
IReadMapping. All tests pass and it works in my specific end use-case.

However, since we can use the OrderedDict type in Python  2.7 by means
of the ordereddict package, what do you think of making that the default
dict type and adding an 'ordereddict' dependency for older Python
versions? (Please see Charlie and my discussion about it.)

If we still use the concept of a dict_factory, it wouldn't make sense to
implement the OrderedDict specific methods like popItem, but the
keys method would be ordered, which I think would be enough.


J-C



___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-26 Thread Jan-Carel Brand
Hi Souheil

On Wed, 2012-01-25 at 18:56 +0100, Souheil CHELFOUH wrote:
 A quick note :
 
 This quite an advanced vocabulary, why not make another package with a
 dependency on zope.schema ?
 I don't quite see the point to have that in the core.

Ok, Charlie also expressed his reservations. I'll put it in a different
package then.

I'm not too sure what to name it though. For example, under what
namespace? zope or z3c?

I'm guessing zope.vocabulary, or rather zope.treevocabulary?

 Furthermore, for the dict class in use in the vocabulary, you could
 add a factory class that can be overriden easily.
 That would allow people with OrderDict capabilities to use them
 without having to re-sort later on.

Could you please elaborate on what you mean?

If I create a factory class to create TreeVocabulary instances, how will
overriding that factory (without creating a separate
SortableTreeVocabulary) allow people to use OrderedDict?

Incidentally, I came upon this: http://pypi.python.org/pypi/ordereddict
which provides the OrderedDict to Python 2.4 to 2.7

I think it might make sense to just subclass OrderedDict and implement
an ordered tree from the start.

 By the way, good work on that, it's something that is often needed in
 advanced forms. I'll make sure to try it.
 Thank you for the effort.

Thanks! Much appreciated.

J-C



 
 - Souheil
 
 2012/1/25 Marius Gedminas mar...@gedmin.as:
  On Wed, Jan 25, 2012 at 01:55:28AM +0200, Jan-Carel Brand wrote:
  On Wed, 2012-01-25 at 00:52 +0200, Marius Gedminas wrote:
   On Tue, Jan 24, 2012 at 07:34:03PM +0200, Jan-Carel Brand wrote:
I now subclass PersistentMapping instead of SimpleVocabulary, so this 
is
not an issue anymore.
  
   Ok.  But why Persistent?  None of the other vocabularies are
   persistent...
 
  Yeah, using PersistentMapping was a mistake, firstly because persistence
  is not necessary and secondly because it introduces a dependency on
  Persistence.
  ...
I've changed the TreeVocabulary to subclass from PersistentDict. So the
vocabulary itself now acts as a dict.
  
   So is it PersistentMapping or PersistentDict then?  ;)
 
  It was first the one, and then the other :)
 
  For extra fun: one is an alias for the other in newer ZODB versions.
 
  Perhaps I should rephrase :)
 
  I would like my changes to be merged with the zope.schema trunk. 
  The
  tests I've added provide 100% coverage of the TreeVocabulary code.
 
  I would just like someone to sign it off.

 -1 because of the concerns above.
   
Fair enough. Have your concerns been addressed properly?
  
   Thank you, yes.
  
   I'm still wondering about the possibility of ordered trees.
 
  Python 2.7 has an OrderedDict class in the collections module:
  http://docs.python.org/dev/whatsnew/2.7.html#pep-0372
 
  Yes.  And if I pass an OrderedDict to your .fromDict(), it will be
  discarded and all the items inserted into a regular dict, forgetting
  their original order.
 
  But anyway, I'm fine with you saying explicit ordering is not
  supported; it's up to the widget to sort each tree level appropriately.
  In the class docstring, say.  ;-)
 
   And I'm -1 for subclassing PersistentMapping.  It may tempt people into
   storing tree vocabularies in the ZODB, and then maybe even modifying
   them.  And you have plenty of non-persistent dicts in the internal
   structure.
  
   I think it would be better to subclass a regular dict, and document that
   you ITreeVocabulary is a dict-like object by making it inherit
   IEnumerableMapping.
 
  Thanks for the suggestion, I did that.
 
  I've no objections remaining (other than that little thing about
  explicit ordering).
 
  Marius Gedminas
  --
  http://pov.lt/ -- Zope 3/BlueBream 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 )
 
 ___
 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 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] TreeVocabulary in zope.schema.vocabulary

2012-01-25 Thread Jan-Carel Brand
Hi Charlie

On Wed, 2012-01-25 at 10:37 +0100, Charlie Clark wrote:
 Hiya,
 
 Am 24.01.2012, 18:48 Uhr, schrieb Jan-Carel Brand li...@opkode.com:
 
  I've clarified some of the docstrings and added the missing one.
  None have doctests, perhaps you are referring to fromDict, which gives
  an example dict to show the required structure.
  I guess that could easily be turned into a doctest, I'll look into it.
 
 No need to add doctests. It was more a comment on the docstring of one  
 method in comparison with the others.
 
  It would be nice to expand the README here.
  I don't see anything about vocabs there at all, but I'm willing to add
  some tests.
 
 er, just because the existing documentation is pants doesn't mean it can't  
 be improved upon! ;-)
 
 I'm still not sure about having TreeVocabulary in zope.schema if it is  
 only going to be used with, shudder, Archetypes. 

It's *not* for use with Archetypes. :) That's what for example
Products.ATVocabularyManager is for.

I just mentioned that this is a fairly common use-case in Plone, but up
to now only with Archetypes, because a zope3-component type
TreeVocabulary didn't exist yet. That's why I wrote this one.

 On the one hand schema  
 are theoretically dissociated from any form library and zope.form is  
 already incomplete, on the other we try and avoid application-specific  
 requirements in the libraries. 

Sure. Like SimpleVocabulary, the Treevocabulary is not dependent on any
form library.

In my case, I use it with z3c.form, but it could also be used with for
example zope.formlib or any other form library that couples with
zope.schema.

 All the more important to expand the  
 documentation so that other libraries can benefit from the plumbing.

I'll see what I can do.

JC

___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-24 Thread Jan-Carel Brand
On Fri, 2012-01-20 at 13:50 +0200, Jan-Carel Brand wrote:
 Hi all
 
 I've been working on porting the Dynatree (a dynamic tree-like) widget
 to z3c.form:
 
 https://github.com/collective/collective.dynatree
 
 My (temporary) fork is here:
 
 https://github.com/syslabcom/collective.dynatree
 
 And for this I needed a hierarchical tree-like vocabulary.
 
 So I've created a TreeVocabulary in zope/schema/vocabulary.py, based
 upon the existing SimpleVocabulary.
 
 Instead of fromValues or fromItems, it has fromDict, to construct the
 vocab from a dict. And the internal representation, self._terms, is a
 dictionary.
 
 My branch is here:
 http://svn.zope.org/zope.schema/branches/jcbrand-treevocabulary/
 
 The only changes are the new TreeVocabulary in zope/schema/vocabulary.py
 and the tests for it in zope/schema/tests/test_vocabulary.py
 
 Can someone please take a look and give some feedback? 

Perhaps I should rephrase :)

I would like my changes to be merged with the zope.schema trunk. The
tests I've added provide 100% coverage of the TreeVocabulary code.

I would just like someone to sign it off.

Should I rather create a ticket on launchpad? Or otherwise, should I
just go ahead and merge the changes to trunk?

Thanks
JC



___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-24 Thread Jan-Carel Brand
On Tue, 2012-01-24 at 16:07 +0200, Marius Gedminas wrote:
 Incidentally, please do not hijack existing threads when you start a new
 topic, ok?

Yes, that was an honest mistake, no ill intentions. Won't happen again.


 On Tue, Jan 24, 2012 at 01:35:49PM +0200, Jan-Carel Brand wrote:
  On Fri, 2012-01-20 at 13:50 +0200, Jan-Carel Brand wrote:
   Hi all
   
   I've been working on porting the Dynatree (a dynamic tree-like) widget
   to z3c.form:
   
   https://github.com/collective/collective.dynatree
   
   My (temporary) fork is here:
   
   https://github.com/syslabcom/collective.dynatree
   
   And for this I needed a hierarchical tree-like vocabulary.
   
   So I've created a TreeVocabulary in zope/schema/vocabulary.py, based
   upon the existing SimpleVocabulary.
   
   Instead of fromValues or fromItems, it has fromDict, to construct the
   vocab from a dict. And the internal representation, self._terms, is a
   dictionary.
   
   My branch is here:
   http://svn.zope.org/zope.schema/branches/jcbrand-treevocabulary/
   
   The only changes are the new TreeVocabulary in zope/schema/vocabulary.py
   and the tests for it in zope/schema/tests/test_vocabulary.py
   
   Can someone please take a look and give some feedback? 
 
 vocabulary.py, line 146:
 
   Initialize the vocabulary given a dict of terms.
 
 Please clarify what a 'dict of terms' means.  AFAIC the *keys* of your
 dict are terms (instances of SimpleTerm or whatever), and the values are
 dicts representing the children.

Ok, I've clarified that a bit more.

 vocabulary.py, line 150:
 
   gne or more interfaces may also be provided so that alternate
 
 s/gne/One/

Fixed

 test_vocabulary.py, line 223:
 
   self.assertTrue(dict, type(v._terms)) 
   
 s/assertTrue/assertEqual/

Fixed.

 test_vocabulary.py, line 249:
 
len returns the number of all nodes in die dict 
 
 s/die/the/

Fixed.

 lines 255-257:
 
   self.assertTrue('Regions' in self.tree_vocab_2 and \ 
   'Austria' in self.tree_vocab_2 and \ 
   'Bavaria' in self.tree_vocab_2) 
 
 The backslashes at the end of each line are not necessary.  Same on
 lines 262-264.

Removed.

 test_vocabulary, lines 192-194: you create list_vocab and items_vocab
 and then never use them.

Removed.

 Missing tests: by inheriting from SimpleVocabulary you also gain
 .fromItems() and .fromValues().  Do those work?  They pass a list of
 terms to __init__, which seems to expect a dict now.  Override and add a
 raise NotImplementedError?  Or just make them work?

I now subclass PersistentMapping instead of SimpleVocabulary, so this is
not an issue anymore.

 I think TreeVocabulary should have a corresponding interface
 ITreeVocabulary.

I agree, done.

 The new getTermPath() method is currently undocumented.

I added documentation.

 What's the use case for a tree vocabulary?  A widget that displays the
 tree structure explicitly?  

Yes. In my case, it's for the widget in collective.dynatree. This is a
fairly common use-case in Plone. Products.ATVocabularyManager also has
hierarchical vocabularies.

 It seems... difficult to extract that
 tree structure using just the public API.  Actually, it's impossible:
 __iter__ doesn't return all the terms, just top-level ones.  Am I
 missing something?

I've changed the TreeVocabulary to subclass from PersistentDict. So the
vocabulary itself now acts as a dict.

 I'm unhappy about len(tree_vocab) !+ len(list(tree_vocab)).

You're right. I fixed that.

  Perhaps I should rephrase :)
  
  I would like my changes to be merged with the zope.schema trunk. The
  tests I've added provide 100% coverage of the TreeVocabulary code.
  
  I would just like someone to sign it off.
 
 -1 because of the concerns above.

Fair enough. Have your concerns been addressed properly?

Thanks Marius, and Charlie, for taking the time to check the code. I
appreciate it!


JC

___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-24 Thread Jan-Carel Brand
Hi Charlie

On Tue, 2012-01-24 at 15:06 +0100, Charlie Clark wrote:
 Hiya,

 Am 24.01.2012, 12:35 Uhr, schrieb Jan-Carel Brand li...@opkode.com:
 
  Perhaps I should rephrase
  I would like my changes to be merged with the zope.schema trunk. The
  tests I've added provide 100% coverage of the TreeVocabulary code.
 
 I've only glanced cursorily at the source but I'm not sure that a merge is  
 okay yet. 

Yes, Marius pointed that out as well.

 At least not all of the methods have doc strings and one of them  
 seems to have a doctest. 

I've clarified some of the docstrings and added the missing one.

None have doctests, perhaps you are referring to fromDict, which gives
an example dict to show the required structure.

I guess that could easily be turned into a doctest, I'll look into it.

 It would be nice to expand the README here.  

I don't see anything about vocabs there at all, but I'm willing to add
some tests.

 getTerm is a copy of the SimpleVocabulary method. Using the @classmethod  
 decorator is fine but inconsistent with other vocabulary classes. Using  
 the decorator is more readable so I'd suggest changing all relevant  
 methods to do that. 

Ok, I changed all the other methods to also use the decorator.

 Off the top of my head I don't know which Python  
 versions support classmethods. That should be checked in case zope.schema  
 is in a ZTK that is running on Python 2.4

Doesn't seem to be a problem for Python 2.4:
http://www.python.org/dev/peps/pep-0318/#current-syntax


  I would just like someone to sign it off.
  Should I rather create a ticket on launchpad? Or otherwise, should I  
  just go ahead and merge the changes to trunk?
 
 I would suggest going via launchpad if only because it is a better paper  
 trail. 

Ok.

 At the moment I'm still not quite sure whether this is required in  
 zope.schema. 

I think that a zope3 style TreeVocabulary is indeed needed. We use them
quite a bit in Plone (currently only for Archetypes). If not in
zope.schema, then in a separate egg?

 Do widgets only exist for z3c.form?

Well, there wasn't such a widget for z3c.form. The dynatree widget was
for Archetypes. I (and Johan Beyers) ported it to z3c.form.

Thanks for taking the time.
JC


___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-24 Thread Jan-Carel Brand
On Wed, 2012-01-25 at 00:52 +0200, Marius Gedminas wrote:
 On Tue, Jan 24, 2012 at 07:34:03PM +0200, Jan-Carel Brand wrote:
   Missing tests: by inheriting from SimpleVocabulary you also gain
   .fromItems() and .fromValues().  Do those work?  They pass a list of
   terms to __init__, which seems to expect a dict now.  Override and add a
   raise NotImplementedError?  Or just make them work?
  
  I now subclass PersistentMapping instead of SimpleVocabulary, so this is
  not an issue anymore.
 
 Ok.  But why Persistent?  None of the other vocabularies are
 persistent...

Yeah, using PersistentMapping was a mistake, firstly because persistence
is not necessary and secondly because it introduces a dependency on
Persistence.

   What's the use case for a tree vocabulary?  A widget that displays the
   tree structure explicitly?  
  
  Yes. In my case, it's for the widget in collective.dynatree. This is a
  fairly common use-case in Plone. Products.ATVocabularyManager also has
  hierarchical vocabularies.
 
 *nod*
 
   It seems... difficult to extract that
   tree structure using just the public API.  Actually, it's impossible:
   __iter__ doesn't return all the terms, just top-level ones.  Am I
   missing something?
  
  I've changed the TreeVocabulary to subclass from PersistentDict. So the
  vocabulary itself now acts as a dict.
 
 So is it PersistentMapping or PersistentDict then?  ;)

It was first the one, and then the other :)

Perhaps I should rephrase :)

I would like my changes to be merged with the zope.schema trunk. The
tests I've added provide 100% coverage of the TreeVocabulary code.

I would just like someone to sign it off.
   
   -1 because of the concerns above.
  
  Fair enough. Have your concerns been addressed properly?
 
 Thank you, yes.
 
 I'm still wondering about the possibility of ordered trees.

Python 2.7 has an OrderedDict class in the collections module:
http://docs.python.org/dev/whatsnew/2.7.html#pep-0372

 And I'm -1 for subclassing PersistentMapping.  It may tempt people into
 storing tree vocabularies in the ZODB, and then maybe even modifying
 them.  And you have plenty of non-persistent dicts in the internal
 structure.
 
 I think it would be better to subclass a regular dict, and document that
 you ITreeVocabulary is a dict-like object by making it inherit
 IEnumerableMapping.

Thanks for the suggestion, I did that.

JC



___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-20 Thread Jan-Carel Brand
Hi all

I've been working on porting the Dynatree (a dynamic tree-like) widget
to z3c.form:

https://github.com/collective/collective.dynatree

My (temporary) fork is here:

https://github.com/syslabcom/collective.dynatree

And for this I needed a hierarchical tree-like vocabulary.

So I've created a TreeVocabulary in zope/schema/vocabulary.py, based
upon the existing SimpleVocabulary.

Instead of fromValues or fromItems, it has fromDict, to construct the
vocab from a dict. And the internal representation, self._terms, is a
dictionary.

My branch is here:
http://svn.zope.org/zope.schema/branches/jcbrand-treevocabulary/

The only changes are the new TreeVocabulary in zope/schema/vocabulary.py
and the tests for it in zope/schema/tests/test_vocabulary.py

Can someone please take a look and give some feedback? 

Thanks
J-C








___
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] bugifx release for zope.error

2012-01-17 Thread Jan-Wijbrand Kolman

Hi,

I'd like to make a bugfix release for zope.error. Could someone grant me 
the needed permissions on pypi for this? My pypi handle is jw.


Thank you in advance.

regards, jw

___
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] bugifx release for zope.error

2012-01-17 Thread Jan-Wijbrand Kolman

Thanks.
Released as zope.error 3.7.3.
regards, jw

On 17/01/2012 21:33 , Jim Fulton wrote:

Done.

Jim

On Tue, Jan 17, 2012 at 3:17 PM, Jan-Wijbrand Kolman
janwijbr...@gmail.com  wrote:

Hi,

I'd like to make a bugfix release for zope.error. Could someone grant me the
needed permissions on pypi for this? My pypi handle is jw.

Thank you in advance.

regards, jw



___
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] zope.app.locales pypi access

2011-12-06 Thread Jan-Jaap Driessen
Hi,

I'd like to make a minor release of zope.app.locales. Could anyone
grant access to handle janjaapdriessen?

Thanks,

-- 
Jan-Jaap Driessen

www.thehealthagency.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] zope-tests - FAILED: 1, OK: 62

2011-06-25 Thread Jan-Jaap Driessen
On 24 June 2011 17:18, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 [1]    FAILED  Zope Buildbot / zopetoolkit_win-py2.6 slave-win
        https://mail.zope.org/pipermail/zope-tests/2011-June/044045.html

 Proxy error on the buildout page: DNS lookup failure for:
 tha209.thehealthagency.com.

I moved the buildbot master to a harder, better, faster, stronger host
in order to lose the dependency on the flaky internal DNS server and
updated the ZTK docs accordingly:

http://zope3.pov.lt/trac/changeset/121974

Cheers,

-- 
Jan-Jaap Driessen
___
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-tests - OK: 85, UNKNOWN: 1

2011-06-23 Thread Jan-Jaap Driessen
On 23 June 2011 07:00, Zope tests summarizer nore...@zope.org wrote:
...
 Non-OK results
 --

 [1]    UNKNOWN UNKNOWN : Zope Buildbot / zopetoolkit-1.1_win-py2.5 slave-win
       https://mail.zope.org/pipermail/zope-tests/2011-June/044005.html

The DNS barf was resolved:

http://dev.thehealthagency.com/buildbot/builders/zopetoolkit-1.1_win-py2.5%20slave-win/

Cheers,

-- 
Jan-Jaap Driessen
___
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-tests - OK: 64, UNKNOWN: 1

2011-06-22 Thread Jan-Jaap Driessen
On 21 June 2011 14:39, Tres Seaver tsea...@palladion.com wrote:
 dev.thehealthagency.com times out, so I can't diagnose the failure.

I have been re-arranging some of our servers. We are back online now.

Cheers,

-- 
Jan-Jaap Driessen
___
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-tests - FAILED: 9, OK: 72

2011-06-08 Thread Jan-Wijbrand Kolman
On 6/6/11 16:48 , Tres Seaver wrote:
 On 06/05/2011 02:24 PM, Hanno Schlichting wrote:
 On Sun, Jun 5, 2011 at 6:31 PM, Tres Seaver tsea...@palladion.com wrote:
 [1]FAILED  Zope Buildbot / zope2.13-py2.7 slave-ubuntu64
https://mail.zope.org/pipermail/zope-tests/2011-June/042535.html


 [2]FAILED  Zope Buildbot / zope2.14-py2.7 slave-ubuntu64
https://mail.zope.org/pipermail/zope-tests/2011-June/042537.html

 These two are both the segfault-at-exit issue.
 
 I finally took the time to install me a virtual machine with Ubuntu
 64bit on it. And I was able to reproduce the issue!
 
 It's not a segfault at exit, but actually happens inside a test:
 
 test_interfaces (Acquisition.tests) (0.001 s)
 test_mixed_explicit_and_explicit (Acquisition.tests)Segmentation fault
 
 Or to get the issue quicker:
 
 $ bin/alltests -s Acquisition -t test_mixed_explicit_and_explicit
 Running zope.testrunner.layer.UnitTests tests:
   Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
 Segmentation fault
 
 I haven't yet tried to debug the problem itself.
 
 I cannot reproduce on my native Ubuntu x86_64 machine using a
 built-from-scratch Python 2.7.1::

On the specific buildslave machine I tested with a python-2.7 built from
scratch, re-ran bootstrap.py, bin/buildout, bin/alltests and all tests
passed.

It seems the python-2.7 from the deadsnakes PPA that is installed on
this buildmachine behaves badly. I do not know why, and I do not really
feel like investigating it. I'll remove the python-2.7 PPA install from
this machine we'll start using the hand-build python-2.7 instead.

regards, jw

___
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-tests - FAILED: 8, OK: 77

2011-04-16 Thread Jan-Jaap Driessen
On 16 April 2011 07:00, Zope tests summarizer nore...@zope.org wrote:
...

 [1]    FAILED  Zope Buildbot / zopetoolkit-py2.6 slave-ubuntu64
       https://mail.zope.org/pipermail/zope-tests/2011-April/038158.html

Looks like a temporary network issue, next run went fine.

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


-- 
Jan-Jaap Driessen
___
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] fanstatic and preprocessors

2011-04-15 Thread Jan-Jaap Driessen
Hi Wolfgang,

On 15 April 2011 07:13, Wolfgang Schnerring w...@gocept.com wrote:
 Hi,

 is this the right place to ask stuff about fanstatic?

Fanstatic lives at fanstatic.org , the mailing list at
fansta...@googlegroups.com . Let's continue this discussion there.

 Unfortunately I haven't had the opportunity to have a proper look at
 fanstatic (yet!), but I've just been reading about SASS and
 CoffeeScript, which are preprocessors/compilers for CSS and
 JavaScript. So I wondered whether it is within fanstatic's scope that
 one could feasibly write a plugin to support something like this.
 Something like, I drop a foo.coffee file somewhere and it would be run
 through the CoffeeScript compiler, probably cached, and served to
 clients as foo.js.

 (This thought has been triggered by what Rails is doing right now[1]
 which is powered by their equivalent resource manager[2].)

 Wolfgang


 [1] 
 http://www.rubyinside.com/rails-3-1-adopts-coffeescript-jquery-sass-and-controversy-4669.html
 [2] https://github.com/sstephenson/sprockets

Supporting pre-processed resources is definitely on the fanstatic
roadmap. I am working on pluggable support for javascript resources
(CoffeeScript, Google Closure Compiler, ...) and CSS (SASS, LessCSS,
...).

Cheers,

-- 
Jan-Jaap Driessen
___
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-tests - FAILED: 14, OK: 89, UNKNOWN: 1

2011-04-08 Thread Jan-Jaap Driessen
On 8 April 2011 07:00, Zope tests summarizer nore...@zope.org wrote:
...
 [7]    FAILED  Zope Buildbot / zope2.13-py2.6 slave-ubuntu32
       https://mail.zope.org/pipermail/zope-tests/2011-April/037482.html


 [8]    FAILED  Zope Buildbot / zope2.13_win-py2.7 slave-win
       https://mail.zope.org/pipermail/zope-tests/2011-April/037483.html


These tests run again after barfing last night.

-- 
Jan-Jaap Driessen
___
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-tests - FAILED: 8, OK: 71, UNKNOWN: 4

2011-04-07 Thread Jan-Wijbrand Kolman
On 4/7/11 07:00 , Zope tests summarizer wrote:
 This is the summary for test reports received on the
 zope-tests list between 2011-04-05 00:00:00 UTC and 2011-04-06 00:00:00 UTC:
 [5]FAILED  Zope Buildbot / zopetoolkit-1.1-py2.5 slave-ubuntu64
 https://mail.zope.org/pipermail/zope-tests/2011-April/037325.html

This one is green now.
regards, jw

___
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 Tests: 171 OK, 13 Failed, 2 Unknown

2011-04-04 Thread Jan-Wijbrand Kolman
On 4/4/11 12:57 , Zope Tests Summarizer wrote:
 Summary of messages to the zope-tests list.
 Period Sun Apr  3 11:00:00 2011 UTC to Mon Apr  4 11:00:00 2011 UTC.
 There were 186 messages: 8 from Zope Tests, 4 from buildbot at pov.lt, 23 
 from buildbot at winbot.zope.org, 8 from ccomb at free.fr, 143 from jdriessen 
 at thehealthagency.com.


 Test failures
 -

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0_win-py2.6 slave-win
 From: jdriessen at thehealthagency.com
 Date: Sun Apr  3 11:34:06 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-April/037074.html

 Subject: FAILED : Zope Buildbot / zope2.13_win-py2.6 slave-win
 From: jdriessen at thehealthagency.com
 Date: Sun Apr  3 13:48:52 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-April/037104.html

For both case, the subsequent test runs passed OK.

regards, jw

___
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.schema

2011-04-03 Thread Jan-Jaap Driessen
On 2 April 2011 12:29, Vincent Fretin vincent.fre...@gmail.com wrote:
 On Thu, Mar 31, 2011 at 9:52 AM, Jan-Jaap Driessen
 jdries...@thehealthagency.com wrote:

 On 31 March 2011 08:42, Wichert Akkerman wich...@wiggy.net wrote:
  On 3/31/11 08:23 , Jan-Jaap Driessen wrote:
 
  Hi,
 
  I added nl translations to z3c.schema, could someone grant me
  ('janjaapdriessen') pypi access so I can release this as 0.7.1?
 
  Can you reply to my comment on your translation commit? I don't think
  the
  current language used in z3c.schema is very user friendly.
 
  Wichert.
 

 Per Wichert's suggestion I have removed the RFC822 mention from the
 user-facing error messages in r121172.

 I had to add these dependencies in order to get `i18nextract` to work,
 could anybody with more i18n skills have a look?


 http://svn.zope.org/z3c.schema/trunk/buildout.cfg?rev=121172r1=92501r2=121172

 I'll wait with a release until this is fixed.

 Thanks,

 Hi,

 I replaced lovely.recipe:i18n recipe by the more maintained
 z3c.recipe.i18n:i18n recipe we use in grok project now, this remove the need
 to declare dependencies.

 Vincent


Released as 0.7.1

-- 
Jan-Jaap Driessen
___
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 Tests: 123 OK, 14 Failed, 3 Unknown

2011-04-02 Thread Jan-Jaap Driessen
On 1 April 2011 15:06, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Subject: UNKNOWN : Zope Buildbot / zopetoolkit-1.0_win-py2.4 slave-win
 From: jdriessen at thehealthagency.com
 Date: Thu Mar 31 19:48:31 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036774.html

 Subject: UNKNOWN : Zope Buildbot / zopetoolkit-1.0_win-py2.5 slave-win
 From: jdriessen at thehealthagency.com
 Date: Thu Mar 31 20:02:29 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036777.html

 Subject: UNKNOWN : Zope Buildbot / zopetoolkit-1.0_win-py2.6 slave-win
 From: jdriessen at thehealthagency.com
 Date: Thu Mar 31 20:15:26 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036780.html


 These are all puzzling:  the second test step (the 'test-zopeapp' step)
 fails with::

 - - % ---
 command timed out: 300 seconds without output, killing pid 3828
 SIGKILL failed to kill process
 using fake rc=-1
 program finished with exit code -1

 remoteFailed: [Failure instance: Traceback from remote host -- Traceback
 (most recent call last):
 Failure: buildbot.slave.commands.TimeoutError: SIGKILL failed to kill
 process
 - - % ---


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

 iEYEARECAAYFAk2VzdoACgkQ+gerLs4ltQ60BgCcCGumPMvb4BkUuv4PPclnCjFn
 WQ0An2IpYFJttQJXQHEAXYpdXapjb53O
 =Rm6a
 -END PGP SIGNATURE-

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


I was playing around with test-timeout in the buildbot configuration.
Fixed now.

-- 
Jan-Jaap Driessen
___
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.schema

2011-03-31 Thread Jan-Jaap Driessen
Hi,

I added nl translations to z3c.schema, could someone grant me
('janjaapdriessen') pypi access so I can release this as 0.7.1?

Thanks,

--

Jan-Jaap Driessen
___
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.schema

2011-03-31 Thread Jan-Jaap Driessen
On 31 March 2011 08:42, Wichert Akkerman wich...@wiggy.net wrote:
 On 3/31/11 08:23 , Jan-Jaap Driessen wrote:

 Hi,

 I added nl translations to z3c.schema, could someone grant me
 ('janjaapdriessen') pypi access so I can release this as 0.7.1?

 Can you reply to my comment on your translation commit? I don't think the
 current language used in z3c.schema is very user friendly.

 Wichert.


Per Wichert's suggestion I have removed the RFC822 mention from the
user-facing error messages in r121172.

I had to add these dependencies in order to get `i18nextract` to work,
could anybody with more i18n skills have a look?

http://svn.zope.org/z3c.schema/trunk/buildout.cfg?rev=121172r1=92501r2=121172

I'll wait with a release until this is fixed.

Thanks,

-- 
Jan-Jaap Driessen
___
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 Tests: 74 OK, 14 Failed

2011-03-30 Thread Jan-Jaap Driessen
On 29 March 2011 16:22, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0_win-py2.6 slave-win
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 15:18:14 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036429.html

 Subject: FAILED : Zope Buildbot / zope2.12-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 16:46:58 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036443.html

 Subject: FAILED : Zope Buildbot / zope2.13-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 16:47:05 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036444.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 17:06:20 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036453.html

 These four are still dying in the bootstrap step, without any kind of
 useful output.  I just tried to reproduce one without success::

 - --- % --
 $ cd /tmp
 $ svn co http://svn.zope.org/repos/main/zopetoolkit/branches/1.0
 A    1.0/LICENSE.txt
 A    1.0/development.cfg
 A    1.0/zopeapp-versions.cfg
 A    1.0/bootstrap.py
 A    1.0/buildout.cfg
 A    1.0/COPYRIGHT.txt
 A    1.0/ztk.cfg
 A    1.0/README.txt
 A    1.0/zopeapp.cfg
 A    1.0/ztk-versions.cfg
 A    1.0/index.rst
  U   1.0
 Checked out revision 121155.
 $ cd 1.0/
 $ /opt/Python-2.6.5/bin/python bootstrap.py
 Creating directory '/tmp/1.0/bin'.
 Creating directory '/tmp/1.0/parts'.
 Creating directory '/tmp/1.0/eggs'.
 Creating directory '/tmp/1.0/develop-eggs'.
 Generated script '/tmp/1.0/bin/buildout'.
 - --- % --


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

 iEYEARECAAYFAk2R6zUACgkQ+gerLs4ltQ7w0QCfZ/jXytAG9yNbu8Zw23gyingt
 rYAAoM9jxNwqru2WK7cjYcEHw+oRKkwB
 =qWYz
 -END PGP SIGNATURE-


I had a look on the buildslave server, seems bootstrap/setuptools
related. JW kindly offered to pick this up :) .

-- 
Jan-Jaap Driessen
___
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 Tests: 74 OK, 14 Failed

2011-03-30 Thread Jan-Wijbrand Kolman
On 3/30/11 9:11 AM, Jan-Jaap Driessen wrote:
 On 29 March 2011 16:22, Tres Seavertsea...@palladion.com  wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0_win-py2.6 slave-win
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 15:18:14 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036429.html

 Subject: FAILED : Zope Buildbot / zope2.12-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 16:46:58 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036443.html

 Subject: FAILED : Zope Buildbot / zope2.13-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 16:47:05 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036444.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Mon Mar 28 17:06:20 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036453.html

 These four are still dying in the bootstrap step, without any kind of
 useful output.  I just tried to reproduce one without success::

 - --- %  --
 $ cd /tmp
 $ svn co http://svn.zope.org/repos/main/zopetoolkit/branches/1.0
 A1.0/LICENSE.txt
 A1.0/development.cfg
 A1.0/zopeapp-versions.cfg
 A1.0/bootstrap.py
 A1.0/buildout.cfg
 A1.0/COPYRIGHT.txt
 A1.0/ztk.cfg
 A1.0/README.txt
 A1.0/zopeapp.cfg
 A1.0/ztk-versions.cfg
 A1.0/index.rst
   U   1.0
 Checked out revision 121155.
 $ cd 1.0/
 $ /opt/Python-2.6.5/bin/python bootstrap.py
 Creating directory '/tmp/1.0/bin'.
 Creating directory '/tmp/1.0/parts'.
 Creating directory '/tmp/1.0/eggs'.
 Creating directory '/tmp/1.0/develop-eggs'.
 Generated script '/tmp/1.0/bin/buildout'.
 - --- %  --

 I had a look on the buildslave server, seems bootstrap/setuptools
 related. JW kindly offered to pick this up :) .

Turned out to be an unclean python environment. I'm in the process of 
fixing it.

regards, jw


___
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 Tests: 74 OK, 19 Failed

2011-03-30 Thread Jan-Wijbrand Kolman
On 3/30/11 13:17 PM, Tres Seaver wrote:
 Subject: FAILED : Zope Buildbot / zope2.12-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Tue Mar 29 17:09:03 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036550.html

 Subject: FAILED : Zope Buildbot / zope2.13-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Tue Mar 29 17:09:10 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036551.html

Both pending a test run.

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Tue Mar 29 17:28:19 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036558.html

 Bootstrap failures:  I'm hopeful that Jan-Wilbrand has resolved these
 for tomorrow's run.

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Wed Mar 30 03:56:37 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036594.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Wed Mar 30 04:28:40 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036595.html

 Ditto.

The zopetoolkit-1.0 tests are green now.

regards, jw


___
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 Tests: 73 OK, 12 Failed, 4 Unknown

2011-03-24 Thread Jan-Jaap Driessen
On 24 March 2011 12:57, Zope Tests Summarizer zope-te...@epy.co.at wrote:
...
 Test failures
 -

 Subject: FAILED : Zope Buildbot / zope2.14-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Wed Mar 23 16:02:31 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036010.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.1-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Wed Mar 23 16:30:56 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036018.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-py2.6 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Wed Mar 23 16:36:40 EDT 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-March/036021.html

Fixed these on the buildslave.

-- 
Jan-Jaap Driessen
___
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] Anyone want to do Google Summer of code mentoring for PSF?

2011-03-21 Thread Jan-Wijbrand Kolman
Hi,

Not sure where to 'hook into' the discussion thread, so I'll just start 
here:

On 3/20/11 15:28 PM, Jim Fulton wrote:
 Hm, it's been a while since I've looked at grok. Some notes:

 - The mechanism I'm thinking of should not require *any* ZCML.

Do you mean without having a configure.zcml trigger the scanning 
(a.k.a. grokking) process? Or do you mean, a mechanism that doesn't 
use configuration actions from zope.configuration?

If there's a different way to trigger the scanning process, that would 
be mostly fine for Grok. There's a couple of things actually configured 
thru ZCML files in some of the grokcore.* packages. I think they could 
be rewritten if necessary.

ZCML files are as far as I can see not essential to Grok - they are 
surely not essential to martian (the scanning/grokking library used).

 - The mechanism shouldn't require something to grok/analyze the
code.  The mechanism should be explicit. This is implied by
pythonic.  I remember Grok being more implicit than skimming the
links above suggest. Perhaps Grok has has become more explicit than
I remember.

I have the feeling the explicit versus implicit part of the discussion 
has been somewhat mixed with the to scan or not to scan part of the 
discussion.

Nothing in the martian library dictates implicitness as far as I can 
see. How Grok uses martian though, does have implicit, 
conventions-over-configuration design choices.

Actually, these conventions-over-configuration choices are regularly 
discussed within the Grok community - some people (including myself) 
would like to see Grok not doing any guessing of configuration 
parameters during the grokking-phase of the application at all. Others 
disagree.

As an example, there's the megrok.strictrequire package that, when 
included in a grok-based application, will raise grok errors when there 
are view components without an explicitly set permission requirement 
(where Grok normally would have used a conventional value).

 - I'd prefer not to rely on subclassing, but I'm not dead set against it.

For most components Grok relies on subclassing indeed. Note that 
registering global utilities, for example, can be done using 
module-level directives too, like can be done for adapters and 
subscriptions.

 - Whataever we come up with has to work with Python 3, so
unfortunately, we can't use the syntactic trick of having a call in a
class like::

  grokcore.component.implements(IContentProvider)

Just to be sure: this is what is called advice based syntax or 
in-class advice right? Grok people call this a directive.

Anyway, as apparently this wouldn't work in Python 3 anymore, Grok 
should come up with an alternate spelling. Actually, people have already 
suggested to start using class decorators instead of in-class 
directives. Personally, I do not see an essential cosmetic difference 
between using a class decorator or a in-class directive.

Like was said earlier in the thread: Grok had to use directives since 
there were no class decorators at that time.

And what I have seen of Pyramid and venusian, the grok directives do 
mostly what the class decorators do: they leave information on the class 
in one way or another, that later is picked up in the scanning/grokking 
phase and used for registrations.

Grok uses grokkers for that - meta-components that know how they can 
use the information left by the directives for making registrations 
(thru the zope.configuration configuration actions mechanism, which as a 
result plays nice with existing pure zcml registrations)

What I know of venusian/Pyramid, is that the class decorators leave 
callbacks that will do the registrations in the scanning phase. Right?

 The effort should certainly include an analysis of approaches like
 grok.  Maybe the mechanism should have the effect of enabling tools
 like grok to be implemented more cleanly.

I do not think the Grok project would be principally against this.

regards, jw



___
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] Anyone want to do Google Summer of code mentoring for PSF?

2011-03-21 Thread Jan-Wijbrand Kolman
On 3/20/11 16:12 PM, Wichert Akkerman wrote:
 Both Grok and Pyramid (or martian and venusian really) do a scan of
 the code to find the registration hints.

 Pyramid only does so if you tell it to do so by using config.scan(). You
 are not obliged to do that, and I have several pyramid projects which do
 not do any scanning. Not doing scanning has the advantage of making
 configuration more explicit, and it speeds application startup immensely.

Just to get this clear for me: if you're not scanning, the information 
left by the class decorators would be inert? So, you'd have to do the 
registrations yourself, right?

 Let me try to argue this better. Downsides of scanning are:

 - it scans your tests, which can result in unexpected behaviour you
 may not expect (at least for venusian, not sure if this is true for
 martian).

Martian skips tests by default. You can tell it, at least to a certain 
extend, what to scan and what not to scan.

 - you may have some draft files in your tree that are not ready for use
 and never referenced anywhere, but a scan will still process them.

This is true.

 - scanning can take a long time, making application (re)start slow for
 non-trivial projects

At what point is an application not trivial anymore? In applications I 
build so far, startup time has not been an issue at all. But maybe my 
applications are still on the trivial-end of the spectrum ;)

 - problems in the scanning process tend to be very hard debug. If a
 view is not processed during scanning figuring out why can be
 painful, and there are little to no tools to help you. This is
 especially true for more complex scanning environments such as the
 plone/dexterity/z3cform stack; as an example I spent over an hour
 yesterday trying to figure out why a form was not picked up while
 other views in the same python file worked fine.

I think this can be true. In my experience not relying on implicitly or 
guessed configuration parameters helps a little here. What in this 
specific example was the reason for the view not being picked up?


regards, jw




___
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] Anyone want to do Google Summer of code mentoring for PSF?

2011-03-21 Thread Jan-Wijbrand Kolman
On 3/21/11 10:30 AM, Wichert Akkerman wrote:
   - you may have some draft files in your tree that are not ready 
for use
   and never referenced anywhere, but a scan will still process them.

 This is true.

 I ran into this with .html.py files generated by Chameleon as well. My
 Zope startup has lots of these:

 /Users/wichert/Library/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py:605:
 UserWarning: File 'sessions.pt.pyc' has an unrecognized extension in
 directory
 '/Users/wichert/Work/syslab/euphorie/Develop/trunk/buildout/src/Euphorie/euphorie/client/templates'

I think this particular warning is not due to the scanning process 
itself, but due to the way Grok tries to associate templates to views.

It is still true though that the .pt.py files generated by chameleon 
will be scanned anyway.

regards, jw



___
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.testbrowser and WebTest (round 2)

2011-03-15 Thread Jan-Jaap Driessen
On 10 March 2011 18:18, Brian Sutherland br...@vanguardistas.net wrote:
 On Thu, Mar 10, 2011 at 07:07:24PM +0200, Marius Gedminas wrote:
 On Thu, Mar 10, 2011 at 04:22:25PM +0100, Brian Sutherland wrote:
  I now believe I've taken care of all the issues raised in your review.
  connection.py still feels uncomfortable, but I can live with it
 
  Unless there are any objections, I plan to merge all three branches
  (zope.testbrowser, zope.app.wsgi and zope.app.testing) early next week.
 
  Is there anyone willing to make releases of these to PyPI? (or give me
  the access to do it myself)

 I can give you PyPI access to all three.

 Great!

 Note: when asking for PyPI access it's customary to mention one's PyPI
 username.

 I hadn't used it for such a long time I even had to look it up: jinty

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



Just released zope.app.wsgi 3.13 that picks up the changes in
zope.testbrowser 4.0, also updated ZTK trunk.

-- 
Jan-Jaap Driessen
___
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] zope.app.wsgi.testlayer:http() in zope.app.publication

2011-03-13 Thread Jan-Jaap Driessen
I'd like to release zope.app.publication with this fix:

http://zope3.pov.lt/trac/changeset/120893

In order to not have to do lstrip() in the
zope.app.wsgi.testlayer:http method and remove this piece of code
altogether:

http://zope3.pov.lt/trac/changeset/120892

If there are no objections, please make me an owner on pypi (janjaapdriessen).

Thanks,

--
Jan-Jaap Driessen
___
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.app.wsgi.testlayer:http() in zope.app.publication

2011-03-13 Thread Jan-Jaap Driessen
On 13 March 2011 16:25, Hanno Schlichting ha...@hannosch.eu wrote:
 On Sun, Mar 13, 2011 at 9:11 PM, Jan-Jaap Driessen
 jdries...@thehealthagency.com wrote:
 I'd like to release zope.app.publication with this fix:
 [...]
 If there are no objections, please make me an owner on pypi 
 (janjaapdriessen).

 You own it :)

 Hanno

Released as 3.13.1.

-- 
Jan-Jaap Driessen
___
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.testbrowser and WebTest (round 2)

2011-03-04 Thread Jan-Jaap Driessen
Hello from the grok department,

On 4 March 2011 11:48, Brian Sutherland br...@vanguardistas.net wrote:
 On Fri, Mar 04, 2011 at 10:25:59AM +0100, Sylvain Viollon wrote:

   Hello,

 On Fri, 4 Mar 2011 10:15:18 +0100
 Brian Sutherland br...@vanguardistas.net wrote:

     In zope.app.wsgi all those idiosyncracies are more or less
   handled by a WSGI middleware. I guess you can reuse it.
  
     One of the purpose of the zope.app.wsgi implementation was to be
   able to convert the existing tests just by changing the import, and
   get ride of zope.testbrowser dependencies on the crazy
   zope.app.testing nobody-knows-what-it-does-and-does-everything in
   Grok (without adding many others). Which worked perfectly.
 
  I'll definitely look into reusing the middleware.
 
  But, tell me, how do I run all the grok tests? (So I can see what
  idiosyncracies are required)
 

   There is a Grok ToolKit, that works exactly like the Zope ToolKit:

   http://svn.zope.org/groktoolkit/trunk

   If you run this buildout you should get a ./bin/test-grok command
   that runs all the tests, using z3c.recipe.compattest.

   Actually, I think you can start by testing only grokcore.view. I
   guess it is one of the base packages that uses a lot the test browser.

 Ok, there are 2 grokcore.view failures with my branch.

 The first is due to the Basic Auth header and is fixable by adding the
 middleware we were talking about.

To get the groktoolkit tests and my company's applications to run with
Brian's zope.testbrowser+webtest branch I did the following things:

* I created a branch of zope.app.wsgi trunk [1] to which I copied the
AuthorizationMiddleware from zope.testbrowser trunk (moved there in
[2]). The three middleware components (Transaction, Authorization and
HandleErrors) are needed to make the groktoolkit tests pass. The
AuthorizationMiddleware is not available on Brian's branch, but is
available on zope.testbrowser trunk. If we can land this middleware in
zope.testbrowser, we can again remove it from zope.app.wsgi.testlayer.
In my opinion, this middleware should be part of zope.testbrowser,
because handleErrors is part of the IBrowser interface.

* The `http caller` in zope.app.wsgi.testlayer is used in
grokcore.rest. On my branch, I rewrote the http caller to use WebTest
and _APP_UNDER_TEST instead of wsgi_intercept. The import from
zope.testbrowser is bothering me; can we put the http caller in
zope.testbrowser? The http caller returns a FakeResponse instance,
which could very well be a WebTest TestResponse. The FakeResponse
wrapper is merely used to fix the current tests.

* I fixed some tests in grok and grokcore.rest to use the
WebTest-style http caller.

 The other is more interesting, in
 src/grokcore/view/ftests/url/redirect.py. It seems that that test is
 actually making calls over the network to google's servers. Probably not
 a good thing.

 The new behaviour (probably not good either) is to send the request to
 the application even if the hostname is www.google.com.

 I would guess that the right behaviour would be to raise an error if the
 hostname is not localhost or 127.0.0.1.

+1


In order to run the tests on the groktoolkit trunk, run:

bin/buildout sources:zope.testbrowser=svn
svn+ssh://svn.zope.org/repos/main/zope.testbrowser/branches/jinty-webtest3
sources:zope.app.wsgi=svn
svn+ssh://svn.zope.org/repos/main/zope.app.wsgi/branches/janjaapdriessen-webtest
buildout:auto-checkout=zope.testbrowser zope.app.wsgi grok
grokcore.rest versions:WebTest=1.2.3  bin/test-grok

-- 
Jan-Jaap Driessen

1) 
http://zope3.pov.lt/trac/changeset/120756/zope.app.wsgi/branches/janjaapdriessen-webtest/src/zope/app/wsgi/testlayer.py
2) 
http://zope3.pov.lt/trac/changeset/119878/zope.app.wsgi/trunk/src/zope/app/wsgi/testlayer.py
___
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 Tests: 72 OK, 15 Failed

2011-02-21 Thread Jan-Jaap Driessen
Hi Marius,

On 18 February 2011 17:34, Marius Gedminas mar...@gedmin.as wrote:
 On Fri, Feb 18, 2011 at 09:21:12AM +0100, Jan-Jaap Driessen wrote:
 Thank you for looking into this. I am kind of happy that the error can
 be reproduced on a different windows machine.

 Tres,

 It is indeed 'special' that this error occurs only now. The windows
 builds for zope.dublincore trunk have not shown this error:

 http://dev.thehealthagency.com/buildbot/builders/zope.dublincore_3%20slave-win
 http://dev.thehealthagency.com/buildbot/builders/zope.dublincore_5%20slave-win
 http://dev.thehealthagency.com/buildbot/builders/zope.dublincore_trunk%20slave-win

 How to proceed? Make the regex in
 zope.dublincore.tests.test_timeannotators less strict?

 That sounds like the right solution to me.

 I am not a pypi owner of zope.dublincore,

 I am.  Would you like to be too?

 Marius Gedminas

Thanks for looking into this. I was away from my computer for a while
and couldn't get back to you before. I see that Tres fixed
zope.dublincore in the mean time.

Cheers,

-- 
Jan-Jaap Driessen
___
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 Tests: 72 OK, 15 Failed

2011-02-18 Thread Jan-Jaap Driessen
On 18 February 2011 00:55, Simon Elbaz elbazsim...@gmail.com wrote:
 Hi,
 I have tried this code on Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46)
 [MSC v.1500 32 bit (Intel)] on win32. It seems that it is possible to have
 no milliseconds returned by datetime.now.

 while 1:
 ...     datetime.now(pytz.utc)
 datetime.datetime(2011, 2, 17, 23, 48, 17, 984000, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 17, 984000, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 18, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 18, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 18, tzinfo=UTC)
 ...
 datetime.datetime(2011, 2, 17, 23, 48, 18, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 18, tzinfo=UTC)
 ...
 datetime.datetime(2011, 2, 17, 23, 48, 18, 15000, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 18, 15000, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 18, 15000, tzinfo=UTC)
 datetime.datetime(2011, 2, 17, 23, 48, 18, 125000, tzinfo=UTC)
 Traceback (most recent call last):
   File stdin, line 2, in module
   File
 C:\Python27\lib\site-packages\pytz-2011b-py2.7.egg\pytz\__init__.py, li
 ne 186, in utcoffset
 KeyboardInterrupt


 Simon

 On Thu, Feb 17, 2011 at 4:58 PM, Tres Seaver tsea...@palladion.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 02/17/2011 06:58 AM, Zope Tests Summarizer wrote:

  Subject: FAILED : Zope Buildbot / zopetoolkit-1.1_win-py2.5 slave-win
  From: jdriessen at thehealthagency.com
  Date: Wed Feb 16 15:03:12 EST 2011
  URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032218.html
 
  Subject: FAILED : Zope Buildbot / zopetoolkit_win-py2.5 slave-win
  From: jdriessen at thehealthagency.com
  Date: Wed Feb 16 15:18:08 EST 2011
  URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032223.html
 
  Subject: FAILED : Zope Buildbot / zopetoolkit_win-py2.6 slave-win
  From: jdriessen at thehealthagency.com
  Date: Wed Feb 16 15:25:31 EST 2011
  URL: http://mail.zope.org/pipermail/zope-tests/2011-February/032226.html

 These three failures are due to a quirk in how datetime.datetime repr
 works:  if the 'microseconds' field happens to be zero, it isn't
 printed, e.g.:

 Expected:
    datetime.datetime(DATETIME, tzinfo=UTC)
 Got:
    datetime.datetime(2011, 2, 16, 20, 0, 43, tzinfo=UTC)

 The regex (in zope.dublincore.tests.test_timeannotators), expects the
 microseconds value to be present:

  datetime_re = (
     '[0-9]{4}, [0-9]{1,2}, [0-9]{1,2}, [0-9]{1,2}, [0-9]{1,2}, \
     [0-9]{1,2}, '
    '[0-9]{1,6}')


 I have no idea why that value is suddenly exactly zero for the THA box.


 Tres.

Simon,

Thank you for looking into this. I am kind of happy that the error can
be reproduced on a different windows machine.

Tres,

It is indeed 'special' that this error occurs only now. The windows
builds for zope.dublincore trunk have not shown this error:

http://dev.thehealthagency.com/buildbot/builders/zope.dublincore_3%20slave-win
http://dev.thehealthagency.com/buildbot/builders/zope.dublincore_5%20slave-win
http://dev.thehealthagency.com/buildbot/builders/zope.dublincore_trunk%20slave-win

How to proceed? Make the regex in
zope.dublincore.tests.test_timeannotators less strict?

I am not a pypi owner of zope.dublincore, so Tres, could you do the honors?

Jan-Jaap
___
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.pluggableauth and camefrom information in login form not an absolute URL

2011-02-08 Thread Jan-Wijbrand Kolman
On 2/7/11 18:03 PM, Roger wrote:
 why not use the same pattern like I changed to in z3c.authenticator.
 There the camefrom request part was replaced by session handling.

 On the other side, I think your changes are fine since, I guess
 someone from gocept, a long time ago, fixed and protected the
 redirect method.

Ok, thanks for your feedback!

I applied the patch, added a test just to show a redirect to a 
suspicious URL will by default not work and released zope.pluggableauth 1.3

regards, jw

___
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] zope.pluggableauth and camefrom information in login form not an absolute URL

2011-02-07 Thread Jan-Wijbrand Kolman
Hi,

The SessionCredentialsPlugin will redirect to a login form whenever a 
user needs to be authenticated. The URL to this login form will have a 
camefrom query string, where the camefrom is the path-information to 
the originally requested view.

When the credentials provided by the user are correct, the login form 
will use the camefrom information to redirect back to that original view.

Ideally (a.k.a. according to the HTTP spec.), the camefrom should be an 
absolute URL, not just a path like the SessionCredentialsPlugin now does.

I'd like to fix and release zope.pluggableauth with the following patch 
applied - unless of course there's compelling reasons not to do this:

--- trunk/src/zope/pluggableauth/plugins/session.py 2011-02-07 
10:33:25.643791415 +0100
+++ 
branches/janjaapdriessen-camefrom-fix/src/zope/pluggableauth/plugins/session.py 
2011-02-07 10:40:12.301790203 +0100
@@ -308,7 +308,7 @@
  # Better to add the query string, if present
  query = request.get('QUERY_STRING')

-camefrom = '/'.join([request.getURL(path_only=True)] + stack)
+camefrom = '/'.join([request.getURL()] + stack)
  if query:
  camefrom = camefrom + '?' + query
  url = '%s/@@%s?%s' % (absoluteURL(site, request),


regards, jw

___
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.pluggableauth and camefrom information in login form not an absolute URL

2011-02-07 Thread Jan-Wijbrand Kolman
On 2/7/11 12:04 PM, Adam GROSZER wrote:
 Hello,

 I'm not sure whether you open up a security hole there.
 Imagine that someone does a
 http://yoursite.com/@@loginform.html?camefrom=http://mysite.com
 We ended up with storing the camefrom URL in a session variable.

The redirect method in the zope publisher checks whether the redirect is 
trusted to go to a different host. The trusted arguments is False by 
default. I think will catch this situation just fine. Or doesn't it?

regards, jw

___
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.pluggableauth and camefrom information in login form not an absolute URL

2011-02-07 Thread Jan-Jaap Driessen
On 7 February 2011 12:29, Adam GROSZER agros...@gmail.com wrote:
 Hello,

 On Mon, 07 Feb 2011 12:15:40 +0100 you wrote:

 On 2/7/11 12:04 PM, Adam GROSZER wrote:
 Hello,

 I'm not sure whether you open up a security hole there.
 Imagine that someone does a
 http://yoursite.com/@@loginform.html?camefrom=http://mysite.com
 We ended up with storing the camefrom URL in a session variable.

 The redirect method in the zope publisher checks whether the redirect is
 trusted to go to a different host. The trusted arguments is False by
 default. I think will catch this situation just fine. Or doesn't it?

 Well on the second look, it should.
 Then it might have been because Roger was just unsure about the
 zope.publisher version? He is on holiday this week...
 See r105125.

 Let's wait what the other say.


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


I can confirm that a redirect to an injected camefrom URL yields a ValueError:

Untrusted redirect to host 'www.example.com:80' not allowed.

-- 
Jan-Jaap Driessen
___
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] Logo Guidelines for Grok and Bluebream

2011-02-02 Thread Jan Ulrich Hasecke
Hi all,

preparing a brochure about Zope and friends I would like to know whether
there are any guidelines for using the Grok- and Bluebream-Logo.

Am I right that neither Grok nor Bluebream are trademarks owned by the
Zope Foundation?

TIA

-- 
Jan Ulrich Hasecke
DZUG e.V. (Deutschsprachige Zope User Group)

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Logo Guidelines for Grok and Bluebream

2011-02-02 Thread Jan Ulrich Hasecke
Am 02.02.11 15:03, schrieb Andreas Jung:

 There is no trademark on Grok or Bluebream owned by the ZF afaik.

ok.


 The creators of the logos may have rights on the graphics.

While I know the creator of the Grok logo, I don't know the creator of
the Bluebream-Logo. Any objections to use it in a Zope related brochure
edited by the german zope user group?

It would be nice to have guidelines on the websites.

-- 
Jan Ulrich Hasecke
DZUG e.V. (Deutschsprachige Zope User Group)

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Logo Guidelines for Grok and Bluebream

2011-02-02 Thread Jan Ulrich Hasecke
Am 02.02.11 15:10, schrieb Andreas Jung:
 I suggest to ask Baju or ask on the Bluebream list.

I cannot find the bluebream list on gmane. I'll try the nabble gateway.
But it would be nice to have it on gmane too.

juh

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Zope Tests: 68 OK, 8 Failed, 1 Unknown

2011-01-31 Thread Jan-Jaap Driessen
On 29 January 2011 15:07, Tres Seaver tsea...@palladion.com wrote:
 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Sat Jan 29 02:08:25 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/030396.html

 I can't load the failed test output on this page.


 Subject: UNKNOWN : Zope Buildbot / zopetoolkit-1.0_win-py2.6 slave-win
 From: jdriessen at thehealthagency.com
 Date: Sat Jan 29 00:21:21 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/030376.html

 I'm not able to load the summary page at all.

 Tres.

The THA buildslaves are back to green now.

-- 
Jan-Jaap Driessen
___
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] Zope Toolkit 1.1 released

2011-01-31 Thread Jan-Wijbrand Kolman
Hi.

On behalf of the Zope Toolkit release team and the Zope community, I'm
happy to announce the release of the Zope Toolkit 1.1!

To use the new release, you can use:

[buildout]
extends =
   http://download.zope.org/zopetoolkit/index/1.1/ztk-versions.cfg
   http://download.zope.org/zopetoolkit/index/1.1/zopeapp-versions.cfg

There's a bit of high level change overview available at
http://docs.zope.org/zopetoolkit/releases/overview-1.1.html

Kind regards,
Jan-Wijbrand Kolman


___
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 Tests: 41 OK, 258 Failed, 4 Unknown

2011-01-21 Thread Jan-Jaap Driessen
On 21 January 2011 12:58, Zope Tests Summarizer zope-te...@epy.co.at wrote:
 Summary of messages to the zope-tests list.
 Period Thu Jan 20 12:00:00 2011 UTC to Fri Jan 21 12:00:00 2011 UTC.
 There were 303 messages: 8 from Zope Tests, 2 from buildbot at pov.lt, 163 
 from buildbot at winbot.zope.org, 11 from ccomb at free.fr, 119 from 
 jdriessen at thehealthagency.com.


 Test failures
 -

 Subject: FAILED : winbot / ztk_dev py_254_win32
 From: buildbot at winbot.zope.org
 Date: Thu Jan 20 15:10:46 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/029339.html

SNIP

 Subject: FAILED : ZTK 1.0dev / Python2.4.6 Linux 64bit
 From: ccomb at free.fr
 Date: Thu Jan 20 22:10:06 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/029617.html

Caused by a change in ez_setup.py:

http://mail.python.org/pipermail/distutils-sig/2011-January/017280.html

-- 
Jan-Jaap Driessen
___
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 Tests: 57 OK, 26 Failed, 2 Unknown

2011-01-14 Thread Jan-Jaap Driessen
On 14 January 2011 12:58, Zope Tests Summarizer zope-te...@epy.co.at wrote:
 Summary of messages to the zope-tests list.
 Period Thu Jan 13 12:00:00 2011 UTC to Fri Jan 14 12:00:00 2011 UTC.
 There were 85 messages: 8 from Zope Tests, 2 from buildbot at pov.lt, 22 from 
 buildbot at winbot.zope.org, 8 from ccomb at free.fr, 45 from jdriessen at 
 thehealthagency.com.


 Test failures
 -

SNIP

 Subject: FAILED : Zope Buildbot / zopetoolkit-py2.6 slave-osx
 From: jdriessen at thehealthagency.com
 Date: Thu Jan 13 14:35:28 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028663.html


Caused by zope.app.testing 3.8.1.

Fixed in zope.testbrowser 3.10.4, I updated zopetoolkit trunk and 1.1 branch.


-- 
Jan-Jaap Driessen
___
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] [Grok-dev] grok.zope.org documentation snag (there's no mercurial installed there...)

2011-01-06 Thread Jan-Jaap Driessen
On 6 January 2011 12:01, Jan-Wijbrand Kolman janwijbr...@gmail.com wrote:
 Hi,

 I'm (finally) getting around deploying the automcatic builds for the
 (community) documentation on grok.zope.org. But I hit a snag right away:
 Mercurial is not available on this machine, so I cannot clone the
 community documentation.

 I get the feeling the OS is quite old in general actually.

 Who knows who we can contact to discuss the overall state of this
 machine? Can we do upgrades ourselves?

 regards, jw

I have a spare machine at gandi that we can use.

-- 
Jan-Jaap Driessen
___
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 Tests: 67 OK, 8 Failed, 2 Unknown

2011-01-06 Thread Jan-Jaap Driessen
Hi Gediminas,

On 6 January 2011 12:58, Zope Tests Summarizer zope-te...@epy.co.at wrote:
 Summary of messages to the zope-tests list.
 Period Wed Jan  5 12:00:00 2011 UTC to Thu Jan  6 12:00:00 2011 UTC.
 There were 77 messages: 8 from Zope Tests, 2 from buildbot at pov.lt, 8 from 
 ccomb at free.fr, 59 from jdriessen at thehealthagency.com.


 Test failures
 -

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu64
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 13:04:39 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028017.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 13:07:01 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028019.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0_win-py2.4 slave-win
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 13:29:33 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028024.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-osx
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 13:43:48 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028026.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu64
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 18:28:28 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028032.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0_win-py2.4 slave-win
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 19:05:30 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028039.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-osx
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 20:29:17 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028053.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu32
 From: jdriessen at thehealthagency.com
 Date: Wed Jan  5 20:31:36 EST 2011
 URL: http://mail.zope.org/pipermail/zope-tests/2011-January/028055.html

The builds for ZTK 1.0 fail because zope.html 2.2.0 does not build on
python2.4. Can you fix the ZTK 1.0 branch?

http://zope3.pov.lt/trac/changeset/119393

 Unknown
 ---

[snip]
 ___
 Zope-Dev maillist  -  zope-...@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 )


Cheers,

-- 
Jan-Jaap Driessen
___
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] plans for a ZTK-1.1 release

2011-01-04 Thread Jan-Wijbrand Kolman
Hi,

The ZTK-releaseteam is making plans for a ZTK-1.1 release. We aim for a 
release next week. Except for an updated versions list [1], other 
significant changes will be:

* dropping python-2.4 support
* gaining python-2.7 support
* more deprecated zope.app.* packages [2]

We welcome questions, comments or suggestions regarding this plan!

Kind regards,
jw


[1] http://svn.zope.org/zopetoolkit/trunk/ztk-versions.cfg
[2] http://svn.zope.org/zopetoolkit/trunk/zopeapp.cfg

___
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 Tests: 30 OK, 19 Failed

2010-12-31 Thread Jan-Jaap Driessen
On 30 December 2010 18:35, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
[SNIP]
 Subject: FAILED : Zope Buildbot / zopetoolkit_win-py2.6 slave-win
 From: jdriessen at thehealthagency.com
 Date: Wed Dec 29 20:10:09 EST 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-December/027585.html

 I didn't look at all of them, but at least some failures are due to
 borked filesystem permissions::

 WindowsError: [Error 5] Access is denied: 'c:\\windows\\temp/*.*'
 While:
  Installing.
  Processing develop directory
 'C:\\Users\\richard\\Desktop\\buildslave\\zope2.13_win-py2.6_slave-win\\build\\.'.

I fixed those on the buildslave.

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

There is test failure that looks genuine though:

http://dev.thehealthagency.com/buildbot/builders/zope2.13_win-py2.6%20slave-win/builds/80/steps/test/logs/stdio


-- 
Jan-Jaap Driessen
___
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] [Checkins] SVN: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py Don't import site on initialization, as this mitigates the buildout 1.5 way of setting sys.path

2010-12-17 Thread Jan-Jaap Driessen
On 13 December 2010 22:16, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 12/13/2010 04:09 PM, Jan-Jaap Driessen wrote:

 It looks like this patch to z3c.recipe.compattest fixes the virtualenv issue:

 http://pastie.org/1374124

 With this patch I successfully ran the ZTK trunk tests on Windows and
 OSX machines inside and outside a virtualenv.

 If nobody objects, I'll release this as z3c.recipe.compattest 0.13.1.

 +1 from me.


 Tres.
 - --

I released z3c.recipe.compattest 0.13.1 which on my machines runs the
ZTK tests without problems in the following configurations:

win32 + sys python
win32 + virtualenv python
win32 + virtualenv-no-site-packages python

osx + sys python
osx + virtualenv python
osx + virtualenv-no-site-packages python

ubuntu + sys python
ubuntu + virtualenv python
ubuntu + virtualenv-no-site-packages python

Also, last night the THA buildbot ran the ZTK trunk tests with the
trunk of z3c.recipe.compattest without problems.

Michael, does 0.13.1 fix your problem?


Cheers,

-- 
Jan-Jaap Driessen
___
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 Tests: 73 OK, 15 Failed

2010-12-17 Thread Jan-Jaap Driessen
On 16 December 2010 18:12, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 Subject: FAILED : Zope Buildbot / zopetoolkit-py2.5 slave-ubuntu64
 From: jdriessen at thehealthagency.com
 Date: Wed Dec 15 16:55:22 EST 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-December/026754.html

 Subject: FAILED : Zope Buildbot / zopetoolkit-py2.6 slave-ubuntu64
 From: jdriessen at thehealthagency.com
 Date: Wed Dec 15 17:00:02 EST 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-December/026755.html

 Are we somehow re-using files checked out using Windows SVN on Linux
 boxes?  The failures here are due to carriage returns in the doctest files::

  test-ztk-zope.publisher failed with:
  Test-module import failures:

  Module: zope.publisher.tests.test_http

  ValueError: line 81 of the docstring for httpresults.txt lacks \
   blank after ...: '    ...\r'

 Those '\r' characters aren't present in the files in a normal Linux
 checkout.



 Tres.
 - --

The buildslaves are not sharing a filesystem. Looks like the
zope.publisher 3.12.5 distribution was created on a windows machine:

$ file 
~/.buildout/eggs/zope.publisher-3.12.5-py2.6.egg/zope/publisher/__init__.py
zope.publisher-3.12.5-py2.6.egg/zope/publisher/__init__.py: ASCII
text, with CRLF line terminators

compared to the previous release:

$ file 
~/.buildout/eggs/zope.publisher-3.12.4-py2.6.egg/zope/publisher/__init__.py
zope.publisher-3.12.4-py2.6.egg/zope/publisher/__init__.py: ASCII text

If this is the case, Adam, could you re-upload the egg? Or assign me
pypi rights to this package and I will do so.


-- 
Jan-Jaap Driessen
___
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.testbrowser and WebTest

2010-12-16 Thread Jan-Jaap Driessen
On 16 December 2010 08:38, Brian Sutherland br...@vanguardistas.net wrote:
 On Thu, Dec 16, 2010 at 12:06:36AM +0100, Hanno Schlichting wrote:
 On Wed, Dec 15, 2010 at 2:06 PM, Brian Sutherland
 br...@vanguardistas.net wrote:
  I've managed to get the existing tests to run against this browser with
  two new testing dependencies:
     WebTest
     zope.app.wsgi

 zope.app.wsgi shouldn't be a dependency of zope.testbrowser. It's ok
 if it's pulled in via a specific extra_requires like a [webtest]
 extra, though. Zope2 depends on zope.testbrowser and has no dependency
 on any zope.app packages - this must continue to be the case. Required
 test dependencies count towards real dependencies here.

 I understand your point, but the situation was already pretty nasty as
 zope.testbrowser already depended on:

    zope.app.appsetup
    zope.app.publication
    zope.app.testing = 3.8

 I agree that any extra dependency is not welcome, but this feature opens
 up a path to radically reducing the dependencies of zope.testbrowser.
 See below.

 The real fix would probably be to move the reusable code out of
 zope.app.wsgi into a zope.wsgi package, but that might be more than
 you are willing to do now. I do believe some of the Grok people would
 be interested in this as well.

 There is also another route open now with the addition of the webtest
 feature. We could invert the zope.testbrowser - zope.app.testing
 dependency.

 This is a major re-factoring, but will leave the zope.testbrowser
 dependencies looking like this:

    install_requires = [
        'mechanize=0.2.0',
        'setuptools',
        'zope.interface',
        'zope.schema',
        'pytz',
        ],
    extras_require = {
        'test': [
            'WebOb',
            'WebTest',
                ]

 Basically this would require:

    * Re-writing the zope.testbrowser.ftests test application as a pure
      WSGI app (using WebOb)
    * Test only against zope.testbrowser.wsgi and refactor tests to not
      use features from zope.app.testing.functional
    * Move zope.testbrowser.testing into zope.testbrowser.wsgi and
      zope.app.testing.testbrowser
    * Leave backwards compatibility imports in place in
      zope.testbrowser.testing

 I'd be willing to have a look at this if Benji were OK in principle on
 this and someone was willing to review it.

 --
 Brian Sutherland
 ___
 Zope-Dev maillist  -  zope-...@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 )

Hi Brian,

I'd be happy to contribute to your zope.testbrowser refactoring. I am
primarily interested from the perspective of grok and zope.app.wsgi.

-- 
Jan-Jaap Driessen
___
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] [Checkins] SVN: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py Don't import site on initialization, as this mitigates the buildout 1.5 way of setting sys.path

2010-12-13 Thread Jan-Jaap Driessen
Hi Michael,

On 12 December 2010 21:49, Jan-Jaap Driessen
jdries...@thehealthagency.com wrote:
 Hi Michael,

 On 26 November 2010 08:37, Michael Howitz m...@gocept.com wrote:
 Hi,

 currently the ZTK tests on the trunk do not run successfully in a virtualenv.

 The errors look like:

 atom:trunk mac$ bin/test-ztk
 Running test-ztk-zope.securitypolicy
 test-ztk-zope.securitypolicy failed with:
 Traceback (most recent call last):
  File 
 /Users/mac/Documents/tmp/zopetoolkit/trunk/bin/test-ztk-zope.securitypolicy,
  line 35, in module
    import zope.testrunner
  File 
 /Users/mac/Documents/eggs/zope.securitypolicy-3.7.0-py2.5.egg/zope/__init__.py,
  line 1, in module
    __import__('pkg_resources').declare_namespace(__name__)
  File 
 /Users/mac/Documents/eggs/distribute-0.6.14-py2.5.egg/pkg_resources.py, 
 line 17, in module
    from urlparse import urlparse, urlunparse
 ImportError: No module named urlparse
 ...

 When I revert the following change, only the test for zope.testing fails 
 (and all zope.app-tests pass):

 Am 06.10.2010 um 08:40 schrieb Jan-Jaap Driessen:
 Log message for revision 117268:
  Don't import site on initialization, as this mitigates the buildout 1.5 
 way of setting sys.path

 Changed:
  U   z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py

 -=-
 Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py
 ===
 --- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py   
 2010-10-06 06:30:44 UTC (rev 117267)
 +++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py   
 2010-10-06 06:40:43 UTC (rev 117268)
 @@ -31,7 +31,7 @@
     def start(self):
         self.start = time.time()
         self.process = subprocess.Popen(
 -            [sys.executable, self.script, '--exit-with-status'] + 
 self.args,
 +            [sys.executable, '-S', self.script, '--exit-with-status'] + 
 self.args,
             stdin=subprocess.PIPE,
             stdout=subprocess.PIPE,
             stderr=subprocess.STDOUT,

 But reverting this change does not help to get the tests of 
 z3c.recipe.compattest itself running again. There are the same errors like 
 before.

 Is it intensional that ZTK tests fail in virtualenv?
 What needs be done to get the tests running again in virtualenv?

 It took a while for me to react to your email, my apologies. I
 remember now that I added the '-S' to z3c.recipe.compattest in order
 to make compattest run on windows machines. It was not my intention to
 break running from inside a virtualenv. I'll look into the issue some
 more this week.

It looks like this patch to z3c.recipe.compattest fixes the virtualenv issue:

http://pastie.org/1374124

With this patch I successfully ran the ZTK trunk tests on Windows and
OSX machines inside and outside a virtualenv.

If nobody objects, I'll release this as z3c.recipe.compattest 0.13.1.

-- 
Jan-Jaap Driessen
___
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] Fwd: FAILED : winbot / zope.traversing_py_265_32

2010-12-12 Thread Jan-Jaap Driessen
On 12 December 2010 13:45, Adam GROSZER agros...@gmail.com wrote:
 Hello,

 Could you please fix that version spec?

 This is a forwarded message
 From: build...@winbot.zope.org build...@winbot.zope.org
 To: agros...@gmail.com, zope-te...@zope.org
 Date: Sunday, December 12, 2010, 5:49:55 AM
 Subject: FAILED : winbot / zope.traversing_py_265_32

 ===8==Original message text===
 FAILED : winbot / zope.traversing_py_265_32
 Build: http://winbot.zope.org/builders/zope.traversing_py_265_32/builds/0


 Build Reason: The Nightly scheduler named 'zope.traversing nightly' triggered 
 this build


 Build Source Stamp: [branch zope.traversing/trunk] HEAD


 Blamelist:


 Buildbot: http://winbot.zope.org/
 ===8===End of original message text===

 --
 Best regards,
  Adam GROSZER                            mailto:agros...@gmail.com

 ___
 Zope-Dev maillist  -  zope-...@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 )


I see the same `Getting distribution for
'zope.security[zcml]=3.8.0dev'.` error in the trunks of the following
packages:

zope.browserresource
zope.container


-- 
Jan-Jaap Driessen
___
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] [Checkins] SVN: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py Don't import site on initialization, as this mitigates the buildout 1.5 way of setting sys.path

2010-12-12 Thread Jan-Jaap Driessen
Hi Michael,

On 26 November 2010 08:37, Michael Howitz m...@gocept.com wrote:
 Hi,

 currently the ZTK tests on the trunk do not run successfully in a virtualenv.

 The errors look like:

 atom:trunk mac$ bin/test-ztk
 Running test-ztk-zope.securitypolicy
 test-ztk-zope.securitypolicy failed with:
 Traceback (most recent call last):
  File 
 /Users/mac/Documents/tmp/zopetoolkit/trunk/bin/test-ztk-zope.securitypolicy,
  line 35, in module
    import zope.testrunner
  File 
 /Users/mac/Documents/eggs/zope.securitypolicy-3.7.0-py2.5.egg/zope/__init__.py,
  line 1, in module
    __import__('pkg_resources').declare_namespace(__name__)
  File 
 /Users/mac/Documents/eggs/distribute-0.6.14-py2.5.egg/pkg_resources.py, 
 line 17, in module
    from urlparse import urlparse, urlunparse
 ImportError: No module named urlparse
 ...

 When I revert the following change, only the test for zope.testing fails (and 
 all zope.app-tests pass):

 Am 06.10.2010 um 08:40 schrieb Jan-Jaap Driessen:
 Log message for revision 117268:
  Don't import site on initialization, as this mitigates the buildout 1.5 way 
 of setting sys.path

 Changed:
  U   z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py

 -=-
 Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py
 ===
 --- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py   
 2010-10-06 06:30:44 UTC (rev 117267)
 +++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py   
 2010-10-06 06:40:43 UTC (rev 117268)
 @@ -31,7 +31,7 @@
     def start(self):
         self.start = time.time()
         self.process = subprocess.Popen(
 -            [sys.executable, self.script, '--exit-with-status'] + self.args,
 +            [sys.executable, '-S', self.script, '--exit-with-status'] + 
 self.args,
             stdin=subprocess.PIPE,
             stdout=subprocess.PIPE,
             stderr=subprocess.STDOUT,

 But reverting this change does not help to get the tests of 
 z3c.recipe.compattest itself running again. There are the same errors like 
 before.

 Is it intensional that ZTK tests fail in virtualenv?
 What needs be done to get the tests running again in virtualenv?

It took a while for me to react to your email, my apologies. I
remember now that I added the '-S' to z3c.recipe.compattest in order
to make compattest run on windows machines. It was not my intention to
break running from inside a virtualenv. I'll look into the issue some
more this week.


Kind regards,

-- 
Jan-Jaap Driessen
___
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 Tests: 76 OK, 27 Failed

2010-12-09 Thread Jan-Jaap Driessen
On 24 November 2010 18:19, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

- snip -
 Subject: OK : Zope 3.4 Known Good Set / py2.5-32bit-linux
 From: buildbot at pov.lt
 Date: Tue Nov 23 23:00:54 EST 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-November/024840.html

 Can we please disable the 2.7 ZTK tests until somebody expects them to
 pass?  Specifically, this means that somebody with the C knowledge fixes
 the zope.proxy / zope.security / doctest issue which makes them all fail.

I disabled the py 2.7 ZTK tests on the THA buildbot.

 Also, can we make the Zope2 tests *not* run the tests for the ZTK, now
 that we are using it directly?  That would likely make them pass for 2.7.


 Tres.


-- 
Jan-Jaap Driessen
___
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] [Checkins] SVN: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py Don't import site on initialization, as this mitigates the buildout 1.5 way of setting sys.path

2010-11-26 Thread Jan-Wijbrand Kolman
On 11/26/10 8:37 AM, Michael Howitz wrote:
 currently the ZTK tests on the trunk do not run successfully in a
 virtualenv.
sip
 But reverting this change does not help to get the tests of
 z3c.recipe.compattest itself running again. There are the same errors
 like before.

 Is it intensional that ZTK tests fail in virtualenv? What needs be
 done to get the tests running again in virtualenv?

I don't think this was intentional. Then again, I guess it __was__ the 
intention to make use of the system-python-path-isolation-features in 
zc.buildout. Personally, I'm not sure where to start fixing this, help 
and insights appreciated...

regards, jw

___
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] [Checkins] SVN: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py Don't import site on initialization, as this mitigates the buildout 1.5 way of setting sys.path

2010-11-26 Thread Jan-Wijbrand Kolman
On 11/26/10 10:49 AM, Jan-Wijbrand Kolman wrote:
 On 11/26/10 8:37 AM, Michael Howitz wrote:
 currently the ZTK tests on the trunk do not run successfully in a
 virtualenv.
 sip
 But reverting this change does not help to get the tests of
 z3c.recipe.compattest itself running again. There are the same errors
 like before.

 Is it intensional that ZTK tests fail in virtualenv? What needs be
 done to get the tests running again in virtualenv?

 I don't think this was intentional. Then again, I guess it __was__ the
 intention to make use of the system-python-path-isolation-features in
 zc.buildout. Personally, I'm not sure where to start fixing this, help
 and insights appreciated...

Hmmm, maybe this has been completely obvious to others, but I guess it 
really boils down to: https://bugs.launchpad.net/virtualenv/+bug/572545 
where -S is broken in virtualenvs.

Grok's grokproject tool has exactly the same problems, where it doesn't 
work anymore in a virtualenv *and* we're using -S when calling a newly 
created project's bootstrap.py.

regards,jw

___
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] changes in zope.app.wsgi

2010-11-12 Thread Jan-Jaap Driessen
On the trunk of zope.app.wsgi I added functionality for injecting WSGI
middleware to tests using zope.app.wsgi.testlayer.BrowserLayer.

I'd like to release these changes as version 3.10, unless someone disagrees.

Thanks,

-- 
Jan-Jaap Driessen
___
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 Tests: 67 OK, 15 Failed

2010-10-25 Thread Jan-Jaap Driessen
On 25 October 2010 13:58, Zope Tests Summarizer zope-te...@epy.co.at wrote:
 Summary of messages to the zope-tests list.
 Period Sun Oct 24 12:00:00 2010 UTC to Mon Oct 25 12:00:00 2010 UTC.
 There were 82 messages: 6 from Zope Tests, 4 from buildbot at pov.lt, 19 from 
 buildbot at winbot.zope.org, 11 from ccomb at free.fr, 42 from jdriessen at 
 thehealthagency.com.


 Test failures
 -

 Subject: FAILED : Zope Buildbot / zope2.13-py2.7 slave-ubuntu64
 From: jdriessen at thehealthagency.com
 Date: Sun Oct 24 11:52:08 EDT 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-October/022177.html


- snip -

I am working on the buildslave fixing the failing builds. Expect more
failures emails in the next run.

 Subject: FAILED : winbot / ztk_dev py_265_win32
 From: buildbot at winbot.zope.org
 Date: Sun Oct 24 16:20:03 EDT 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-October/022216.html

 Subject: FAILED : winbot / ztk_10 py_254_win32
 From: buildbot at winbot.zope.org
 Date: Sun Oct 24 17:04:11 EDT 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-October/01.html

 Subject: FAILED : winbot / zc_buildout_dev py_254_win32
 From: buildbot at winbot.zope.org
 Date: Sun Oct 24 17:34:13 EDT 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-October/04.html

 Subject: FAILED : winbot / zc_buildout_dev py_265_win32
 From: buildbot at winbot.zope.org
 Date: Sun Oct 24 17:34:42 EDT 2010
 URL: http://mail.zope.org/pipermail/zope-tests/2010-October/05.html

 Tests passed OK
 ---

snip

 ___
 Zope-Dev maillist  -  zope-...@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 )




-- 
Jan-Jaap Driessen
___
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] (re)moving browser subpackage from zc.catalog?

2010-10-19 Thread Jan-Wijbrand Kolman
On 10/18/10 21:16 PM, Michael Howitz wrote:
 Am 18.10.2010 um 11:02 schrieb Jan-Wijbrand Kolman:
 I propose to release this as 1.5.0, which would be a major version
 release that would indicate: Watch out, potentially backwards
 incompatible changes ahead!.

 Right?

 +1 looks nice.

Done. Thanks.
regards, jw

___
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] zope.testrunner 4.0 release

2010-10-19 Thread Jan-Jaap Driessen
Hi Marius and Benji,

You two worked on zope.testrunner trunk most recently. Tests pass on
all platforms [1] Do you think zope.testrunner is ready for a 4.0
release?

This release would help py2.7 support for the ZTK trunk. I'd be happy
to do the release legwork.

1) http://dev.thehealthagency.com/buildbot/one_box_per_builder


-- 
Jan-Jaap Driessen
___
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] (re)moving browser subpackage from zc.catalog?

2010-10-18 Thread Jan-Wijbrand Kolman
Hi Michael and Marius,

Thanks for the feedback and suggestions! This is what I did:

On 10/13/10 15:37 , Michael Howitz wrote:
 Am 13.10.2010 um 13:50 schrieb Jan-Wijbrand Kolman:
 Then there's no real need for a browser extra, as the browser
 subpackage does not really have any code (only registrations). Or
 maybe you meant something different?

 When someone wants to use the browser package he could use the
 browser extra to get all the packages needed for the ZCML
 registrations successfully load. Otherwise he has to find out himself
 where the ZCML directives are declared.

I created two extra_requires: a browser and a test_browser. The first 
lists the dependencies for the browser subpackage to work. The second 
for the corresponding tests to run.

On 10/13/10 14:42 , Marius Gedminas wrote:
 On Wed, Oct 13, 2010 at 01:50:39PM +0200, Jan-Wijbrand Kolman wrote:
 Ah, no it wouldn't help there, as the testrunner would find the
 tests in the browser subpackage and it would try to run them
 regardless.
 You could always conditionally disable them: in each test*.py file
 have

 def test_suite(): suite = unittest.TestSuite() if some condition:
 suite.addTest(unittest.makeSuite(...))
 suite.addTest(doctest.DocTestSuite(...))
 suite.addTest(doctest.DocFileSuite(...)) return suite

I also made the tests.py in the browser subpackage only add tests to the 
test suite whenever the test_browser dependencies indeed are available. 
This fixes the situation where a test runner (in my case the test runner 
of the grok toolkit) finds these tests and would try to run them.

The CHANGES.txt contains instructions on how to enable the ZMI views for 
your project in case you need them.

I propose to release this as 1.5.0, which would be a major version 
release that would indicate: Watch out, potentially backwards 
incompatible changes ahead!.

Right?

Thanks again for your feedback!

kind regards, jw

___
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] Moving concrete IAuthenticatorPlugin implementations to zope.pluggableauth

2010-10-18 Thread Jan-Wijbrand Kolman
On 10/13/10 18:56 , Michael Howitz wrote:
 Am 13.10.2010 um 16:05 schrieb Jan-Wijbrand Kolman:

 Hi,

 A while ago zope.pluggable split off reusable components from
 zope.app.authentication. The concrete IAuthenticatorPlugin
 implementations (principalfolder and groupfolder) however, were left in
 zope.app.authentication.

 I think it makes sense to move these IAuthenticatorPlugin
 implementations to zope.pluggableauth.plugins as well, leaving backwards
 compatibility imports and the browser code in zope.app.authentication.

 For both packages I created branches [1][2] for working on this. I moved
 the components and made sure the tests pass again.

 If there're no objections I'd like to merge these branches to the
 respective trunks and eventually release zope.pluggableauth 1.1.0 and
 zope.app.authentication 3.9.0.

 +1

zope.pluggableauth 1.1 and zope.app.authentication 3.9.0 have been 
released. Thank you for your feedback.

regards, jw

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


  1   2   3   >