[Zope3-Users] zope3, site-packages and easy_install

2006-10-27 Thread Michael Haubenwallner

a short question on using eggs and zope3 dev/checkout together

had a case yesterday: easy_installed zope.schema (and automatically its 
dependencies)


easy_install adds its paths in front of all other paths to sys.path
-- this broke my zope3 svn checkout; first sign:  bin/zopectl debug 
didn't work anymore


what should one suggest for development ?
- using zope3 checkout with its own python interpreter
- or remove site-packages from zope3 sys.path

what to do in deployment environment ?
- using zope3 deploment with its very own python interpreter
- you never now when anyone will add another piece to site-packages

i think this will affect buildouts too as they rely on a common python 
install.


Michael

--
http://zope.org/Members/d2m
http://planetzope.org

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] zope3, site-packages and easy_install

2006-10-27 Thread Fred Drake

On 10/27/06, Michael Haubenwallner [EMAIL PROTECTED] wrote:

what should one suggest for development ?
- using zope3 checkout with its own python interpreter
- or remove site-packages from zope3 sys.path


I use a pristine Python installation that doesn't have anything else
installed into it.  It's shared among buildouts, but nothing else
touches the installation.


what to do in deployment environment ?
- using zope3 deploment with its very own python interpreter
- you never now when anyone will add another piece to site-packages


Yep.  Every deployment gets a private interpreter.  The system
interpreter can't be trusted since we don't know what patches may be
been installed, or what might change in updates applied by a sysadmin.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Every sin is the result of a collaboration. --Lucius Annaeus Seneca
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Access to persistent Zope tables/classes in ZODB

2006-10-27 Thread Jim Fulton

Rob J Goedman wrote:
I'm wondering if there is an easy way to get to persistent objects 
created in Zope and stored in ZODB

from a python program outside Zope.


Yup.

As an example, I would like to 
iterate over created 'buddies' in buddydemo.


The easiest way is to use zopectl, which takes care of opening the
database(s) and loading the Zope configuration for you.

Interactively, use zopectl debug.  This will give
you an interactive interpreter with an app variable set to
the top-level folder.

Use zopectl run your_script to run a script with the
same app variable set and ready for use.

Of course you can use the lower-level ZODB APIs to open the database
yourself.

Note that you'll want to use ZEO if you want to open the database while the
web application is running.

Jim


--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Zope3 database activity

2006-10-27 Thread Jim Fulton

Thierry Florac wrote:

Zope2 provided a nice tool in his control panel to view database
activity (objects loads and stores, cache usage...).


Yes. This is wildly useful for improving performance.  In
many applications, a good way to improve performance is to
allocate a larger object cache using more physical memory.
(Buying more RAM is a very cost effective hardware upgrade.)


Two questions :
 - is there any way to get access to such information with Zope3 ?


Zope3 uses the same ZODB that Zope 2 uses, so the necessary
infrastructure is there. No one has written the equivalent UI
tool AFAIK.


 - is it possible with Zope3 to setup cache size ??


Of course, using the same option in the zope.conf file.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] viewtemplate

2006-10-27 Thread eXt
Hi all

  I recently read Stephan Richter's blog post: 
http://blogs.lovelysystems.com/srichter/2006/09/20/the-skin-browser-and-lovely-systems-new-development-workflow
 
and intendent scope of viewlets thread: 
http://thread.gmane.org/gmane.comp.web.zope.zope3.user/4652/focus=4652.

I like the idea behind viewtemplate very much (separation of template and view 
code), but I've some problems with putting all of this together. Let me 
summarize:

1. Views and Viewlets belong to the layer

2. Templates belong to the skin

3. ViewletManagers belong to.. ? 

4. Lovely's packaging practices says that: 
- views should be placed and registered in 
project.browser.layer.subpackage_for_the_view_impelentations 
- templates should be placed and registered in project.browser.skin 
package
- viewletmanagers... ? 

ViewletManagers may have a class and a template, VMs are called from 
templates, viewlets are registered for VMs. Shouldn't it be resolved by 
template tag which registers a template with ViewletManager as it is done 
for Viewlets and Views?

One more thing is a layer declaration such as (from Stephan's post):

browser:viewlet
name=bloglist
for=myproject.interfaces.IBlog
manager=myproject.browser.interfaces.IContent
view=myproject.browser.blog.BlogPage
class=myproject.browser.blog.BlogList
layer=myproject.browser.IProjectLayer
permission=zope.Public
/

while template is registered for skin:
browser:template
template=bloglist.pt
layer=myproject.browser.skin.IProjectSkin
for=myproject.browser.blog.BlogList
/

I'm pretty new to the skinnig concept. What is the purpose of IProjectLayer? 
Is it that views and viewlets are registered to IProjectLayer which 
is project marker interface, while templates are registered for skins. As a 
result we have stable project's code base and skins which are just templates.

Any discussion on the above topics will be appreciated :)


-- 
Jakub Wisniowski
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] zope3, site-packages and easy_install

2006-10-27 Thread Fred Drake

On 10/27/06, Jim Fulton [EMAIL PROTECTED] wrote:

Lets not forget: or what might have been left out by the system packager.


Good point.  We've often encountered systems where distutils has been
left out, mistaken for something only needed by developers.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Every sin is the result of a collaboration. --Lucius Annaeus Seneca
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Access to persistent Zope tables/classes in ZODB

2006-10-27 Thread Rob J Goedman

Thanks Jim,

I had gotten to the following point (although you have now shown
me a better way to get there, I was using FileStorage):

