[Zope-Coders] Zope tests: 8 OK

2005-08-24 Thread Zope tests summarizer
Summary of messages to the zope-tests list.
Period Tue Aug 23 11:01:02 2005 UTC to Wed Aug 24 11:01:02 2005 UTC.
There were 8 messages: 8 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:27:05 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002911.html

Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:28:35 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002912.html

Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:30:05 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002913.html

Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:31:35 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002914.html

Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:33:05 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002915.html

Subject: OK : Zope-2_8-branch Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:34:35 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002916.html

Subject: OK : Zope-trunk Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:36:05 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002917.html

Subject: OK : Zope-trunk Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Tue Aug 23 22:37:35 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002918.html

___
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders


[Zope-dev] Re: New test runner work

2005-08-24 Thread Jim Fulton

Stuart Bishop wrote:

Jim Fulton wrote:


A large proportion of our tests use a relational database. Some of
them want
an empty database, some of them want just the schema created but no data,
some of them want the schema created and the data. Some of them need the
component architecture, and some of them don't. Some of them need one or
more twisted servers running, some of them don't.

Note that we mix and match. We have 4 different types of database fixture
(none, empty, schema, populated), 2 different types of database
connection
mechanisms (psycopgda, psycopg), 2 types of CA fixture (none, loaded),
and
(currently) 4 states of external daemons needed. If we were to arrange
this
in layers, it would take 56 different layers, and this will double every
time we add a new daemon, or add more database templates (e.g. fat for
lots
of sample data to go with the existing thin).

As a way of supporting this better, instead of specifying a layer a test
could specify the list of resources it needs:

import testresources as r

class FooTest(unittest.TestCase):
   resources = [r.LaunchpadDb, r.Librarian, r.Component]
   [...]

class BarTest(unittest.TestCase):
   resources = [r.EmptyDb]

class BazTest(unittest.TestCase):
   resources = [r.LaunchpadDb, r.Librarian]


This is pretty much how layers work.  Layers can be arranged in
a DAG (much like a traditional multiple-inheritence class graph).
So, you can model each resource as a layer and specific combinations
of resources as layers.  The test runner will attempt to run the layers
in an order than minimizes set-up and tear-down of layers.



So my example could be modeled using layers like:

import layers as l

class FooLayer(l.LaunchpadDb, l.Librarian, l.Component): pass
class FooTest(unittest.TestCase):
layer = 'FooLayer'
[...]

class BarLayer(l.LaunchpadDb, l.Librarian, l.Component): pass
class BarTest(unitest.TestCase):
layer = 'BarLayer'
[...]

class BazLayer(l.LaunchpadDb, l.Librarian): pass
class BazTest(unittest.TestCase):
layer = 'BazLayer'
[...]

In general I would need to define a layer for each test case (because the
number of combinations make it impractical to explode all the possible
combinations into a tree of layers, if for no other reason than naming them).


That's too bad. Perhaps layers don't fit your need then.


If I tell the test runner to run all the tests, will the LaunchpadDb,
Librarian and Component layers each be initialized just once?


If all of the tests means these 3, then yes.


If I tell the test runner to run the Librarian layer tests, will all three
tests be run?


No, no tests will be run.  None of the tests are in the librarian layer.
They are in layers build on the librarian layer.


What happens if I go and define a new test:

class LibTest(unittest.TestCase):
layer = 'l.Librarian'
[...]

If I run all the tests, will the Librarian setup/teardown be run once (by
running the tests in the order LibTest, BazTest, FooTest, BarTest and
initializing the Librarian layer before the LaunchpadDb layer)?


Yes

 I expect

not, as 'layer' indicates a heirarchy which isn't as useful to me as a set
of resources.


I don't follow this.


If layers don't work this way, it might be possible to emulate resources
somehow:


If each test *really* has a unique set of resources, then perhaps
laters don't fit.


class ResourceTest(unittest.TestCase):
   @property
   def layer(self):
   return type(optimize_order(self.resources))

Howver, optimize_order would need to know about all the other tests so would
really be the responsibility of the test runner (so it would need to be
customized/overridden), and the test runner would need to support the layer
attribute possibly being a class rather than a string.


Layers can be classes.   In fact, I typically use classes with class
methods for setUp and tearDown.




Ah, so the layer specifies additional per-test setUp and tearDown
that is used in addition to the tests's own setUp and tearDown.  This
sounds reasonable.



But what to call them? setUpPerTest? The pretest and posttest names I used
are a bit sucky.


