[Zope-Checkins] SVN: Zope/tags/2.11.1/ 'creating tag svn+ssh://[EMAIL PROTECTED]/repos/main/Zope/tags/2.11.1 from svn+ssh://[EMAIL PROTECTED]/repos/main/Zope/branches/2.11'

2008-07-16 Thread Andreas Jung
Log message for revision 88409:
  'creating tag svn+ssh://[EMAIL PROTECTED]/repos/main/Zope/tags/2.11.1 from 
svn+ssh://[EMAIL PROTECTED]/repos/main/Zope/branches/2.11'

Changed:
  A   Zope/tags/2.11.1/

-=-
Copied: Zope/tags/2.11.1 (from rev 88408, Zope/branches/2.11)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-dev] Re: [Plone-developers] PAULA: bringing Zope 3's authentication to Plone and beyond

2008-07-16 Thread Hermann Himmelbauer
Am Mittwoch, 16. Juli 2008 05:48 schrieb Florian Friesdorf:
 On Mon, Jul 14, 2008 at 09:50:25AM +0200, Hermann Himmelbauer wrote:
  (..)
  1) No way to pass PAU-related information to form-code: In PAU, the
  (..)
  2) Lack of documentation: The entities Principal, InternalPrincipal,
  PrincipalInfo are very confusing to a newbie, I still don't get the big
  picture.

 InternalPrincipal is a persistent object used to store the data of
 principals in a PrincipalFolder, PrincipalInfo is returned upon successfull
 authentication and handed to FoundPrincipalFactory, which extracts some
 information and returns Principal objects.

Ok, this is how I see it, too. But let me describe my understanding more 
specific:

I see it that way that applications with authentication will normally have 
something like a user object, which stores all related authentication/user 
information. This user object may reside in a RDB, a text file, or, as here, 
in a PrincipalFolder (as an InternalPrincipal).

If I understand it right, a Principal is an entity that is the result of an 
authentication process and holds all needed information for authorization. 
However, it is not designed to store user specific information, e.g. login 
names, user names and the like.

And PrincipalInfo is somehow a specific aggregation of user data, which can be 
used throughout the application. This object may have to be inherited to an 
extended MyPrincipalInfo object, as many applications may need extra info 
from this object.

So, both the Principal and PrincipalInfo objects have to be created out of the 
user object, it is not possible to create a Principal out of a PrincipalInfo 
and reverse.

Throughout my application, I have the following scenarios:

- I need to display some user data (e.g. in a logged in viewlet): I'd use 
PrincipalInfo.
- I need to check for authorization somewhere in my application: I'd use the 
Principal.
- I need to administer the user, e.g. change password etc.: I'd use the user 
object (InternalPrincipal) for that.
- ???

In my application, all I have is the principal (request.principal). So I need 
a viable way to retrieve PrincipalInfo and User/internalPrincipal objects.

How would I do that?

- user object: There seems to be no zope3 support for that yet - so it seems I 
have to do this manually (some getUser(login) function, get the login from 
request.principal.id[lenAUTH_PREFIX):], not very pretty, though.).
- PrincipalInfo: Don't really know - perhaps by somehow getting the PAU object 
and iterating over the authentication modules, calling some getPrincipalInfo 
method?

I personally would favour some adapters, e.g.:

InternalPrincipal = IInternalPrincipal(request)
PrincipalInfo = IPrincipalInfo(request)

The current documentation leaves many of the above points open, or at least, 
did not describe them in a way so that I could understand them.

  3) Lack of plugins: No plugin for URL-rewriting, e.g. cookie-less
  browsers (retrieving auth-information from URL) etc.

 I don't know about URL-rewriting, but you should be easily able to write
 your own credentials plugin to extract whatever you like from a request
 object.

Sure it's possible, that's what I did. But it was quite complicated and I had 
to dig very deep into Zope3 code to do that. This is definitely no option for 
a Zope developer who needs to quickly set up a cookie-less application.

  How excactly should I cache user data so that a single browser request
  does not lead to multiple RDB queries? And where in the big picture is
  the User entity? (It's probably the InternalPrincipal object, I
  assume)...

 You don't need InternalPrincipal objects, they are specific to
 PrincipalFolder, IMHO.

Well, yes and no - I need some user entity (which is located in the RDB), 
which somehow resembles the InternalPrincipal object.

 I think you need:
 - custom authenticator plugin, that authenticates against RDB and has a
   dictionary as cache: key = login, value = password;
 - custom foundprinciplefactory, that generates Principal objects from RDB
 data, again using a simple key=login,value=Principal dictionary as cache; -
 eventually a custom credentials plugin, that for your point 3.

That's basically what I did. However, I did not yet implement caching, as some 
things are not yet solved:

- What if the user changes his password? How would the cache update his data?
- What if a user is deleted?

So, it seems there needs to be some method that flushes the cache (e.g. if 
user data changes). Maybe it makes sense to create an extra UserCache utility 
that provides such methods. 

This should be very well laid out before implementing, I think.

Currently, every simple HTTP request leads to 3 select statements on my user 
table (due to authentication, prinipalInfo creation and the like). So, this 
is something that needs to be solved by caching.

  So I would very, very much suggest to dig into PAU first and fix those
  shortcomings before porting it to 

[Zope-dev] Zope Tests: 5 OK

2008-07-16 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Tue Jul 15 11:00:00 2008 UTC to Wed Jul 16 11:00:00 2008 UTC.
There were 5 messages: 5 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Tests
Date: Tue Jul 15 21:01:04 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-July/009860.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Jul 15 21:02:34 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-July/009861.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Jul 15 21:04:04 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-July/009862.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Jul 15 21:05:34 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-July/009863.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Jul 15 21:07:04 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-July/009864.html

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


[Zope-dev] Re: how many checkin lists?!

2008-07-16 Thread Philipp von Weitershausen

Chris Withers wrote:

Hi All,

Just me, or is it excessive that we have:

http://mail.zope.org/pipermail/zope3-checkins/


This one is obsolete now.


http://mail.zope.org/pipermail/zope-checkins/


This one is for Zope 2 only.


http://mail.zope.org/pipermail/checkins/


This one covers the whole repository.


...and maybe more I don't know about?

Surely one list would suffice?


I think so.

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

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Plone-developers] PAULA: bringing Zope 3's authentication to Plone and beyond