ZODB.DB.DB object at 0x137e910
{'Application': zope.app.folder.folder.Folder object at 0x1377d70,  
'zope.app.generations': persistent.dict.PersistentDict object at  
0x1377db0}

zope.app.folder.folder.Folder object at 0x1377d70
OOBTreeItems object at 0x1386228

print f1[0].keys()[1]
Rob's buddies
print f1[0].values()[1]
buddydemo.buddy.BuddyFolder object at 0x1377f30
print f1[0].values()[1].__getitem__
	bound method BuddyFolder.__getitem__ of  
buddydemo.buddy.BuddyFolder object at 0x1377f30


This is where I get stuck. Been going over the sources to figure out  
how to iterate over these.


You're 2nd point, about using ZEO, is also very valid (I need to just  
read my 'buddies'  and send the
data down to a bunch of embedded Linux based controllers but the ZODB  
will be locked).


I did notice since I did this, bin/runzope acts differently (on this  
Zope/ZODB?). I created a new instance in 121

and transferred all applications and the new instance works fine:

Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$ cd ../121/
Robs-Laptop:~/Projects/Zope/Zope3/121 rob$ runzope
--
2006-10-27T14:45:57 INFO root -- HTTP:localhost:9090 Server started.
Hostname: localhost
Port: 9090
--
2006-10-27T14:45:57 INFO root Startup time: 9.072 sec real, 8.710 sec  
CPU

^C

But the old instance in One2One now just seem to test:

Robs-Laptop:~/Projects/Zope/Zope3/121 rob$ cd ../One2One/
Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$ runzope
--
2006-10-27T14:47:56 WARNING root Developer mode is enabled: this is a  
security risk and should NOT be enabled on production servers.  
Developer mode can be turned off in etc/zope.conf

Total: 0 tests, 0 failures, 0 errors
Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$

Any idea what causes this?

Anyway, thanks again for your quick response!

Rob


On Oct 27, 2006, at 4:41 AM, Jim Fulton wrote:


Rob J Goedman wrote:
I'm wondering if there is an easy way to get to persistent objects  
created in Zope and stored in ZODB

from a python program outside Zope.


Yup.

As an example, I would like to iterate over created 'buddies' in  
buddydemo.


The easiest way is to use zopectl, which takes care of opening the
database(s) and loading the Zope configuration for you.

Interactively, use zopectl debug.  This will give
you an interactive interpreter with an app variable set to
the top-level folder.

Use zopectl run your_script to run a script with the
same app variable set and ready for use.

Of course you can use the lower-level ZODB APIs to open the database
yourself.

Note that you'll want to use ZEO if you want to open the database  
while the

web application is running.

Jim


--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Many problems with static-apidoc script...

2006-10-27 Thread KLEIN Stéphane

Hi,

I've one zope3 instance in : ~/zope/instance/2/

When I do :

cd ~/zope/instance/2/bin
./static-apidoc -d ~/zope/doc/

I've this error :

Traceback (most recent call last):
 File ./static-apidoc, line 31, in ?
   main()
 File /home/harobed/zope/opt2//lib/python/zope/app/apidoc/static.py,
line 504, in main
   maker.start()
 File /home/harobed/zope/opt2//lib/python/zope/app/apidoc/static.py,
line 193, in start
   self.browser = PublisherBrowser()
 File /home/harobed/zope/opt2//lib/python/zope/app/apidoc/static.py,
line 141, in __init__
   functional.Functional.setUp()
 File /home/harobed/zope/opt2//lib/python/zope/app/testing/functional.py,
line 198, in setUp
   FunctionalTestSetup(self.config_file)
 File /home/harobed/zope/opt2//lib/python/zope/app/testing/functional.py,
line 139, in __init__
   self.app = Debugger(self.db, config_file)
 File /home/harobed/zope/opt2//lib/python/zope/app/debug/debug.py,
line 35, in __init__
   config(config_file)
 File /home/harobed/zope/opt2//lib/python/zope/app/appsetup/appsetup.py,
line 110, in config
   context = xmlconfig.file(file, context=context, execute=execute)
 File /home/harobed/zope/opt2//lib/python/zope/configuration/xmlconfig.py,
line 579, in file
   include(context, name, package)
 File /home/harobed/zope/opt2//lib/python/zope/configuration/xmlconfig.py,
line 508, in include
   f = openInOrPlain(path)
 File /home/harobed/zope/opt2//lib/python/zope/configuration/xmlconfig.py,
line 419, in openInOrPlain
   fp = open(filename)
IOError: [Errno 2] No such file or directory:
'/home/harobed/zope/instances/2/bin/ftesting.zcml'

When I do :

cd ~/zope/instance/2/
bin/static-apidoc -d ~/zope/doc/

I've this error :

Traceback (most recent call last):
 File bin/static-apidoc, line 31, in ?
   main()
 File /home/harobed/zope/opt2//lib/python/zope/app/apidoc/static.py,
line 504, in main
   maker.start()
 File /home/harobed/zope/opt2//lib/python/zope/app/apidoc/static.py,
line 200, in start
   self.browser._links_factory.urltags = urltags
 File /home/harobed/zope/opt2//lib/python/mechanize/_mechanize.py,
line 505, in __getattr__
   raise AttributeError(
AttributeError: class 'zope.app.apidoc.static.PublisherBrowser'
instance has no attribute _links_factory (perhaps you forgot to
.select_form()?)

What is my mistake ? How can I use static-apidoc script ?

Thanks for your help
Stephane
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users