shrug testSetUp?




On another note, enforcing isolation of tests has been a continuous
problem
for us. For example, a developer registering a utility or otherwise
mucking
around with the global environment and forgetting to reset things in
tearDown. This goes unnoticed for a while, and other tests get written
that
actually depend on this corruption. But at some point, the order the
tests
are run changes for some reason and suddenly test 500 starts failing. It
turns out the global state has been screwed, and you have the fun task of
tracking down which of the proceeding 499 tests screwed it. I think
this is
a use case for some sort of global posttest hook.


How so?



In order to diagnose the problem I describe (which has happened far too
often!), you would add a posttest check that is run after each test. The
first test that fails due to this check is the 

[Zope-dev] Build process for Zope 2.9

2005-08-24 Thread Fred Drake
Hey all,

I'm working on a revised build process for Zope 2.9, based on the work
that we've done for Zope 3.  What this means is that we'll have a
setup.py that uses the code from zpkg
(http://www.zope.org/Members/fdrake/zpkgtools/) to load metadata from
the various packages are part of the checkout, and use distutils to
perform the build.

One thing that will need to change is the makefile that gets generated
by the configure script.  The current makefile has an enormous number
of options that don't really seem to make sense, and many targets. 
I'd like to remove any that aren't being actively used, but it's hard
to tell which those are.  Would anyone object if we switch to
something a lot closer to the Zope 3 makefile?  There's basically
in-place builds and tests, and that's it.  Everything else is handled
outside the makefile.

Comments or objections?


  -Fred

-- 
Fred L. Drake, Jr.fdrake at gmail.com
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] Migration pains going to Zope 2.8

2005-08-24 Thread Richard Jones
I can't instantiate out Product, which is a bit of a hurdle :)

Our Product's registration looks like this (this function is invoked from the 
Product's __init__.py):

def initialize(context):
''' Register the CGPublisher class '''
context.registerClass(
CGPublisher,
permission=Perm.ADD_CGPUBLISHERS,
constructors = (addCGPublisherForm, addCGPublisher, addValues,
getMode),
icon='www/CGPublisher.gif',
visibility='Global',
)

Unfortunately, the addCGPublisherForm template can't access the addValues 
function. The specific error I get is:

 Error Type: Unauthorized
 Error Value: The container has no security assertions. Access to 'addValues'
  of (App.ProductContext.__FactoryDispatcher__ object at 0xb61d30cc) denied.

I tried adding some module security declarations:

security = ModuleSecurityInfo('Products')
security.declarePublic('CGPublisher')
security = ModuleSecurityInfo('Products.CGPublisher')
security.declarePublic('addValues')
security.declarePublic('getMode')

to the initialize() function, but that didn't change anything. Any 
suggestions?



pgpHifT3MDPM9.pgp
Description: PGP 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] ZEO on Windows

2005-08-24 Thread michael nt milne
Hi


Does anyone know if the 2.0.5 windows release of Plone includes ZEO? Is there any configuration information on this? Also does Zope 2.8 for linux have ZEO as standard.

Finally, if you don't run ZEO does this mean that Zope can only handle one request at a time?

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] Zope 2.8.1 on Mac OS X tiger Server

2005-08-24 Thread Andrew Langmead


On Aug 23, 2005, at 6:24 AM, Garito wrote:

I try sudo /System/Library/StartupItems/Zope/Zope start but nothing  
happend (nor on console)


but if I launch /var/zope/sistes/bin/zopectl start it works perfectly

I try to comment the if and fi lines but don't work




I just want to make sure I point out to you, that little of this has  
to do with Zope itself, and most of the audience of this list knows  
little or cares little about the peculiarities of the MacOSX/Darwin  
init environment.



One piece of information that I now realize that I forgot to put in  
the previous message was that if you have the section if [ $ 
{ZOPESERVER=-NO-} = -YES- ]; then in your startup script, then  
you probably have to put a line in your /etc/hostconfig that says   
ZOPESERVER=-YES-. The bundles in /System/Library/StartupItems and / 
Library/StartupItems tell the machine how to start services and in  
what order, but the /etc/hostconfig file specifies which services are  
desired for a particular machine.


If you want to diagnose the shell script in /Library/StartupItems/ 
Zope/Zope, you might want to try to run it with the bourne shell's  
trace option, specified by the -x parameter.


sh -x /Library/StartupItems/Zope/Zope start


___
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: FIXED: Re: [Zope] URL0 returns index_html not index.html

