Re: [Zope-dev] zope.container broken

2009-03-09 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Roger Ineichen wrote:

 The zope.container package was broken.
 I added a missing ComponentLookupError import.

Yup, and there is no test for that 'browserDefault' raising the error,
either.

 Can someone with a linux/windows system release
 zope.component with the C extensions?

Why do you need a release?  I don't think we are quite done tweaking it,
or adding package docs.  For instance, I don't even know that anybody
has run the compattest suite against the new version.


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

iD8DBQFJtQaF+gerLs4ltQ4RAuWYAJ9PbnziYoL77wgVl9mimMb9e64TwgCfTIIP
jZhCU7zx/ufXObQJDMk4iic=
=cLFY
-END PGP SIGNATURE-

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


Re: [Zope-dev] zope.container broken

2009-03-09 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Roger Ineichen wrote:

 The zope.container package was broken.
 I added a missing ComponentLookupError import.

Yup, and there is no test for that 'browserDefault' raising the error,
either.

 Can someone with a linux/windows system release
 zope.component with the C extensions?

Why do you need a release?  I don't think we are quite done tweaking it,
or adding package docs.  For instance, I don't even know that anybody
has run the compattest suite against the new version.


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

iD8DBQFJtQaF+gerLs4ltQ4RAuWYAJ9PbnziYoL77wgVl9mimMb9e64TwgCfTIIP
jZhCU7zx/ufXObQJDMk4iic=
=cLFY
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.container broken

2009-03-09 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tres Seaver wrote:
 Roger Ineichen wrote:
 
 The zope.container package was broken.
 I added a missing ComponentLookupError import.
 
 Yup, and there is no test for that 'browserDefault' raising the error,
 either.
 
 Can someone with a linux/windows system release
 zope.component with the C extensions?
 
 Why do you need a release?  I don't think we are quite done tweaking it,
 or adding package docs.  For instance, I don't even know that anybody
 has run the compattest suite against the new version.

I see that 'wosc' beat me to the punch and checked in tests. ;)


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

iD8DBQFJtQpt+gerLs4ltQ4RAv8VAKCq2cPl33pdxsNrmzc1FqoEL7LO3wCdHfOH
3r7J5SIoMc4IZO6Z6lJuI0Q=
=1QY5
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Question: additional context for IAnnotations adapter?

2009-03-09 Thread Dieter Maurer
Jacob Holm wrote at 2009-3-6 01:55 +0100:
 ...
I added it while working for ZC two years ago. It was needed to support 
a use case where the context used for looking up the annotation was not 
necessarily the current site. I don't know if the use case is still 
relevant to ZC, but the pattern is still being used in e.g. 
zc.notification and zope.app.preference (where it was added by me at the 
time).

I expect that use cases like this (looking up objects in a foreign site
context) will be important for my current employer (if it continuous to
use Zope in the future).



-- 
Dieter
___
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.container broken

2009-03-09 Thread Roger Ineichen
Hi Tres

 Betreff: Re: [Zope-dev] zope.container broken
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Roger Ineichen wrote:
 
  The zope.container package was broken.
  I added a missing ComponentLookupError import.
 
 Yup, and there is no test for that 'browserDefault' raising 
 the error, either.
 
  Can someone with a linux/windows system release zope.component with 
  the C extensions?
 
 Why do you need a release?  

Hm, I'm confused. Because the existing release is broken.

 I don't think we are quite done 
 tweaking it, or adding package docs.  For instance, I don't 
 even know that anybody has run the compattest suite against 
 the new version.

I'm not up to date with zope.container.
What is a show stopper for another release?

Regards
Roger Ineichen

___
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] deprecating the deprecation system?

2009-03-09 Thread Dieter Maurer
Roger Ineichen wrote at 2009-3-8 14:38 +0100:
 ...
Can you give an example of a meaningless deprecation
warning?

A few of the deprecations I have disliked for a long time:

 /home/dieter/Z/Products/Archetypes/__init__.py:15: DeprecationWarning: The 
 module, 'Products.CMFCore.CMFCorePermissions' is a deprecated compatiblity 
 alias for 'Products.CMFCore.permissions';  please use the new module instead.
  from Products.CMFCore import CMFCorePermissions