2008-07-16 Thread Philipp von Weitershausen

Tres Seaver wrote:

Mark Hammond wrote:

Well, Zope moved onwards from PAS to PAU


I doubt that seriously:  I would venture that there are two orders of
magnitude more users of PAS than PAU in production deployments.  PAU was
an attempt to port the PAS to a component-centric implementation, but
it lost at least a couple of key features along the way:  most notably,
the ZCA provides no way to control the ordering of the invocation of the
plugins.


The ZCA may have no built-in way to control the ordering, but PAU surely 
does control the ordering. It keeps an ordered list of plugin names. 
These plugins can either be contained items in the PAU (like in PAS) or 
utilities for ICredentialsPlugin or IAuthenticatorPlugin.


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

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Philipp von Weitershausen

Stephan Richter wrote:

Hi everyone,

I just tried to create a catalog for an annotation and noticed that it does 
not get filled. Digging around in the zope.annotation package, I noticed that 
the zope.annotation package does not send out any object events. This 
sucks. ;-)


Thus I propose:

- Add ObjectCreatedEvent event notification to zope.annotation factory call.


+0


- Add ObjectAddedEvent to attribute annotations __setitem__.

- Add ObjectRemovedEvent to attribute annotations __delitem__.


-1. As Fred said, these events are specific to containers (as in 
IContainer). IAnnotation adapters aren't containers and annotation 
objects aren't contained in them (as in IContained).


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

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Philipp von Weitershausen

Stephan Richter wrote:

On Tuesday 15 July 2008, Fred Drake wrote:

On Tue, Jul 15, 2008 at 12:30 PM, Stephan Richter

[EMAIL PROTECTED] wrote:

Thus I propose:

- Add ObjectCreatedEvent event notification to zope.annotation factory
call.

By this, I presume you mean the stuff in zope.annotation.factory; is that
right?


Yes.


In our group, we've decided to avoid that machinery.  It causes the
separation between data and code to become excessively blurred.  I'd
love to see that factory machinery become unused.  I definitely
consider it unusable.


I use it all the time. I think it makes development a lot easier.


I agree.

In fact, 
this came out of the ST project, where we constantly repeated this sort of 
code.


Not that it matters much, but I think it was Martijn Faassen who wrote it.


BTW, I really do not understand how it blurs the separation of code and data.


Me neither.

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

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] repoze.bfg

2008-07-16 Thread Chris McDonough

I've been working on a new web framework named (provisionally) repoze.bfg.

The relevant README is here: http://svn.repoze.org/repoze.bfg/trunk/README.txt

It is essentially a Zope lite.  It is Zope-ish in that:

 - it uses a lot of Zope libraries and concepts (interfaces, some CA constructs,
   ZCML)

 - it uses graph-traversal-based URL dispatch.

 - by default it provides ZPT (actually z3c.pt) templates.

 - it provides built-in authorization facilities based on permissions
   and users/groups.