2005-08-24 Thread John Eikenberry
Mark Barratt wrote:

 Well, no, because some of the objects I want to append /source.html to 
 are not called index.html (but that *is* how we did it for another site 
 and it works as you say).
 
 A text substitution covers both cases:
 
 tal:attributes=href 
 python:context.REQUEST['URL0'].replace('index_html','index.html')+'/source.html'

Wouldn't this just result in [path]/index.html/source.html? Do you want
the index.html in the URL to source.html. This will work with Zope but
looks strange. Using URL1 instead of URL0 would leave the index[._]html
off the generated URL. 
 
 If you were working with zope projects there are other tricks you could
 pull, but it doesn't sound like you are doing this.
 
 I don't understand this: is a 'zope project' different from my project 
 using zope?

Opps. I meant a 'zope product', ie. a python based product.
 

-- 

John Eikenberry [EMAIL PROTECTED]
__
A society that will trade a little liberty for a little order
 will deserve neither and lose both.
  --B. Franklin
___
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] manage_afterAdd quirks

2005-08-24 Thread John Eikenberry
Philip J?genstedt wrote:

 It seems I need one of three things:
 
 1. A better way to add images and a template altogether.
 2. A hook which is only called once, when the object is first created.
 3. A method to check if the objects exist in the newly added item
 directly, not aquired.

As Peter mentioned, use aq_base. There are 2 ways to use it. One as an
object attribute (self.aq_base) or using the aq_base() function as imported
from Acquisition. The latter method won't cause an attribute error if you
already are working with the non-acquisition object (in that case it will
simply return the object. For what you are doing I recommend one of these
methods.

To get more control over when manage_afterAdd runs some code, you can set
some flags using the copy hooks. Before running manage_afterAdd when
copying/moving/renaming ObjectManager calls the method _notifyOfCopyTo() on
the object being copied/moved/renamed. It passes one argument (op) giving
some context to the call. It is set to 1 for moves and renames, and set to
0 for copies. 

So you can use this to set a flag on your object to modify
manage_afterAdd's behaviour in these circumstances. Eg.

class Container(ObjectManager):

def _notifyOfCopyTo(self,op):
# use a _v_ volitile attribute here to avoid persistence
self._v_copy_flag = op

def manage_afterAdd(self, item, container):
if hasattr(self,'_v_copy_flag'):
if self._v_copy_flag == 0:
# stuff you want done when copying
...
if self._v_copy_flag == 1:
# stuff you want done when moving/renaming
...
# clear the flag
delattr(self,'_v_copy_flag')
else:
# stuff you want done only on initial install
...
# stuff you want done no matter what.
.,.

Of course you can simplify this if you don't care if its been moved,
renamed or copied. Just wanted to show the different possibilities.

-- 

John Eikenberry [EMAIL PROTECTED]
__
A society that will trade a little liberty for a little order
 will deserve neither and lose both.
  --B. Franklin
___
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] AssertionError after update to Zope 2.8.1

2005-08-24 Thread Tim Peters
[Ricardo Newbery]
 Oh so close...

 Migrated from Zope 2.7.2 to 2.8.1
 Updated all the Catalog instances according to the instructions.
 Fixed a few outdated products.
 
 Then just for kicks, I tried to update the Python scripts by visiting
 the /manage_addProduct/PythonScripts/recompile url.  After about a
 minute, it threw up an error page.  This is what shows up in the
 log...


 2005-08-21T01:56:45 ERROR txn.170046464 Error in abort() on manager 
 Connection at 0956724c
 Traceback (most recent call last):
   File /Zope-2.8/lib/python/transaction/_transaction.py, line 456, in 
 _cleanup
   File /Zope-2.8/lib/python/ZODB/Connection.py, line 348, in abort
   File /Zope-2.8/lib/python/ZODB/Connection.py, line 360, in _abort
 AssertionError
 --
 2005-08-21T01:56:45 ERROR Zope.SiteErrorLog
 http://someurl.com/manage_addProduct/PythonScripts/recompile
 Traceback (most recent call last):
   File /Zope-2.8/lib/python/ZPublisher/Publish.py, line 119, in publish
   File /Zope-2.8/lib/python/Zope2/App/startup.py, line 215, in commit
   File /Zope-2.8/lib/python/transaction/_manager.py, line 84, in commit
   File /Zope-2.8/lib/python/transaction/_transaction.py, line 381, in commit
   File /Zope-2.8/lib/python/transaction/_transaction.py, line 379, in commit
   File /Zope-2.8/lib/python/transaction/_transaction.py, line 424, in 
 _commitResources
   File /Zope-2.8/lib/python/ZODB/Connection.py, line 462, in commit
   File /Zope-2.8/lib/python/ZODB/Connection.py, line 483, in _commit
 AssertionError

 ...