Why should I bother about deprecations in foreign packages
(Archetypes in the case above)?

 /home/dieter/Z/Base/lib/python/Products/CMFCore/utils.py:667: 
 DeprecationWarning: format_stx() will be removed in CMF 1.6. Please use 
 StructuredText.StructuredText.HTML instead.

Why should the short format_stx no longer be supported and
instead the monster StructuredText.StructuredText.HTML be used?


And here is my favorite:

 /home/dieter/Z/Products/HaufePortalBase/__init__.py:86: DeprecationWarning: 
 The product_name parameter of ToolInit is deprecated and will be ignored in 
 CMF1.6: HaufePortalBase

The product_name parameter used to be mandatory -- thus all
calls to ToolInit had to use it.
Then, a means was found to derive it automatically
from the context. The developper was so happy that he wanted all
others immediately drop the parameter -- result: several dozens of deprecation
warnings for each start -- in trivial cases, where the automatically
derived information was identical to the explicitly provided
I called out what a stupidity



-- 
Dieter
___
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.container broken

2009-03-09 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Roger Ineichen wrote:
 Hi Tres
 
 Betreff: Re: [Zope-dev] zope.container broken

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Roger Ineichen wrote:

 The zope.container package was broken.
 I added a missing ComponentLookupError import.
 Yup, and there is no test for that 'browserDefault' raising 
 the error, either.

 Can someone with a linux/windows system release zope.component with 
 the C extensions?
 Why do you need a release?  
 
 Hm, I'm confused. Because the existing release is broken.
 
 I don't think we are quite done 
 tweaking it, or adding package docs.  For instance, I don't 
 even know that anybody has run the compattest suite against 
 the new version.
 
 I'm not up to date with zope.container.
 What is a show stopper for another release?

You asked for a release of zope.component, including C extensions.


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

iD8DBQFJtTAK+gerLs4ltQ4RAiFFAKCzCfXmgiiBVkkuU2lXXGAMOcwJHACgstx5
zR6M27Ypm/hcSKUE39vOPTg=
=XnMj
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Question: additional context for IAnnotations adapter?

2009-03-09 Thread Dan Korostelev
2009/3/9 Dieter Maurer die...@handshake.de:
 Jacob Holm wrote at 2009-3-6 01:55 +0100:
 ...
I added it while working for ZC two years ago. It was needed to support
a use case where the context used for looking up the annotation was not
necessarily the current site. I don't know if the use case is still
relevant to ZC, but the pattern is still being used in e.g.
zc.notification and zope.app.preference (where it was added by me at the
time).

 I expect that use cases like this (looking up objects in a foreign site
 context) will be important for my current employer (if it continuous to
 use Zope in the future).

Thanks for comments. The functionality stayed and migrated to
zope.principalannotation. It now even have a doctest. :-)


-- 
WBR, Dan Korostelev
___
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] deprecating the deprecation system?

2009-03-09 Thread Lennart Regebro
On Mon, Mar 9, 2009 at 15:56, Dieter Maurer die...@handshake.de wrote:
 The product_name parameter used to be mandatory -- thus all
 calls to ToolInit had to use it.
 Then, a means was found to derive it automatically
 from the context. The developper was so happy that he wanted all
 others immediately drop the parameter -- result: several dozens of deprecation
 warnings for each start -- in trivial cases, where the automatically
 derived information was identical to the explicitly provided
 I called out what a stupidity

I agree that this deprecation warning is pointless. The parameter can
just stay there and be ignored, no need to warn. But the description
of the change is incorrect, the decision to ignore the parameter was
for reason, not just because we could, even if I don't exactly
remember what the reason was now. :)

-- 
Lennart Regebro: Pythonista, Barista, Notsotrista.
http://regebro.wordpress.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 )


Re: [Zope-dev] zope.container broken

2009-03-09 Thread Roger Ineichen
Hi Tres

 Betreff: Re: AW: [Zope-dev] zope.container broken

[...]

  Can someone with a linux/windows system release 
 zope.component with 
  the C extensions?
  Why do you need a release?  
  
  Hm, I'm confused. Because the existing release is broken.
  
  I don't think we are quite done
  tweaking it, or adding package docs.  For instance, I 
 don't even know 
  that anybody has run the compattest suite against the 
 new version.
  
  I'm not up to date with zope.container.
  What is a show stopper for another release?
 
 You asked for a release of zope.component, including C extensions.

Uhhh, must be late last night ;-)

Regards
Roger Ineichen

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