It is unlike Zope (variously 2 or 3) inasmuch as:

 - It uses a different publisher and authorization model.

 - It is heavily dependent on WSGI.

 - Its equivalent of the publisher doesn't attempt to traverse into
   *code* stored in the object graph.  All code is on the filesystem.
   The only thing in the object graph is model data.

 - It doesn't attempt to provide any server functionality.  This duty is
   left over to WSGI.

 - It doesn't provide *authentication* functionality (just authorization
   functionality).  Authentication is left up to upstream server/middleware
   (e.g. repoze.who).

 - It's not meant to be plugged in to.  A repoze.bfg application is not
   a plugin to repoze.bfg (e.g. it's not a Zope2 Product).  Instead, a
   repoze.bfg application is just a Python package that happens to use
   repoze.bfg facilities.

 - The graph root is not effectively assumed to be a ZODB database.

 - It provides no built-in through-the-web management interface.

It's unlike Grok inasmuch as:

 - It doesn't try to hide ZCML for configuration.

If I were to characterize it succintly and informally, I migh say it's a bit 
like Django built around graph traversal dispatch instead of URL-based dispatch.


Speed is a priority.  A hello world template is currently clocking in at 
around 550 req/sec on my MacBook (including security lookups).


It's my intent to continue to develop it, along with a package named 
repoze.lemonade, which will integrate repoze.bfg with ZODB and provide various 
persistence-related features (folders, object events, indexing and so forth).


In any case, I thought maybe some folks would be interested in 
using/contributing to it.  It can be checked out via:


svn co http://svn.repoze.org/repoze.bfg/trunk/

Thanks,

- C

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

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Stephan Richter
On Wednesday 16 July 2008, Philipp von Weitershausen wrote:
  this came out of the ST project, where we constantly repeated this sort
  of code.

 Not that it matters much, but I think it was Martijn Faassen who wrote it.

... who worked on ST at the time and saw this pattern there.

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Stephan Richter
On Wednesday 16 July 2008, Fred Drake wrote:
 I suspect this is what you mean, though we've been mostly referring to
 the added event.

Right.

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Fred Drake
On Wed, Jul 16, 2008 at 10:45 AM, Stephan Richter
[EMAIL PROTECTED] wrote:
 But I agree. The system supports simple type and that is one of the use cases.
 While I originally wanted to add at least 2 of the events to the IAnnotations
 adapter itself, I agree with you that the overhead penalty might be too
 severe.

I don't think I said anything about a penalty on this, though that
could certainly be an issue.  I doubt it really is, though.

 With this in mind, I am modifying my proposal to add 2 event notifications to
 the factory only to produce a function like this (it is the result of calling
 the annotation factory):

My preference would be that these events would not be specific to the
factory, keeping the model clean.

 I am torn whether the created event should be a annotation specific or not,
 because an object is not an annotation until it has been added as one.

The created event should not be annotation-specific, for the reason you cite


 -Fred

-- 
Fred L. Drake, Jr. fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Wichert Akkerman
Previously Stephan Richter wrote:
 On Wednesday 16 July 2008, Fred Drake wrote:
  On Wed, Jul 16, 2008 at 10:26 AM, Stephan Richter
 
  [EMAIL PROTECTED] wrote:
   I agree. I realized only later that those events are defined in the
   zope.app.container package. In this case I would just create new
   annotation-specific events based on ObjectEvent, which is defined in
   zope.component, and zope.component is already a dependency.
 
  Hmm.  Would these be fired by the IAnnotations adapter or by the
  factory?  There might be some interesting tradeoffs there.  Many
  annotations are just simple data types (strings, tuples,
  dictionaries); those can be used with object events, but it seems a
  little non-intuitive.
 
 I do not think that I have a single annotation that is a simple type.
 I cannot even think of a quick example where any of the Zope 3 core
 packages have/use simple type annotations.

FWIW none of my code uses anything other than simple types for
annotations.

Wichert.

-- 
Wichert Akkerman [EMAIL PROTECTED]It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


AW: [Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Roger Ineichen
Hi Stephan

 Betreff: Re: [Zope-dev] Re: No events in zope.annotation

[...]

  I do not think that I have a single annotation that is a 
 simple type.
  I cannot even think of a quick example where any of the Zope 3 core 
  packages have/use simple type annotations.
 
 FWIW none of my code uses anything other than simple types 
 for annotations.

Even worse, I store objects in the annotation wich are added to
a real IContainer as items somewhere else. This objects are created,
added etc. already in the other container and provide locations
from there.

How can you skip events for this referenced objects?

I think a event ware PrincipalAnnotation should be
a second option and the existing should stay without events.

Or probably add a property like:
principalAnnotation.notifyAddedEvent = True

Or implement a pattern which allows to notify events
for specific interfaces if items get added.

I'm fine with everything if you make sure that you 
don't notify events for my referenced objects. At least 
not with default events which hook up existing subscribers.

Regards
Roger Ineichen

 Wichert.
 
 -- 
 Wichert Akkerman [EMAIL PROTECTED]It is simple to make things.
 http://www.wiggy.net/   It is hard to make 
 things simple.
 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  ** (Related lists -  
 http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )
 

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


Re: [Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Fred Drake
On Wed, Jul 16, 2008 at 11:33 AM, Roger Ineichen [EMAIL PROTECTED] wrote:
 Even worse, I store objects in the annotation wich are added to
 a real IContainer as items somewhere else. This objects are created,
 added etc. already in the other container and provide locations
 from there.

Only the factory should generate object created events; it sounds like
you're not using that.

The added/replaced/removed events should not be the containment events
at all, though making them object events should be acceptable.

I don't see any need for a way to suppress them, since they shouldn't
trigger any subscribers for the normal containment events.


 -Fred

-- 
Fred L. Drake, Jr. fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.app.locales/trunk/ added filePattern parameter for tal_strings to be able to not only parse

2008-07-16 Thread Benji York
On Wed, Jul 16, 2008 at 10:41 AM, Juergen Kartnaller
[EMAIL PROTECTED] wrote:
 Log message for revision 88402:
  added filePattern parameter for tal_strings to be able to not only parse
  *.pt files.

This looks like a new feature, and as such warrants a version bump to 3.5.0.

 Changed:
  U   zope.app.locales/trunk/CHANGES.txt
  U   zope.app.locales/trunk/setup.py
  U   zope.app.locales/trunk/src/zope/app/locales/extract.py

 -=-
 Modified: zope.app.locales/trunk/CHANGES.txt
 ===
 --- zope.app.locales/trunk/CHANGES.txt  2008-07-16 13:35:48 UTC (rev 88401)
 +++ zope.app.locales/trunk/CHANGES.txt  2008-07-16 14:40:57 UTC (rev 88402)
 @@ -2,9 +2,11 @@
  CHANGES
  ===

 -3.4.5 (unreleased)
 +3.4.5 (2008-07-16)
  --

 +* added filePattern parameter for tal_strings to be able to not only parse
 +  *.pt files.
  * Updated Dutch translation

  3.4.4 (2008-03-05)

 Modified: zope.app.locales/trunk/setup.py
 ===
 --- zope.app.locales/trunk/setup.py 2008-07-16 13:35:48 UTC (rev 88401)
 +++ zope.app.locales/trunk/setup.py 2008-07-16 14:40:57 UTC (rev 88402)
 @@ -22,7 +22,7 @@
 return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

  setup(name='zope.app.locales',
 -  version = '3.4.5dev',
 +  version = '3.4.5',
   author='Zope Corporation and Contributors',
   author_email='[EMAIL PROTECTED]',
   description='Zope locale extraction and management utilities',

 Modified: zope.app.locales/trunk/src/zope/app/locales/extract.py
 ===
 --- zope.app.locales/trunk/src/zope/app/locales/extract.py  2008-07-16 
 13:35:48 UTC (rev 88401)
 +++ zope.app.locales/trunk/src/zope/app/locales/extract.py  2008-07-16 
 14:40:57 UTC (rev 88402)
 @@ -441,7 +441,11 @@
 context = config(site_zcml, features=(devmode,), execute=False)
 return context.i18n_strings.get(domain, {})

 -def tal_strings(dir, domain=zope, include_default_domain=False, 
 exclude=()):
 +def tal_strings(dir,
 +domain=zope,
 +include_default_domain=False,
 +exclude=(),
 +filePattern='*.pt'):
 Retrieve all TAL messages from `dir` that are in the `domain`.

from zope.app.locales import extract
 @@ -480,6 +484,16 @@
extract.tal_strings(dir, domain='xml')
   {u'Link Content': [('...xml.pt', 8)]}

 +We also provide a file with a different file ending:
 +
 +   testpt = open(os.path.join(dir, 'test.html'), 'w')
 +   testpt.write('tal:block i18n:domain=html 
 i18n:translate=html/tal:block')
 +   testpt.close()
 +
 +   extract.tal_strings(dir, domain='html', 
 include_default_domain=True,
 +  ... filePattern='*.html')
 +  {'html': [('...test.html', 1)]}
 +
 Cleanup

import shutil
 @@ -497,7 +511,7 @@
 def write(self, s):
 pass

 -for filename in find_files(dir, '*.pt', exclude=tuple(exclude)):
 +for filename in find_files(dir, filePattern, exclude=tuple(exclude)):
 f = file(filename,'rb')
 start = f.read(6)
 f.close()

 ___
 Checkins mailing list
 [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/checkins

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


Re: [Zope-dev] Re: No events in zope.annotation

2008-07-16 Thread Fred Drake
On Wed, Jul 16, 2008 at 11:46 AM, Fred Drake [EMAIL PROTECTED] wrote:
 I don't see any need for a way to suppress them, since they shouldn't
 trigger any subscribers for the normal containment events.

Based on some discussion here, I realize that my position may not be
terribly clear.  Just to make myself clear:

- Do what you want with the factory; I don't want it used (directly or
indirectly) from the ZC codebase (not that I get to set policy or
anything).

- I think it's reasonable for an IAnnotations provider to generate
annotations-related events for add/replace/remove operations.

- I see no reason that the default IAnnotations implementations
generate events; we want to avoid firing events all over the place
just so we can ignore them.

The last, in particular, needed to be stated explicitly.


 -Fred

-- 
Fred L. Drake, Jr. fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.testing 3.6.0 released

2008-07-16 Thread Adam GROSZER
Hey Benji,

Seems that it breaks coverage...

The result looks like coverage is started after importing the modules
to test. That means declarations do not seem to 'run', but just the code
inbetween them.
Checked with 3.5.1, it looks fine.



-- 
Best regards,
 Adam GROSZERmailto:[EMAIL PROTECTED]
--
Quote of the day:
An ounce of emotion is equal to a ton of facts.  -  John Junor

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


Re: [Zope-dev] zope.testing 3.6.0 released

2008-07-16 Thread Benji York
On Wed, Jul 16, 2008 at 1:19 PM, Adam GROSZER [EMAIL PROTECTED] wrote:
 Hey Benji,

 Seems that it breaks coverage...

In what way is coverage broken?  With or without -j?  Can you formulate
a test that demonstrates the breakage?

 The result looks like coverage is started after importing the modules
 to test. That means declarations do not seem to 'run', but just the code
 inbetween them.
 Checked with 3.5.1, it looks fine.

I suspect the breakage happened prior in the lifetime of 3.6.0 to my
changes.  If you would, please try to find the revision that introduced
the breakage.  My first comparison would be between r85079 and r86460.
-- 
Benji York
Senior Software Engineer
Zope Corporation
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

2008-07-16 Thread Lennart Regebro
On Wed, Jul 16, 2008 at 20:22, Stephan Richter
[EMAIL PROTECTED] wrote:
 On Wednesday 16 July 2008, Lennart Regebro wrote:
 Log message for revision 88417:
   Changed the API. It's unwieldy as it is, so better have separate method
   for plurals.

 It looks to me as if you only support one singular and one plural form.

Nope. Although I currently only test that case.

 I have read some commentary a long time ago, that some languages, like 
 Polish, have
 multiple plural forms. Is that supported?

Should be, but it's not tested yet.

While talking about this, what would a ZPT implementation of this best
look like? An i18n:count statement that takes expressions?

   p i18n:translate= i18n:count=view/file_countThere are %d files/p

Or?

-- 
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

2008-07-16 Thread Stephan Richter
On Wednesday 16 July 2008, Lennart Regebro wrote:
 While talking about this, what would a ZPT implementation of this best
 look like? An i18n:count statement that takes expressions?

    p i18n:translate= i18n:count=view/file_countThere are %d files/p

 Or?

Good question! The ZPT above is not correct; once we write a correct one, it 
becomes more obvious:

p i18n:translate=There are span tal:content=view/num i18n:name=num 
i18n:count=view/num10/span files./p

Alternatively we could just evaluate the tal:content or tal:replace 
expression.

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Tesing a module against against dependencies in different versions

2008-07-16 Thread Andreas Jung

Hi there,

we maintain some modules that should work against different versions of 
dependent module. E.g. my z3c.sqlalchemy module should work with


Sqlalchemy 0.3.X and zope.interface 3.0.X
or
SQLAlchemy =0.4.X and zope.interface=3.3.0

The codebase right works with both combinations. I am not sure how test 
such configurations automatically because the dependent modules and their 
versions are fixed within the setup.py. Is there some way together with 
Buildout, zope.testing  friends?


Andreas
-  

pgpjLL1OF2aDJ.pgp
Description: PGP signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re[2]: [Zope-dev] zope.testing 3.6.0 released

2008-07-16 Thread Adam GROSZER
Hello Benji,

Sorry, now being specific with the facts (all other activities only
tomorrow (I'll check the revisions))

Results are generated by:
python bootstrap.py
bin/buildout
bin/coverage-test
bin/coverage-report

on the source of:
svn://svn.zope.org/repos/main/Sandbox/adamg/ocql/branches/optimize-with-index
(WARNING: buildout.cfg has now zope.testing nailed to 3.5.1)
same python, same everything, just zope.testing switched

Good coverage is: (with 3.5.1):
lines   cov%   module   (path)
   40   100%   ocql.aoptimizer.aoptimizer   
(/home/adi/ocql/src/ocql/aoptimizer/aoptimizer.py)
887%   ocql.aoptimizer.tests   
(/home/adi/ocql/src/ocql/aoptimizer/tests.py)
  13585%   ocql.compiler.compiler   
(/home/adi/ocql/src/ocql/compiler/compiler.py)
   4560%   ocql.compiler.runnablequery   
(/home/adi/ocql/src/ocql/compiler/runnablequery.py)
   1090%   ocql.compiler.tests   (/home/adi/ocql/src/ocql/compiler/tests.py)
   3193%   ocql.database.index   (/home/adi/ocql/src/ocql/database/index.py)
   6994%   ocql.database.metadata   
(/home/adi/ocql/src/ocql/database/metadata.py)
887%   ocql.database.tests   (/home/adi/ocql/src/ocql/database/tests.py)
   29   100%   ocql.engine   (/home/adi/ocql/src/ocql/engine.py)
   35   100%   ocql.interfaces   (/home/adi/ocql/src/ocql/interfaces.py)
  23972%   ocql.parser.queryparser   
(/home/adi/ocql/src/ocql/parser/queryparser.py)
988%   ocql.parser.tests   (/home/adi/ocql/src/ocql/parser/tests.py)
   19   100%   ocql.qoptimizer.qoptimizer   
(/home/adi/ocql/src/ocql/qoptimizer/qoptimizer.py)
988%   ocql.qoptimizer.tests   
(/home/adi/ocql/src/ocql/qoptimizer/tests.py)
  32683%   ocql.queryobject.queryobject   
(/home/adi/ocql/src/ocql/queryobject/queryobject.py)
  15088%   ocql.rewriter.algebra   
(/home/adi/ocql/src/ocql/rewriter/algebra.py)
   54   100%   ocql.rewriter.interfaces   
(/home/adi/ocql/src/ocql/rewriter/interfaces.py)
   18   100%   ocql.rewriter.rewriter   
(/home/adi/ocql/src/ocql/rewriter/rewriter.py)
988%   ocql.rewriter.tests   (/home/adi/ocql/src/ocql/rewriter/tests.py)
   6290%   ocql.testing.database   
(/home/adi/ocql/src/ocql/testing/database.py)
   28   100%   ocql.testing.sample.interfaces   
(/home/adi/ocql/src/ocql/testing/sample/interfaces.py)
988%   ocql.testing.sample.mentor   
(/home/adi/ocql/src/ocql/testing/sample/mentor.py)
988%   ocql.testing.sample.organization   
(/home/adi/ocql/src/ocql/testing/sample/organization.py)
988%   ocql.testing.sample.project   
(/home/adi/ocql/src/ocql/testing/sample/project.py)
   10   100%   ocql.testing.sample.student   
(/home/adi/ocql/src/ocql/testing/sample/student.py)
   73   100%   ocql.testing.stubs   (/home/adi/ocql/src/ocql/testing/stubs.py)
   80   100%   ocql.testing.utils   (/home/adi/ocql/src/ocql/testing/utils.py)
   8596%   ocql.testing.utils_opt   
(/home/adi/ocql/src/ocql/testing/utils_opt.py)
  25094%   ocql.tests.test_old   (/home/adi/ocql/src/ocql/tests/test_old.py)
   1794%   ocql.tests.test_skeleton   
(/home/adi/ocql/src/ocql/tests/test_skeleton.py)
   1593%   ocql.tests.test_utils   
(/home/adi/ocql/src/ocql/tests/test_utils.py)
  10588%   ocql.tests.test_zope   
(/home/adi/ocql/src/ocql/tests/test_zope.py)

Bad coverage is (with 3.6.0):
lines   cov%   module   (path)
   3953%   ocql.aoptimizer.aoptimizer   
(/home/adi/ocql/src/ocql/aoptimizer/aoptimizer.py)
  13430%   ocql.compiler.compiler   
(/home/adi/ocql/src/ocql/compiler/compiler.py)
   4422%   ocql.compiler.runnablequery   
(/home/adi/ocql/src/ocql/compiler/runnablequery.py)
   2924%   ocql.database.index   (/home/adi/ocql/src/ocql/database/index.py)
   6850%   ocql.database.metadata   
(/home/adi/ocql/src/ocql/database/metadata.py)
   2835%   ocql.engine   (/home/adi/ocql/src/ocql/engine.py)
  23826%   ocql.parser.queryparser   
(/home/adi/ocql/src/ocql/parser/queryparser.py)
   1827%   ocql.qoptimizer.qoptimizer   
(/home/adi/ocql/src/ocql/qoptimizer/qoptimizer.py)
  32541%   ocql.queryobject.queryobject   
(/home/adi/ocql/src/ocql/queryobject/queryobject.py)
  14939%   ocql.rewriter.algebra   
(/home/adi/ocql/src/ocql/rewriter/algebra.py)
   1729%   ocql.rewriter.rewriter   
(/home/adi/ocql/src/ocql/rewriter/rewriter.py)
   61 8%   ocql.testing.database   
(/home/adi/ocql/src/ocql/testing/database.py)
911%   ocql.testing.sample.student   
(/home/adi/ocql/src/ocql/testing/sample/student.py)
   7225%   ocql.testing.stubs   (/home/adi/ocql/src/ocql/testing/stubs.py)
   7972%   ocql.testing.utils   (/home/adi/ocql/src/ocql/testing/utils.py)
   8596%   ocql.testing.utils_opt   
(/home/adi/ocql/src/ocql/testing/utils_opt.py)
  24979%   ocql.tests.test_old   (/home/adi/ocql/src/ocql/tests/test_old.py)
   1625%   ocql.tests.test_skeleton   
(/home/adi/ocql/src/ocql/tests/test_skeleton.py)
   1421%   ocql.tests.test_utils   

[Zope-dev] zope.app.container 3.5.4 bugfix release

2008-07-16 Thread Christophe Combelles

I've added a tag for the 3.5.4 bugfix release of zope.app.container.

Could someone please add me on the owners list on pypi so that I can upload it?

thanks,
Christophe
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Tesing a module against against dependencies in different versions

2008-07-16 Thread Fred Drake
On Wed, Jul 16, 2008 at 2:59 PM, Andreas Jung [EMAIL PROTECTED] wrote:
 we maintain some modules that should work against different versions of
 dependent module. E.g. my z3c.sqlalchemy module should work with

 Sqlalchemy 0.3.X and zope.interface 3.0.X
 or
 SQLAlchemy =0.4.X and zope.interface=3.3.0

 The codebase right works with both combinations. I am not sure how test such
 configurations automatically because the dependent modules and their
 versions are fixed within the setup.py. Is there some way together with
 Buildout, zope.testing  friends?

This remains a tricky case.  :-(

I suspect the best thing is for the setup.py not to mention any of the
packages for which there are different names, and the versions should
be specified in the buildout.cfg as requirements for separate test
scripts.

I.e., zope.interface could be mentioned in setup.py (sans version),
but the sql alchemy packages would not be since the names differ.

You could then create test scripts like so:

[test-one]
recipe = zc.recipe.testrunner
eggs =
z3c.sqlalchemy
Sqlalchemy =0.3.0, 0.4.0
zope.interface =3.0.0

[test-two]
recipe = zc.recipe.testrunner
eggs =
z3c.sqlalchemy
SQLAlchemy =0.4.0
zope.interface =3.3.0

I expect you could come up with better names than test-one and
test-two; I'm creativity-challenged at the moment.  :-)


 -Fred

-- 
Fred L. Drake, Jr. fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

2008-07-16 Thread Hanno Schlichting

Hi.

It's awesome to see some progress on this. You are aware of the Gettext 
manual at 
http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms right?


Stephan Richter wrote:

On Wednesday 16 July 2008, Lennart Regebro wrote:

While talking about this, what would a ZPT implementation of this best
look like? An i18n:count statement that takes expressions?

   p i18n:translate= i18n:count=view/file_countThere are %d files/p

Or?


Good question! The ZPT above is not correct; once we write a correct one, it 
becomes more obvious:


p i18n:translate=There are span tal:content=view/num i18n:name=num 
i18n:count=view/num10/span files./p


Alternatively we could just evaluate the tal:content or tal:replace 
expression.


So here's a set of additional use-cases:

p i18n:translate=
You selected the book called
span tal:content=title i18n:name=titlePython for dummies/span.
/p

In this case, the i18n:name shouldn't be treated as a number, so I think 
we need an explicit statement like i18n:count to signal this. We could 
have the i18n:count default to taking the expression if it is empty.



p i18n:translate=
You have to pay
span tal:content=view/formatted_amount i18n:name=amount 
i18n:count=view/amount6 dollars/span.

/p

In this case the underlying value is a simple integer, but the actual 
presentation might be locale dependent, like currency formatting.



p i18n:translate=
You selected
span tal:content=num i18n:name=num5/span
out of
span tal:content=total i18n:name=total10/span
files.
/p

I'm not sure what to do with this actually. How does multiple numbers in 
the same sentence are handled? I think this is just not allowed and 
should cause a syntax error, as there's no general way to translate 
those sentences with Gettext. Or does it result in a n-dimensional matrix?


br i18n:attributes=
You selected
span tal:content=num i18n:name=num5/span
out of
span tal:content=total i18n:name=total10/span
files.
/p


Can someone think about an example involving i18n:attributes? In TAL I 
cannot construct a dynamic one it seems.



How does this behave in regard to zope.i18nmessageid?

from zope.i18nmessageid import MessageFactory
_ = MessageFactory('domain')


mapping=dict(num=10)
foo = _(u'There are ${num} files.', mapping=mapping)


mapping=dict(num=10, name='/foo/bar')
foo = _(u'There are ${num} files in the folder named ${name}.', 
mapping=mapping)



So I think we need to signal to the messageid which variable in the 
mapping is significant for the i18n count, right?


Hanno

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

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

2008-07-16 Thread Hanno Schlichting

Sorry.

There's some garbage in my last message. Disregard the following bits.

Hanno Schlichting wrote:

br i18n:attributes=
You selected
span tal:content=num i18n:name=num5/span
out of
span tal:content=total i18n:name=total10/span
files.
/p

Can someone think about an example involving i18n:attributes? In TAL I 
cannot construct a dynamic one it seems.


Hanno

P.S. There isn't someone working on msgctxt support, is there ;)
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

2008-07-16 Thread Lennart Regebro
On Wed, Jul 16, 2008 at 20:55, Stephan Richter
[EMAIL PROTECTED] wrote:
 Good question! The ZPT above is not correct; once we write a correct one, it
 becomes more obvious:

 p i18n:translate=There are span tal:content=view/num i18n:name=num
 i18n:count=view/num10/span files./p

Ah, well, right. Of course all the examples you a %d substitution, but
I just realized that gettext in itself does no substituation at all,
so this is better. We should use the standard ${name} substitution for
this too. However, you can't have more than one number per message, so

p i18n:translate=There are span tal:content=view/num
i18n:name=num  i18n:count=view/num10/span files and span
tal:content=view/num i18n:name=num
i18n:count=view/dirs10/spandirectories./p

wouldn't make any sense. Which number should be used? So I actually
think i18n:count still should be on the main tag.

 Alternatively we could just evaluate the tal:content or tal:replace
 expression.

But then we wouldn't know if we have a plural substitution or not, and
we would have to start guessing...

-- 
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

2008-07-16 Thread Lennart Regebro
On Wed, Jul 16, 2008 at 22:36, Hanno Schlichting [EMAIL PROTECTED] wrote:
 p i18n:translate=
 You have to pay
 span tal:content=view/formatted_amount i18n:name=amount
 i18n:count=view/amount6 dollars/span.
 /p

 In this case the underlying value is a simple integer, but the actual
 presentation might be locale dependent, like currency formatting.

Ah. Yes, that's a nice usecase I hadn't thought about.

 I'm not sure what to do with this actually. How does multiple numbers in the
 same sentence are handled? I think this is just not allowed and should cause
 a syntax error, as there's no general way to translate those sentences with
 Gettext. Or does it result in a n-dimensional matrix?

No, gettext only supports one number per message.

 How does this behave in regard to zope.i18nmessageid?

There will need to be some extension of the API, I think.

 So I think we need to signal to the messageid which variable in the mapping
 is significant for the i18n count, right?

It's easier to just pass in the i18n count separately, IMO.

-- 
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

2008-07-16 Thread Hanno Schlichting

Lennart Regebro wrote:

On Wed, Jul 16, 2008 at 22:36, Hanno Schlichting [EMAIL PROTECTED] wrote:

p i18n:translate=
You have to pay
span tal:content=view/formatted_amount i18n:name=amount
i18n:count=view/amount6 dollars/span.
/p

In this case the underlying value is a simple integer, but the actual
presentation might be locale dependent, like currency formatting.


Ah. Yes, that's a nice usecase I hadn't thought about.


How does this behave in regard to zope.i18nmessageid?


There will need to be some extension of the API, I think.


So I think we need to signal to the messageid which variable in the mapping
is significant for the i18n count, right?


It's easier to just pass in the i18n count separately, IMO.


Right. Since otherwise you won't be able to support the same use-case I 
outlined above in regard to the currency formatting. There the count 
variable might not be contained in the mapping at all.


Hanno

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

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.app.container 3.5.4 bugfix release

2008-07-16 Thread Baiju M
- Christophe Combelles [EMAIL PROTECTED] wrote:
 I've added a tag for the 3.5.4 bugfix release of zope.app.container.
 
 Could someone please add me on the owners list on pypi so that I can
 upload it?

Your PyPI ID ?

--
Baiju M

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


[Zope] TALES expression

2008-07-16 Thread Garito
Hi!
Please consider this TALES expression:

div class=DataPrevista tal:content='here/getDataInici | string: nosta' /

If I try this other: div tal:content='string:${here/getDataInici}' / the
result is divNone/div

Then the first one will render the alternate expression isn't it?

Then with it renders div class=DataPrevista / ?

Thanks!

-- 
Mis Cosas
http://blogs.sistes.net/Garito
Zope Smart Manager
http://blogs.sistes.net/Garito/670
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] TALES expression

2008-07-16 Thread Martijn Jacobs



Hi!
Please consider this TALES expression:

div class=DataPrevista tal:content='here/getDataInici | string: 
nosta' /


If I try this other: div tal:content='string:${here/getDataInici}' / 
the result is divNone/div


Then the first one will render the alternate expression isn't it?

Then with it renders div class=DataPrevista / ?

Thanks!


I don't understand what you are asking. Could you describe your question 
more clear please.



Martijn.

--
Martijn Jacobs
Four Digits, Internet Solutions

a: Willemsplein 15-1 6811 KB Arnhem NL 
kvk: 09162137 | btw: 8161.22.234.B01

e-mail: [EMAIL PROTECTED] | web: http://www.fourdigits.nl
tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117 


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Redirect URL

2008-07-16 Thread Subhendu Kumar Giri




I modify the rewrite rule


VirtualHost xxx.xxx.xxx.xxx
ServerName mydomain.org
RewriteEngine On
RewriteRule ^/article/view/([0-9]*)/(.*) /archieve/$1 [R]
RewriteRule ^/zoperoot(.*)
http://xxx.xxx.xxx.xxx:8080/VirtualHostBase/http/mydomain.org:80/VirtualHostRoot/_vh_zoperoot$1
[P,L]
RewriteRule ^/(.*)
http://xxx.xxx.xxx.xxx:8080/VirtualHostBase/http/mydomain.org:80/mydomaininstance/VirtualHostRoot/$1
[P,L]
/VirtualHost

and it is working 
Thanks for the support.

Subhendu


Subhendu Kumar Giri wrote:

  
Andreas,
  
Thanks for the response.
  
I write in rewrite rule in httpd.conf
  
VirtualHost xxx.xxx.xxx.xxx
ServerName mydomain.org
ServerAlias www.mydomain.org
ProxyPass /
  http://xxx.xxx.xxx.xxx/VirtualHostBase/http/mydomain.org:80/mydomaininstance/VirtualHostRoot/
ProxyPassReverse /
  http://xxx.xxx.xxx.xxx:8080/VirtualHostBase/http/mydomain.org:80/mydomaininstance/VirtualHostRoot/
/VirtualHost
  
How can i redirect www.mydomain.com/article/view/11525/1/
to
  www.mydomain.com/archieve/11525
  
  
Andreas Jung wrote:
  

--On 15. Juli 2008 13:14:53 +0530 Subhendu Kumar Giri
[EMAIL PROTECTED]
wrote: 

Hi All, 
  
Previously I have a website running in php. Now we migrated it to plone
  
2.5.5 and zope 2.9. After that I want to maintain all the previous
links 
. Earlier it was like www.mydomain.com/article/view/11525/1/
(where 
11525 is the article id). Now I created a archieve folder where I 
migrated the contents. The new link is www.mydomain.com/archieve/11525.
I 
tried to redirect it from default_error_message but it did not work as
it 
shows the folder contents of article folder. 
  
What should be done to redirect the old url to new url. 


Apache rewrite rules? 

-aj
  


-- 


Subhendu Kumar Giri
Subhendu Kumar Giri [  ]






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


Re: [Zope] TALES expression

2008-07-16 Thread Garito
If this assuption is correct why the result is div class=DataPrevista /?

2008/7/16 Martijn Jacobs [EMAIL PROTECTED]:

  That assumption is correct

  I mean some TALES expression as here/getDataInici | string: nosta will
 evaluate here/getDataInici and if this expression returns '', 0 or None the
 tal interpreter evaluates the second one and the result of this TALES
 expression will be nosta as string

 Is this assumption correct?

 Thanks!

 2008/7/16 Martijn Jacobs [EMAIL PROTECTED]:


  Hi!
 Please consider this TALES expression:

 div class=DataPrevista tal:content='here/getDataInici | string: nosta'
 /

 If I try this other: div tal:content='string:${here/getDataInici}' /
 the result is divNone/div

 Then the first one will render the alternate expression isn't it?

 Then with it renders div class=DataPrevista / ?

 Thanks!


  I don't understand what you are asking. Could you describe your question
 more clear please.


 Martijn.

 --
 Martijn Jacobs
 Four Digits, Internet Solutions

 a: Willemsplein 15-1 6811 KB Arnhem NL kvk: 09162137 | btw:
 8161.22.234.B01
 e-mail: [EMAIL PROTECTED] | web: http://www.fourdigits.nl
 tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117




 --
 Mis Cosas
 http://blogs.sistes.net/Garito
 Zope Smart Manager
 http://blogs.sistes.net/Garito/670



 --
 Martijn Jacobs
 Four Digits, Internet Solutions

 a: Willemsplein 15-1 6811 KB Arnhem NL
 kvk: 09162137 | btw: 8161.22.234.B01
 e-mail: [EMAIL PROTECTED] | web: http://www.fourdigits.nl
 tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117




-- 
Mis Cosas
http://blogs.sistes.net/Garito
Zope Smart Manager
http://blogs.sistes.net/Garito/670
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySQL reconnects on zope application level

2008-07-16 Thread Jonas
Hello,

On several zope 2.10.6 instances we discovered issues with database
connections to MySQL. Apparently MySQL seems to not automaticly
reconnect connections with a timeout since version 5.0.3 due to issues
with transactions.

Until now, mysql-python was patched to restore that behaviour to
automatically reconnect timeouted connections, but that is not the case
anymore either.

So from now on the database reconnects need to be done from zope
applications on their own. Unfortunately the ZMySQLda adapter by Andy
Dustman doesn't implement such a functionality.

I cannot imagine that we are the only ones who discover this problem. Is
there an easy way to implement automatic reconnects for Z MySQL Database
Connections on zope application level?

greetings, and thanks in advance,
 jonas
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] TALES expression

2008-07-16 Thread Tino Wildenhain

Garito wrote:

Hi!
Please consider this TALES expression:

div class=DataPrevista tal:content='here/getDataInici | string: nosta' /

If I try this other: div tal:content='string:${here/getDataInici}' / 
the result is divNone/div


Then the first one will render the alternate expression isn't it?

Then with it renders div class=DataPrevista / ?


Сто? ;-)

You should check the tales documentation. the pipe symbol |
means a logical or, in effect if the left expression resolves
to non existent, None, empty object,... (generally python False)
the right part of it is evaluated.

In the special case it probably is nicer to use:

div class=DataPrevista tal:content=here/getDataInici | 
defaultnosta/div instead so the fallback value is part

of the template (TAL is meant to be design by example)

I would also recommend not mixing  and ' for attributes and
maybe in the long run sticking to english language names for
your objects makes it easier to ask on mailinglists.

Regards
Tino



smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] TALES expression

2008-07-16 Thread Fred Drake
On Wed, Jul 16, 2008 at 6:34 AM, Tino Wildenhain [EMAIL PROTECTED] wrote:
 You should check the tales documentation. the pipe symbol |
 means a logical or, in effect if the left expression resolves
 to non existent, None, empty object,... (generally python False)
 the right part of it is evaluated.

Not at all.

The pipe uses the left-hand operand if it is defined; a value of None
or an empty string is still a defined value.  As long as here can be
traversed with the name getDataInici then the left-hand expression
will be used.  If that traversal fails the right-hand expression will
be used instead.


 -Fred

-- 
Fred L. Drake, Jr. fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL reconnects on zope application level

2008-07-16 Thread Peter Bengtsson
I don't have an easy answer but if you do dig into Andy's code and try
to implement this, I would suggest you look at the ZPsycopgDA code
perhaps and look for inspiration since I think that one works much
better.


2008/7/16 Jonas [EMAIL PROTECTED]:
 Hello,

 On several zope 2.10.6 instances we discovered issues with database
 connections to MySQL. Apparently MySQL seems to not automaticly
 reconnect connections with a timeout since version 5.0.3 due to issues
 with transactions.

 Until now, mysql-python was patched to restore that behaviour to
 automatically reconnect timeouted connections, but that is not the case
 anymore either.

 So from now on the database reconnects need to be done from zope
 applications on their own. Unfortunately the ZMySQLda adapter by Andy
 Dustman doesn't implement such a functionality.

 I cannot imagine that we are the only ones who discover this problem. Is
 there an easy way to implement automatic reconnects for Z MySQL Database
 Connections on zope application level?

 greetings, and thanks in advance,
  jonas
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )




-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] TALES expression

2008-07-16 Thread Tino Wildenhain

Fred Drake wrote:

On Wed, Jul 16, 2008 at 6:34 AM, Tino Wildenhain [EMAIL PROTECTED] wrote:

You should check the tales documentation. the pipe symbol |
means a logical or, in effect if the left expression resolves
to non existent, None, empty object,... (generally python False)
the right part of it is evaluated.


Not at all.

The pipe uses the left-hand operand if it is defined; a value of None
or an empty string is still a defined value.  As long as here can be
traversed with the name getDataInici then the left-hand expression
will be used.  If that traversal fails the right-hand expression will
be used instead.


Indeed :-)

Cheers
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] zexp import fails from linux to windows due to image file paths