Note that someone else (I think) opened a Collector issue against what
appears to be a very similar problem:

http://www.zope.org/Collectors/Zope/1874

As I noted there, it would be helpful if someone who sees this problem
added some prints at the point of the failing assert, so we could at
least learn the type/class of the object without an oid.
___
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] Migration pains going to Zope 2.8

2005-08-24 Thread Dieter Maurer
Richard Jones wrote at 2005-8-24 16:11 +1000:
I can't instantiate out Product, which is a bit of a hurdle :)

Our Product's registration looks like this (this function is invoked from the 
Product's __init__.py):

def initialize(context):
''' Register the CGPublisher class '''
context.registerClass(
CGPublisher,
permission=Perm.ADD_CGPUBLISHERS,
constructors = (addCGPublisherForm, addCGPublisher, addValues,
getMode),
icon='www/CGPublisher.gif',
visibility='Global',
)

Unfortunately, the addCGPublisherForm template can't access the addValues 
function. The specific error I get is:

 Error Type: Unauthorized
 Error Value: The container has no security assertions. Access to 'addValues'
  of (App.ProductContext.__FactoryDispatcher__ object at 0xb61d30cc) denied.

Maybe, you do not honor the following requirement
(documented in App.ProductContext.ProductContext.registerClass):

constructors -- A list of constructor methods
  A method can me a callable object with a __name__
  attribute giving the name the method should have in the
  product, or the method may be a tuple consisting of a
  name and a callable object.  The method must be picklable.

  The first method will be used as the initial method called
  when creating an object.

Does your addValue have a __name__ attribute with value addValue?

If so, you may want to analyse the FactoryDispatcher mentioned
above.

You get it (in an interactive interpreter) via

app.manage_addProduct[your Product]

In its class, you should find your contructors as
well as permission attributes of the form constructor_name__roles__.

Apparently, addValues__roles__ is missing (for whatever reason).

-- 
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] problem with adding an external method

2005-08-24 Thread Dieter Maurer
Scott Mann wrote at 2005-8-23 10:00 -0700:
 ...
I am attempting to add the external python module nb_fetch Doing so returns 
the error message:

Module /data/zope/testbed/initialzope/Extensions/nb_fetch.py, line 3, in ?

 ImportError: No module named nb_parse

where nb_parse is imported by nb_fetch.

Note that Zope does not use Python's normal import mechanism
to load the source file for External Methods.
One impact: you cannot use relative imports:

   Even if nb_fetch.py and nb_parse.py lie side by side in
   the same folder, nb_fetch.py cannot simple do
   an import nb_parse to access the other module.

 ...
I have also made a number of attempts at adding directories to the PYTHONPATH, 
but no success.

If nb_parse.py is in a folder listed in PYTHONPATH,
the import nb_parse should succeed.

 ...
Also, I restart zope every time I make a change.

Change what?

If you change the source file of an External Method *AND*
you run your Zope in development mode, then changes are
recognized automatically.

Chances in other Python modules (such as your nb_parse above)
require a Zope restart.

-- 
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] ZEO on Windows

2005-08-24 Thread Dieter Maurer
michael nt milne wrote at 2005-8-24 11:52 +0100:
  Does anyone know if the 2.0.5 windows release of Plone includes ZEO?

Do you have installed it?

Then see whether the Zope part contains the folder ZEO
(usually in lib/python). If it does, then it contains ZEO.

Also does Zope 2.8 for linux 
have ZEO as standard.

Yes, I think so. Again: install and check whether the ZEO part is
there.

 Finally, if you don't run ZEO does this mean that Zope can only handle one 
request at a time?

No.

It only does mean that a single process can access your ZODB data.

A standard Zope process has 4 worker threads that can execute requests
in parallel.

Note, however, that even when you run on a multi-processor maschine,
the various Python threads may not be able to truely run
in parallel (a single process allows only a single thread to execute
Python code; other threads may wait on something external or execute
non Python (e.g. C) code, but they cannot execute Python code
truely in parallel).

-- 
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] ZEO on Windows

2005-08-24 Thread Tim Peters
[michael nt milne]
 ...
 Also does Zope 2.8 for linux have ZEO as standard.