[Zope-dev] [zope.testbrowser] r84900

2009-03-09 Thread Malthe Borch
Code snippet:

def open(self, url, data=None):
   See zope.testbrowser.interfaces.IBrowser
url = str(url)

This string coercion is unfortunate, because ``mechanize`` accepts a
(mechanize-) request-object in place of a URL string here. Using a
custom request object allows us to do such things as setting the
REQUEST_TYPE header string, which is not possible throught the
standard API.

Changeset comment:

- Remove vendor import of mechanize.

- Fix bug that caused HTTP exception tracebacks to differ between
  version 3.4.0 and 3.4.1.

- Workaround for bug in Python Cookie.SimpleCookie when handling
  unicode strings.

- Fix bug introduced in 3.4.1 that created incompatible tracebacks in
  doctests.  This necessitated adding a patched mechanize to the
  source tree; patches have been sent to the mechanize project.

Not sure which of the above this coercion is trying to solve, but
perhaps it could be solved in a way that didn't break the mechanize
functionality.

\malthe
___
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] Python3 and attribute annotations.

2009-03-09 Thread Dan Korostelev
Hi zope developers!

As you may know, python 3 introduced the concept of annotations for
callable objects. That annotations store information about arguments
and return values, which is kinda nice language feature that will
allow us to do interesting things.

But there's a problem: those annotations will be stored in object's
__annotations__ attribute, which is also used by zope.annotation's
AttributeAnnotation implementation, so they will conflict.

I think that it's a good time now to start thinking about problems
like this, because there's a lot of time before zope will be used in
python 3.0, so we can prepare to move without much problems.

So, I propose to change annotation storage attribute to
__zope_annotation__ and make AttributeAnnotation adapter
automatically migrate data from __annotations__ to
__zope_annotations__. I think that adding zope to the attribute name
will avoid any name clashes in future.

I'd like to hear about problems that this change can possibly
introduce (__slots__, security proxies, etc.) and maybe some more
community ideas on that.

-- 
WBR, Dan Korostelev
___
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] Python3 and attribute annotations.

2009-03-09 Thread Gary Poster

On Mar 9, 2009, at 5:20 PM, Dan Korostelev wrote:

 Hi zope developers!

 As you may know, python 3 introduced the concept of annotations for
 callable objects. That annotations store information about arguments
 and return values, which is kinda nice language feature that will
 allow us to do interesting things.

 But there's a problem: those annotations will be stored in object's
 __annotations__ attribute, which is also used by zope.annotation's
 AttributeAnnotation implementation, so they will conflict.

 I think that it's a good time now to start thinking about problems
 like this, because there's a lot of time before zope will be used in
 python 3.0, so we can prepare to move without much problems.

 So, I propose to change annotation storage attribute to
 __zope_annotation__ and make AttributeAnnotation adapter
 automatically migrate data from __annotations__ to
 __zope_annotations__. I think that adding zope to the attribute name
 will avoid any name clashes in future.

 I'd like to hear about problems that this change can possibly
 introduce (__slots__, security proxies, etc.) and maybe some more
 community ideas on that.

Hi Dan.  Thanks for bringing this up.

If we do make changes for this purpose, I'd like to no longer use the  
__*__ pattern.

When Zope 3 used the pattern initially, Python was not clear on its  
usage.  Since then, it has clearly stated that the language claims   
__*__.

While your proposal (__zope_*__) would almost certainly avoid a clash,  
I'd prefer to stick to the letter of the (new) law.  I'd prefer _z_*  
or _zope_* or _z_*__ or some other variation.  (The ZODB usues  
_p_*, of course; I am inclined to _z_* because of the parallel and  
because it is short.)

(If you are interested in the Python waffle when Zope 3 was written  
and the current language reference/PEP 8 , see my blog post this from  
February: 
http://codesinger.blogspot.com/2009/02/dont-use-in-python-unless-you-are.html 
.  It may come off more strongly than it should, but I still find the  
point to be a good one.)

Gary
___
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] Python3 and attribute annotations.

2009-03-09 Thread Martijn Pieters
On Mon, Mar 9, 2009 at 22:20, Dan Korostelev nad...@gmail.com wrote:
 As you may know, python 3 introduced the concept of annotations for
 callable objects. That annotations store information about arguments
 and return values, which is kinda nice language feature that will
 allow us to do interesting things.

 But there's a problem: those annotations will be stored in object's
 __annotations__ attribute, which is also used by zope.annotation's
 AttributeAnnotation implementation, so they will conflict.