2008-07-16 Thread Richard Ettema

Hi,

I have an old zope based site that was hosted on a linux machine that  
was exported to a zexp. i am trying to import it onto a windows  
machine to fix up and upgrade the site. the windows machine is setup  
wth the identical products etc. The problem is the image file paths  
for linux within the zexp do not match the new windows setup. I dont  
need the images imported, i'm wanting to access the main site content  
and users. I dont have access to a linux machine anymore, so i'm stuck  
with windows for development. Is there a way of getting the import  
procedure to ignore the errors and continue the import (i.e. any hints  
on how to modify the zope code)? Or is there a way to edit the zexp to  
do a search  remove/replace of the file path names so the import  
completes with no file path details?


Any ideas greatly appreciated as I have searched around with no luck on
answering this myself.

Thanks

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zexp import fails from linux to windows due to image filepaths

2008-07-16 Thread Jaroslav Lukesh

From: Richard Ettema [EMAIL PROTECTED]
with windows for development. Is there a way of getting the import 
procedure to ignore the errors and continue the import (i.e. any hints  on 
how to modify the zope code)? Or is there a way to edit the zexp to  do a 
search  remove/replace of the file path names so the import  completes 
with no file path details?


You need to export your website folder as ZEXP in XML format. Then you could 
edit this file at search/replace basis. But before this, try to re-import 
this ZEXP file, if it is able to import (not all zexp exports are able to 
reimport).