All versions of Zope at and after 2.7 include ZEO, and regardless of
platform (Linux, Windows, Solaris, ..., doesn't matter).
___
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] ZTUtils TabindexIterator class

2005-08-24 Thread David Pratt
Can I contribute a small TabindexIterator class for ZTUtils.  It is not 
big, but handy for generating tabindex values in a site. The current 
Iterator class available was not meant to do this but this is.  I think 
this could be added to Iterators.py  It seems better to incorporate 
something like this in ZTUtils than making a site tool to do this.


It only provides one method next() and takes a sequence. If you want 
your tabindex to start at 500 and go no further than 599, you just give 
it range(500,600) and stops iterating. For for 0 to n  - just use 
range(n).  It could always pass after iteration stops but I think it is 
better to raise exception so you can modify your sequence, if necessary.


class TabindexIterator:
 Tabindex iterator class 

__allow_access_to_unprotected_subobjects__ = 1

def __init__(self, seq):
self.iter = seq.__iter__()

def next(self):
try:
next = self.iter.next()
return next
except StopIteration:
raise 'Tabindex iterator exhausted.'

Regards,
David
___
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: FIXED: Re: [Zope] URL0 returns index_html not index.html

2005-08-24 Thread Mark Barratt

John Eikenberry wrote:

Mark Barratt wrote:



A text substitution covers both cases:

tal:attributes=href 
python:context.REQUEST['URL0'].replace('index_html','index.html')+'/source.html'



Wouldn't this just result in [path]/index.html/source.html? Do you want
the index.html in the URL to source.html. This will work with Zope but
looks strange. Using URL1 instead of URL0 would leave the index[._]html
off the generated URL. 
 


Only if the apparent address of the 'page' is [folder]/, and that is 
what I want. But it also works if the apparent address of the 'page' is 
pagename.html - in that case URL0 returns the correct complete path and 
the text substitution doesn't come into play. In all case I want to 
return /source.html of the target page so I can edit it in Mozile (not 
that I can yet, mind you).


best

--
Mark Barratt

___
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] Migration pains going to Zope 2.8

2005-08-24 Thread Richard Jones
On Thu, 25 Aug 2005 04:36 am, Dieter Maurer wrote:
 Does your addValue have a __name__ attribute with value addValue?

In py2.3 (at least) functions get a __name__ automatically:

Python 2.3.5 (#2, Mar 29 2005, 15:41:06)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type help, copyright, credits or license for more information.
 def foo():
...  pass
...
 foo.__name__
'foo'



 If so, you may want to analyse the FactoryDispatcher mentioned
 above.

 You get it (in an interactive interpreter) via

 app.manage_addProduct[your Product]

 In its class, you should find your contructors as
 well as permission attributes of the form constructor_name__roles__.

 Apparently, addValues__roles__ is missing (for whatever reason).

The ProductContext is creating the attributes correctly on the Product's 
custom FactoryDispatcher class. The correct class is being used, and the 
*__roles__ attributes are all present and accounted for when the validate() 
is invoked. The problem appears to be that we don't even get up to checking 
those attributes. The addValues function has no __roles__ attribute, so we 
wander into __roles__ attribute checking on the container and fall about 
laughing. So I added __roles__ to addValues:

  addValues.__roles__ = ('Manager', )

and now everything works. I even removed the ModuleSecurityInfo declarations, 
since they appeared to have no effect at all. There's probably some API for 
setting that __roles__ attribute, but I'm stuffed if I can find it.


Thanks for the help Dieter,

 Richard


pgpn3xLBQmglw.pgp
Description: PGP 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] Migration pains going to Zope 2.8

2005-08-24 Thread Richard Jones
On Thu, 25 Aug 2005 12:06 pm, Richard Jones wrote:
 and now everything works.

Further data-point - the version of VerboseSecurity is to blame. It's not 
2.8-compatible :(

Sorry for the noise.


Richard


pgpvvxmwsl89Y.pgp
Description: PGP 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] ZEO on Windows

2005-08-24 Thread Chris Withers

michael nt milne wrote:

Hi
  Does anyone know if the 2.0.5 windows release of Plone includes ZEO? 


Ask on a Plone list.

Is 
there any configuration information on this? 


Dunno what you mean.

Also does Zope 2.8 for linux 
have ZEO as standard.


Yes.

 Finally, if you don't run ZEO does this mean that Zope can only handle one 
request at a time?


No.

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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