[Zope-dev] configuration error

2008-08-23 Thread Bristow Thankachan
hi all,

We are stuck with a configuration error in porting zope2 to python2.5. Can
anybody help us in fixing configuration error in the module Zope2.  The full
log of error message is given below.

Running tests at level 1
/home/zope/ztrunk25/lib/python/ZPublisher/HTTPResponse.py:19:
RuntimeWarning: Python C API version mismatch for module zlib: This Python
has API version 1013, module zlib has version 1012.
  import zlib, struct
Running unit tests:
  Running:
6/43 (14.0%) testStringException1
(testExceptionHook.ExceptionHookTest)/home/zope/ztrunk25/lib/python/Zope2/App/tests/testExceptionHook.py:120:
DeprecationWarning: raising a string exception is deprecated
  raise 'unauthorized', 'x'
/home/zope/ztrunk25/lib/python/Zope2/App/startup.py:182: DeprecationWarning:
raising a string exception is deprecated
  raise
7/43 (16.3%) testStringException2
(testExceptionHook.ExceptionHookTest)/home/zope/ztrunk25/lib/python/Zope2/App/tests/testExceptionHook.py:125:
DeprecationWarning: raising a string exception is deprecated
  raise 'redirect', 'x'
41/43 (95.3%) test_behavior
(...artup.tests.test_warnfilter.TestWarnFilter)

Error in test test_behavior
(Zope2.Startup.tests.test_warnfilter.TestWarnFilter)
Traceback (most recent call last):
  File /home/zope/usr/lib/python2.5/unittest.py, line 260, in run
testMethod()
  File
/home/zope/ztrunk25/lib/python/Zope2/Startup/tests/test_warnfilter.py,
line 90, in test_behavior
)
  File
/home/zope/ztrunk25/lib/python/Zope2/Startup/tests/test_warnfilter.py,
line 69, in load_config_text
conf, handler = ZConfig.loadConfigFile(schema, sio)
  File /home/zope/ztrunk25/lib/python/ZConfig/loader.py, line 41, in
loadConfigFile
return _get_config_loader(schema, overrides).loadFile(file, url)
  File /home/zope/ztrunk25/lib/python/ZConfig/loader.py, line 75, in
loadFile
return self.loadResource(r)
  File /home/zope/ztrunk25/lib/python/ZConfig/loader.py, line 229, in
loadResource
self._parse_resource(sm, resource)
  File /home/zope/ztrunk25/lib/python/ZConfig/loader.py, line 280, in
_parse_resource
parser.parse(matcher)
  File /home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py, line 57, in
parse
section = self.end_section(section, line[2:-1])
  File /home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py, line 112, in
end_section
self.error(e[0])
  File /home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py, line 177, in
error
raise ZConfig.ConfigurationSyntaxError(message, self.url, self.lineno)
ConfigurationSyntaxError: invalid warning category:
'Zope2.Startup.tests.test_warnfilter.TestSchemaWarning' (line 8)


  Ran 43 tests with 0 failures and 1 errors in 15.046 seconds.

Tests with errors:
   test_behavior (Zope2.Startup.tests.test_warnfilter.TestWarnFilter)


regards

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


[Zope-dev] Zope Tests: 4 OK, 1 Unknown

2008-08-23 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Fri Aug 22 11:00:00 2008 UTC to Sat Aug 23 11:00:00 2008 UTC.
There were 5 messages: 5 from Zope Tests.


Unknown
---

Subject: UNKNOWN : Zope-2.8 Python-2.3.6 : Linux
From: Zope Tests
Date: Fri Aug 22 20:41:42 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010050.html


Tests passed OK
---

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Fri Aug 22 20:43:12 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010051.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Fri Aug 22 20:44:42 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010052.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Fri Aug 22 20:46:12 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010053.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Fri Aug 22 20:47:43 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-August/010054.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 )


Re: [Zope-dev] zope.component: calling an Interface and calling queryAdapter give differing results

2008-08-23 Thread Dieter Maurer
Chris Withers wrote at 2008-8-19 18:30 +0100:
 ...
  class ISomething(Interface): pass
...
  class MyClass: implements(ISomething)
...
  m = MyClass()

Right, so this does make sense:

  ISomething(m)
__main__.MyClass instance at 0x00BED6E8

This does not:
  repr(queryAdapter(m,ISomething))
'None'

why the difference?

Jim is heavily defending this difference.

I am convinced that the difference should not be there
but meanwhile have found a use case for it.

  Suppose, you have a class C that implements I.

  If queryAdapter would behave like I(...), you
  would have no way to override the implementation
  of I by C.

  With the current behavior, you can use
  queryAdapter(c, I) to check whether some special
  requirements apply and in this case use the special purpose
  adapter.

Not that this use case had been able to convince me that
the difference were justified.



-- 
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.component: calling an Interface and calling queryAdapter give differing results

2008-08-23 Thread Dieter Maurer
Jim Fulton wrote at 2008-8-19 17:57 -0400:
 
 While I respect that this feature may have been chosen carefully, it
 nevertheless seems more like a misfeature.  Chris' expectation was
 reasonable and ought not to be violated without a good cause.

queryAdapter is used to look up named adapters.  It is also a simpler  
version of queryMultiAdapter, which looks up adapters for multiple  
objects. In neither of these cases does it make sense to consider the  
interfaces already provided by the object being adapted.  It makes no  
sense to me for queryAdapter to have different semantics depending on  
whether the name argument is provided (and is non-blank).