Regards, JL. 


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zexp import fails from linux to windows due to image filepaths

2008-07-16 Thread Richard Ettema

Quoting Jaroslav Lukesh [EMAIL PROTECTED]:



You need to export your website folder as ZEXP in XML format. Then you
could edit this file at search/replace basis. But before this, try to
re-import this ZEXP file, if it is able to import (not all zexp exports
are able to reimport).

Regards, JL.


Thanks for the reply JL, re-importing into the original server and  
exporting in XML is not an option as I don't have the server anymore,  
only a Windows machine.
If editing the existing ZEXP is not possible, is it possible to modify  
the actual zope code temporarily, to ignore the mismatch of file paths  
(or to modify the paths from linux to windows during the import  
process)?

Thanks, Rich

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zexp import fails from linux to windows due to image file paths

2008-07-16 Thread robert rottermann

Richard Ettema schrieb:

Hi,

I have an old zope based site that was hosted on a linux machine that 
was exported to a zexp. i am trying to import it onto a windows machine 
to fix up and upgrade the site. the windows machine is setup wth the 
identical products etc. The problem is the image file paths for linux 
within the zexp do not match the new windows setup. I dont need the 
images imported, i'm wanting to access the main site content and users. 
I dont have access to a linux machine anymore, so i'm stuck with windows 
for development. Is there a way of getting the import procedure to 
ignore the errors and continue the import (i.e. any hints on how to 
modify the zope code)? Or is there a way to edit the zexp to do a search 
 remove/replace of the file path names so the import completes with no 
file path details?


Any ideas greatly appreciated as I have searched around with no luck on
answering this myself.

i do not think that it is the zexp import machinery that fails but the product 
that handles these external images. so you have to fix that product that it does 
not chocke when it can not read a file.


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

http://mail.zope.org/mailman/listinfo/zope-dev )