I don't think they are, according to PEP 3107 they are stored in the
func_annotations attribute of the function.

Note that even if the name *where* the same, attribute annotations
only work on classes and instances, while function annotations only
apply to functions, not?

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


Re: [Zope-dev] SVN: zope.component/trunk/ Merge the 'tseaver-wo_zope_deferredimport' branch:

2009-03-09 Thread Dan Korostelev
2009/3/5 Martijn Faassen faas...@startifact.com:
 Chris Withers wrote:
 Martijn Faassen wrote:
 I think we can only make the correct determination if we get an idea of
 the performance implications. If it turns out the C code brings
 significant speedups in real-world applications, we should create a
 zope.hookable with a Python + C implementation.

 Even if it does bring significant speedups, why does it need to be a
 seperate package?

 It doesn't, but it's already a package that could be easily turned into
 something with proper documentation (it's mostly there, just hidden),
 and one of the goals was to reduce C dependencies in zope.component, not
 add C code to it.

Let's decide that and make a release of zope.component so we could
move forward on adapting other packages to recent removal of BBB
interfaces.

Here's three variants:

 * Move pure python implementation to zope.hookable as a fallback.
 * Move C implementation to zope.component and drop zope.hookable
dependency at all.
 * Just drop zope.hookable dependency, providing only pure python
version of hookable.

The second (or even third, if there's no significant slowdown) variant
seems fine to me personally, because, as Tres noted, there's probably
no consumers for zope.hookable beyond zope.component, so we can safely
merge the packages.

Jim, Philipp, Marius, can you please give us rights on PYPI for
zope.component. My account is nadako there, so you can give it to me
and I'll add other people.

-- 
WBR, Dan Korostelev
___
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] fstest reports time-stamp reduction, what does it mean and should I be worried?

2009-03-09 Thread Dieter Maurer
Chris Withers wrote at 2009-3-8 12:26 +:
Nope, Zope 2.9.8.

 In older ZODB versions, this should happen when your clock
 jumped back into the past.

The clocks on both the storage servers are NTP synched and I'm pretty 
sure they've not jumped back at any point...

Another (more serious) cause can be a corruption of the storage file.
The timestamp is part of the file data -- it the data changes,
the timestamps may seem to be out of order.



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


Re: [Zope] timeout on a page

2009-03-09 Thread Andrew Milton
+---[ Dvir Bar-lev ]--
| Hi all.
| 
|  
| 
| First of all let me say that I found the solution to my user roles problems by
| using the  coockiecrumbler plugin,  so that?s behind me now J

Goodo.

| I need help with something else, I will explain what I want to accomplish:

[snip]

| Any ideas how I can do this 2 things?

Do some reading, or advertise for a competent zope coder.

I'm all for helping people, but, you don't seem to be doing the minimum
amount of preparation before asking for help.

-- 
Andrew Milton
a...@theinternet.com.au
___
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] Avoiding page redirects from TAL

2009-03-09 Thread Analog Kid
Hi All:

I have a customized page template product which subclasses from
ZopePageTemplate. In this product class, I have a method that redirects to a
certain fixed page that I have created in the ZMI. One of the objects of
this type makes calls to this method and also has some conditional redirects
(based on certain request variables). Here is a representation

In my Product class, I have a method which conditionally redirects ...

def check_and_redirect(self):
request = self.REQUEST
if request.get('redirect_to_fixed_page', False):
request.RESPONSE.redirect('http://somefixedurl_in_my_domain')

def getValue(self):
self.check_and_redirect()
# do some more stuff


return 'some value'

My ZPT looks like this ...
...
tal:call tal:define=data python:mytemplate.getValue()/
...
...
...
...
tal:redir tal:condition=python:here.REQUEST.has_key('var')
tal:dummy tal:define=test python:here.REQUEST.RESPONSE.redirect('
http://someotherurl;)/
/tal:redir
...
...
...


What is happeninig is that the redirect in the PT is taking precedence over
my redirect (which Im doing in the method). My question is: Can I make sure
that my redirect takes precedence without modifying the PT itself. Is there
any other ZopePageTemplate method which I can patch so that my own redirect
kicks in first??

Thanks for you time and help.

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