As the implements directive does not specify a name,
one could think that the default name is declared.
Then, your naming argument would go away.


As the I(obj, ...) syntax is more comfortable and more natural than
the get[Multi]Adapter(obj, I, ...), it may even be adequate
to give I(...) an optional name parameter.

Then, we could get rid of the {get|query}[Multi]Adapter altogether
and consistently use I() with appropriate optional parameters --
what a simplification and homogenization :-)



-- 
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] How to put , in HTML attributes?

2008-08-23 Thread Dieter Maurer
Hermann Himmelbauer wrote at 2008-8-20 19:34 +0200:
Hi,
I have a page template, that should have the characters  and  in the 
resulting HTML code, e.g.:

input type=hidden, name=xyz, value=ABC /

HTML forbids  in attributes: it must be represented there as lt;.

Thus, Zope does the correct thing (as standard conformity is a good thing).



-- 
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] Need some help to get rid of an InvalidObjectReference exception

2008-08-23 Thread Dieter Maurer
chaouche yacine wrote at 2008-8-20 01:52 -0700:
 ...
How do I know to which ZODB a specific object belongs to ?

A persistent object has the attribute _p_jar.
This attribute is None when the object was not loaded from
the ZODB and otherwise, it is the ZODB connection which has loaded
it.

A ZODB connection has the method db() (or similar) which returns
the ZODB database this connection belongs to.

More details in the source (ZODB.DB and ZODB.Connection).



-- 
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] Need some help to get rid of an InvalidObjectReference exception

2008-08-23 Thread Dieter Maurer
chaouche yacine wrote at 2008-8-20 05:21 -0700:
 ...
Ok here's how I did to finally fix it :

* create a new Transient Object Container (sessionTOC) at root
* create a new Session Data Manager (sessionDM), with the following settings :
** Id : sessionDM
** Transient Object Container Path : /sessionTOC
** Place SESSION in REQUEST object as : ZODBSESSION

Now I can put ZODB objects in ZODBSESSION using something like : 

context.REQUEST.ZODBSESSION.set(object,o)

Thanks to all of you for your precious help.

I already know that you have abandoned this approach already (good).

What you did: you have put the sessions into the main ZODB storage.
The ZODB can have the same persistent object at different places
in the persistent graph. *HOWEVER* Zope usually does not like
its (what I call site building) objects to be at different places.

This means, that templates and scripts behave quite differently
(their container changes and maybe their context) dependent
on the location from which they have been fetched.


Do not put templates/scripts at secondary positions in the ZODB
(use just a single primary position). Use instead references (e.g. paths)
to the templates/scripts and resolve the references to the real objects.



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


[Zope] Writing a testcase for a Plone 2.5 product - ztc.installPackage isn't available

2008-08-23 Thread Israel Saeta Pérez
I've posted this message to the plone-users list, but since nobody has
answered and I think it's really related to Zope, I'm reposting the
message here. My apologies if you receive this message twice.


Hello list,

I'm trying to write some automated test for an *eggified* content-type
product I'm developing for Plone 2.5.


My question is:
 Is possible to install eggified products in zope-2.9.8 using ZopeTestCase?


And now the context:

Following the PPD book, I've put the following into the tests/base.py file:

***
# base.py
from zassh.eventoDeportivo.config import PROJECTNAME
from Testing import ZopeTestCase

from Products.Five import zcml, fiveconfigure

from Products.PloneTestCase.layer import onsetup

@onsetup
def setup_eventoDeportivo():
  fiveconfigure.debug_mode = True
  import zassh.eventoDeportivo
  zcml.load_config('configure.zcml', zassh.eventoDeportivo)
  fiveconfigure.debug_mode = False

  # Let Zope know about the product we require above-and-beyond a basic
  # Plone install (PloneTestCase takes care of these).
  ZopeTestCase.installProduct(PROJECTNAME)  # PROJECTNAME =
zassh.eventoDeportivo


# Import PloneTestCase - this registers more products with Zope as a side effect
from Products.PloneTestCase.PloneTestCase import PloneTestCase
from Products.PloneTestCase.PloneTestCase import setupPloneSite

# Set up a Plone site
setup_eventoDeportivo()
setupPloneSite(products=[PROJECTNAME,])

class eventoDeportivoTestCase(PloneTestCase):
  Base class for integration tests for the 'eventoDerpotivo'
product. This may
  provide specific set-up and tear-down operations, or provide convenience
  methods.
  
***

But when running the tests from a buildout, ZopeTestCase can't install
the zassh.eventoDeportivo product:

[EMAIL PROTECTED] trunk $ bin/instance test -s zassh.eventoDeportivo
Running tests at level 1
Installing CMFCore ... done (0.013s)
[...]
Installing kupu ... done (0.031s)
Running Products.PloneTestCase.layer.PloneSite tests:
 Set up Products.PloneTestCase.layer.ZCML in 1.958 seconds.
Installing zassh.eventoDeportivo ... NOT FOUND

and obviously all my tests fail.

PPD uses ztc.installPackage instead of ztc.installProduct, but the
installPackage method isn't availabe in Zope-2.9.8-final, which I'm
using with Plone-2.5.3. [1]

My question was:
 Is possible to install eggified products in zope-2.9.8 using
ZopeTestCase? If so, what's wrong in my base.py file?


Thanks in advance.


[1] http://www.archivum.info/[EMAIL PROTECTED]/2007-06/msg00100.html

--
Israel Saeta Pérez
http://dukebody.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 )