Re: [Zope] Re: Problems with buildout and zope.interface

2008-07-30 Thread Paul Winkler
On Fri, Jul 25, 2008 at 02:53:55PM +0200, Christian Scholz wrote:
>>> So my main question is probably: Is there a way to automate the
>>> process of installing and running virtualenv similar to what
>>> bootstrap.py does for buildout so that people do not need to care
>>> about the virtualenv part?

Yes, you can write a custom virtualenv bootstrap script as documented
here:
http://pypi.python.org/pypi/virtualenv#creating-your-own-bootstrap-scripts

You can then distribute just your bootstrap script, and all somebody
has to do is download and run it (assuming they have python).  The
bootstrapper will then fetch and run virtualenv, install easy_install
into the virtualenv, and do anything else you put in your
bootstrapper.

Personally I've never tried combining virtualenv and buildout.

-- 

Paul Winkler
http://www.slinkp.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] manage_cutObjects/manage_pasteObjects problem ...

2008-07-30 Thread Paul Winkler
Just a quick note:

On Fri, Jul 25, 2008 at 03:20:23PM +0200, Giampiero Benvenuti wrote:
> I think the problem is your 4th line: copy_info = 
> obj_parent.manage_cutObjects((context.getId()))
> copy_info should be the object you want to cut
>
> it should be something like this:
> ...
> src=context.your_cut_context[obj_id]
> context.your_cut_context.manage_cutObjects([src])
>
> dst=context.your_paste_context
> dst.manage_pasteObjects(src)

Sorry Giampiero, you're just guessing, and you're guessing wrong.  The
original poster's code was correct*.  Dieter's suggestion is a better
approach to troubleshoot this problem.


*well, almost correct. There's a common Python mistake on one line:

 copy_info = obj_parent.manage_cutObjects((context.getId()))
   
You think you're creating a tuple there, but you're not.
To create a tuple of size 1, you need a trailing comma:

 copy_info = obj_parent.manage_cutObjects((context.getId(),))

But that's not causing your problem; manage_cutObjects() "helpfully"
wraps a string argument in a tuple for you.

-- 

Paul Winkler
http://www.slinkp.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 )


[Zope] Zope product and dtml-tree

2008-07-30 Thread Rowan Woodhouse

Hi,

I'm developing a Zope product that uses a dtml file to generate the html 
page. I'd like to include a dtml-tree based tree for navigation on the 
page. The custom object inherits from SimpleItem. When I include the 
follow code in the dtml file:



  


I get the following exception:

An error was encountered while publishing this resource.

exceptions.KeyError
Sorry, a site error occurred.

Traceback (innermost last):

* Module ZPublisher.Publish, line 202, in publish_module_standard
* Module ZPublisher.Publish, line 150, in publish
* Module ZPublisher.Publish, line 119, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 42, in call_object
* Module Products.WellGroup.WellGroup, line 110, in index_html
* Module App.special_dtml, line 65, in __call__
* Module DocumentTemplate.DT_String, line 476, in __call__
* Module TreeDisplay.TreeTag, line 88, in render
* Module TreeDisplay.TreeTag, line 192, in tpRender

KeyError: 'URL'

If I add a class variable called URL I then get a key error for RESPONSE.

My understanding from documentation is that Item (from which SimpleItem 
inherits) gives the product basic dtml-tree support. I can't find any 
examples that spell out how to write a product that supports dtml-tree 
tags. Could someone point me in the right direction?


Thanks,
Rowan

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