Re: [Zope] Deploying with buildout
Chris McDonough <[EMAIL PROTECTED]> writes: > On Aug 28, 2007, at 5:55 PM, Ross Patterson wrote: >> >>> Putting these packages in your Zope instance home's "lib/python" >>> directory should get them found before the others. For Products, you >>> can use an additional "products-path" directive in zope.conf and put >>> files in there. I don't know how to tell buildout to do either, >>> though. >> >> But wouldn't that cause problems in this case since zope.app.interface >> is a package in two nested-namespace packages. IOW, wouldn't putting >> zope/app/interface in $INSTANCE_HOME/lib/python mean that it was the >> only package in the zope or zope.app namespace packages? > > Gah. Yeah. Sorry. You might get away with creating and installing a > custom zope.app.interface-myversion.egg into your Python's site- > packages dir and using something like: > > from pkg_resources import require > require('zope.app.interface = myversion') > > ... in a script early on or do the equivalent within a .pth file in > your site-packages dir. Even after that, you *might* need to munge > the PYTHONPATH, though, to prevent Zope from finding the one in > SOFTWARE_HOME first. :-( > > I find Ian Bicking's virtual_python.py script very useful for trying > things like this out. I usually install both a custom version of > Python and one or more virtual pythons in my automated scripts (using > the --no-site-packages flag to virtual_python.py). This means I can > let distutils/setuptools packages install to site-packages "normally" > without polluting the main Python installation's site-packages and so > I don't need to go through gyrations to munge the PYTHONPATH for them > to be found somewhere else. I think buildout tends to prefer > creating scripts that munge the path. Great. Thanks, I'll check those out. Ross ___ 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] Deploying with buildout
On Aug 28, 2007, at 5:55 PM, Ross Patterson wrote: Putting these packages in your Zope instance home's "lib/python" directory should get them found before the others. For Products, you can use an additional "products-path" directive in zope.conf and put files in there. I don't know how to tell buildout to do either, though. But wouldn't that cause problems in this case since zope.app.interface is a package in two nested-namespace packages. IOW, wouldn't putting zope/app/interface in $INSTANCE_HOME/lib/python mean that it was the only package in the zope or zope.app namespace packages? Gah. Yeah. Sorry. You might get away with creating and installing a custom zope.app.interface-myversion.egg into your Python's site- packages dir and using something like: from pkg_resources import require require('zope.app.interface = myversion') ... in a script early on or do the equivalent within a .pth file in your site-packages dir. Even after that, you *might* need to munge the PYTHONPATH, though, to prevent Zope from finding the one in SOFTWARE_HOME first. :-( I find Ian Bicking's virtual_python.py script very useful for trying things like this out. I usually install both a custom version of Python and one or more virtual pythons in my automated scripts (using the --no-site-packages flag to virtual_python.py). This means I can let distutils/setuptools packages install to site-packages "normally" without polluting the main Python installation's site-packages and so I don't need to go through gyrations to munge the PYTHONPATH for them to be found somewhere else. I think buildout tends to prefer creating scripts that munge the path. - C ___ 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] Deploying with buildout
Chris McDonough <[EMAIL PROTECTED]> writes: > On Aug 27, 2007, at 10:59 PM, Ross Patterson wrote: > >> We have a Plone 3.0/Zope 2.10 application that we need to develop >> on, maintain and >> deploy to a ZEO server and multiple ZEO clients. Currently we use svn >> bundles of Zope and Plone and our own packages and products in one big >> svn:externals definition. We also use some more recent versions of >> certain products and packages than those included in the upstream >> svn:externals. For example: >> >> Zope svn://svn.zope.org/repos/main/Zope/branches/2.10 >> Zope/lib/python/zope/app/interface svn://svn.zope.org/repos/main/ >> zope.app.interface/trunk/src/zope/app/interface >> >> Though I haven't seen any documentation to this effect, svn seems to >> treat the second svn:externals as a "svn switch" on "svn up". >> >> So one question I have is how would I "override" the versions of some >> package like this using buildout? > > Putting these packages in your Zope instance home's "lib/python" > directory should get them found before the others. For Products, you > can use an additional "products-path" directive in zope.conf and put > files in there. I don't know how to tell buildout to do either, > though. But wouldn't that cause problems in this case since zope.app.interface is a package in two nested-namespace packages. IOW, wouldn't putting zope/app/interface in $INSTANCE_HOME/lib/python mean that it was the only package in the zope or zope.app namespace packages? >> Another question I have is that there aren't releases for all the >> dependencies our application has. I'm wondering what the best way >> is to >> define a canonical release for deployment to our cluster. Ideally, >> we'd >> have a buildout (or whatever) on a staging server where we're testing >> the candidate for deployment and then when all tests pass that *exact* >> source should be deployed to the cluster. > > I always use a vendor import for this (to a separate CVS server, I > don't use SVN). Yeah, I guess that what we'll end up doing. >> How might one do this without >> upstream releases? Is there a way to get buildout and setuptools to >> play together so that I can build a source distribution from the test >> passing buildout on staging? Is there a way I can have a buildout on >> each cluster node such that a simple ./bin/buildout will get the >> latest >> deployment release for that node? > > Personally I use a script that knows about all of the revisions of all > of the products and packages I want to deploy, and which creates a > "sandbox", downloading and installing all of them (as well as > creating instances, etc). It doesn't work very well for upgrades, > but for starting a sandbox fresh, it's fine. See http:// > agendaless.com/Members/chrism/software/buildit and http:// > www.plope.com/Members/chrism/buildit_example . Thanks, I'll check it out. Ross ___ 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] Deploying with buildout (was: buildout, instancemanager, and eggs)
On Aug 27, 2007, at 10:59 PM, Ross Patterson wrote: We have a Plone 3.0/Zope 2.10 application that we need to develop on, maintain and deploy to a ZEO server and multiple ZEO clients. Currently we use svn bundles of Zope and Plone and our own packages and products in one big svn:externals definition. We also use some more recent versions of certain products and packages than those included in the upstream svn:externals. For example: Zope svn://svn.zope.org/repos/main/Zope/branches/2.10 Zope/lib/python/zope/app/interface svn://svn.zope.org/repos/main/ zope.app.interface/trunk/src/zope/app/interface Though I haven't seen any documentation to this effect, svn seems to treat the second svn:externals as a "svn switch" on "svn up". So one question I have is how would I "override" the versions of some package like this using buildout? Putting these packages in your Zope instance home's "lib/python" directory should get them found before the others. For Products, you can use an additional "products-path" directive in zope.conf and put files in there. I don't know how to tell buildout to do either, though. Another question I have is that there aren't releases for all the dependencies our application has. I'm wondering what the best way is to define a canonical release for deployment to our cluster. Ideally, we'd have a buildout (or whatever) on a staging server where we're testing the candidate for deployment and then when all tests pass that *exact* source should be deployed to the cluster. I always use a vendor import for this (to a separate CVS server, I don't use SVN). How might one do this without upstream releases? Is there a way to get buildout and setuptools to play together so that I can build a source distribution from the test passing buildout on staging? Is there a way I can have a buildout on each cluster node such that a simple ./bin/buildout will get the latest deployment release for that node? Personally I use a script that knows about all of the revisions of all of the products and packages I want to deploy, and which creates a "sandbox", downloading and installing all of them (as well as creating instances, etc). It doesn't work very well for upgrades, but for starting a sandbox fresh, it's fine. See http:// agendaless.com/Members/chrism/software/buildit and http:// www.plope.com/Members/chrism/buildit_example . - C ___ 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] Can t start Zope
> try: result = render_blocks(self._v_blocks, md) > Unauthorized: You are not allowed to access 'admin' in this context > > Any ideas? This is not connected with previous error, but seems that your Zope worked before (-08-20T15:12:21). If so then what chages did you do? ;) As Andreas said previous error is possibly due to broken installation. Check if you have AccessControl.Role and if so, then check if your python/site-packages doesn't contain another one eg. from Zope3. -- Maciej Wisniowski ___ 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] Can t start Zope
This is in the error log: -08-20T15:12:21 ERROR root Exception while rendering an error message Traceback (most recent call last): File "/opt/zope/Zope-2.10.1_Software/lib/python/OFS/ SimpleItem.py", line 225, in raise_standardErrorMessage v = s(client, REQUEST, **kwargs) File "/opt/zope/Zope-2.10.1_Software/lib/python/OFS/ DTMLMethod.py", line 143, in __call__ r=apply(HTML.__call__, (self, client, REQUEST), kw) File "/opt/zope/Zope-2.10.1_Software/lib/python/DocumentTemplate/ DT_String.py", line 476, in __call__ try: result = render_blocks(self._v_blocks, md) File "/opt/zope/Zope-2.10.1_Software/lib/python/OFS/ DTMLMethod.py", line 136, in __call__ r=apply(HTML.__call__, (self, client, REQUEST), kw) File "/opt/zope/Zope-2.10.1_Software/lib/python/DocumentTemplate/ DT_String.py", line 476, in __call__ try: result = render_blocks(self._v_blocks, md) Unauthorized: You are not allowed to access 'admin' in this context Any ideas? On Aug 28, 2007, at 12:37 PM, Andreas Jung wrote: --On 28. August 2007 12:32:42 -0400 Tom Von Lahndorff <[EMAIL PROTECTED]> wrote: import AccessControl.Role, AccessControl.Owned, App.Common ImportError: No module named AccessControl.Role Broken installation? And why Zope 2.10.1? We are currently at 2.10.4. Andreas ___ 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] Can't start Zope
--On 28. August 2007 12:32:42 -0400 Tom Von Lahndorff <[EMAIL PROTECTED]> wrote: import AccessControl.Role, AccessControl.Owned, App.Common ImportError: No module named AccessControl.Role Broken installation? And why Zope 2.10.1? We are currently at 2.10.4. Andreas pgpEfqkgvBcpS.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] Can't start Zope
Getting the following error. Thanks in advance. ]# ./zopectl start Traceback (most recent call last): File "/opt/zope/Zope-2.10.1_Software/lib/python/Zope2/Startup/ zopectl.py", line 322, in ? main() File "/opt/zope/Zope-2.10.1_Software/lib/python/Zope2/Startup/ zopectl.py", line 280, in main options.realize(args) File "/opt/zope/Zope-2.10.1_Software/lib/python/Zope2/Startup/ zopectl.py", line 91, in realize ZDOptions.realize(self, *args, **kw) File "/opt/zope/Zope-2.10.1_Software/lib/python/zdaemon/ zdoptions.py", line 273, in realize self.load_schema() File "/opt/zope/Zope-2.10.1_Software/lib/python/zdaemon/ zdoptions.py", line 321, in load_schema self.schema = ZConfig.loadSchema(self.schemafile) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ loader.py", line 31, in loadSchema return SchemaLoader().loadURL(url) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ loader.py", line 65, in loadURL return self.loadResource(r) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ loader.py", line 159, in loadResource schema = ZConfig.schema.parseResource(resource, self) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ schema.py", line 27, in parseResource xml.sax.parse(resource.file, parser) File "/usr/local/lib/python2.4/xml/sax/__init__.py", line 33, in parse parser.parse(source) File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/local/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 300, in start_element self._cont_handler.startElement(name, AttributesImpl(attrs)) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ schema.py", line 99, in startElement getattr(self, "start_" + name)(attrs) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ schema.py", line 475, in start_schema keytype, valuetype, datatype = self.get_sect_typeinfo(attrs) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ schema.py", line 201, in get_sect_typeinfo datatype = self.get_datatype(attrs, "datatype", "null", base) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ schema.py", line 194, in get_datatype return self._registry.get(dtname) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ datatypes.py", line 398, in get t = self.search(name) File "/opt/zope/Zope-2.10.1_Software/lib/python/ZConfig/ datatypes.py", line 423, in search package = __import__(n, g, g, component) File "/opt/zope/Zope-2.10.1_Software/lib/python/Zope2/Startup/ datatypes.py", line 21, in ? import OFS.Uninstalled File "/opt/zope/Zope-2.10.1_Software/lib/python/OFS/ Uninstalled.py", line 16, in ? import SimpleItem, Globals, Acquisition File "/opt/zope/Zope-2.10.1_Software/lib/python/OFS/ SimpleItem.py", line 26, in ? import AccessControl.Role, AccessControl.Owned, App.Common ImportError: No module named AccessControl.Role ___ 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] Deleting a file in Python
--On 28. August 2007 09:36:18 -0400 [EMAIL PROTECTED] wrote: I've tried not assigning it to a variable, all kinds of minor syntax changes, but nothing I do works, it gives the same error: Error Type: AttributeError Error Value: manage_getProperty You're doing trial-and-error programming. Instead of inventing names: better look at the documentation (even it is somewhat old). "The Zope Book 2.7 edition" (Google!) tells you in the "Advanced Scripting" chapter about properties and how to use them (hint: getProperty()). -aj pgpTqGvXJb2EJ.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] Deleting a file in Python
> On Sat, Aug 25, 2007 at 07:35:06AM -0400, [EMAIL PROTECTED] wrote: >> but I can't figure out where context.* is documented. > > It depends what kind of object context is. > To find out, you may find this product useful: > http://plone.org/products/docfindertab > > Here is a good start reference for Zope 2 APIs... it was never > "finished" or updated for zope later than 2.7, but it's a lot > better than nothing: > http://www.plope.com/Books/2_7Edition/AppendixB.stx > > -- > > Paul Winkler > http://www.slinkp.com Thanks for the links, I'll try installing docfindertab soon as I can. I'm trying to read a property of a file and the description of it on the plope site is too terse for me to understand. Here is my code: doc=getattr(context, filename) getname=doc.manage_getProperty('user_name') filename is a parameter passed to the python script, it the name of the file I'm wanting a property of. I've tried several ways of specifying the property and none of them work. The property is called user_name, its a string. Above I'm using quotes to make it a string passing it by value, I've also done it by assigning a variable the property name, etc. I also tried it with the optional 2nd argument with different variables like: getname=doc.manage_getProperty('user_name',d=None) I've tried not assigning it to a variable, all kinds of minor syntax changes, but nothing I do works, it gives the same error: Error Type: AttributeError Error Value: manage_getProperty ___ 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] help with zodb server
Hi, I installed ZODB3-3.3.1. Problem is server says it starts, but is not there. I can understand what is happening. Please help! [root]# /usr/bin/zdctl.py -C /etc/zeoctl.conf start . . . . . . . . . . . daemon process started, pid=27100 [root]# /usr/bin/zdctl.py -C /etc/zeoctl.conf status daemon manager running; daemon process not running There is no activity in the log file Here is the info with "show" schemafile: '/usr/lib/python2.4/site-packages/zdaemon/schema.xml' configfile: '/etc/zeoctl.conf' interactive: None default_to_interactive: True zdrun:'/usr/bin/zdrun.py' python: '/usr/bin/python' program: ['/usr/bin/runzeo.py', '-C', '/etc/zeo.config'] backofflimit: 10 daemon: True forever: False sockname: '/soft/zeohome/zdsock' exitcodes:[0, 2] user: None umask:022 directory:'/soft/zeohome' logfile: None hang_around: False Also, when I try another method, I get error [EMAIL PROTECTED] tmp]# runzeo.py -a 127.0.0.1:9675 -f /soft/zeotmp/Data.fs Error: invalid value for -f '/soft/zeotmp/Data.fs': bad marshal data For help, use /usr/bin/runzeo.py -h Question: Who should own the directories and the Data.fs? Thank you very much! Regards, Nagaraj -- +--+--+ Nagaraj Panyam | Office tel: +91-22-22782610 Dept of High Energy Physics| Office fax: +91-22-22804610 Tata Instt. of Fundamental Research| Home tel : +91-22-22804936 Mumbai - 400 005, INDIA| **Email** : [EMAIL PROTECTED] +--+--+ ___ 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] Re: Help with DateTime.earliestTime()
J Cameron Cooper, on 2007-08-27: > Maurits van Rees wrote: >> Hm, that should probably be "except DateTime.DateTime.DateError" but >> there is not really anything else that can go wrong here. > > A ConflictError can go wrong here, which is an additional and important > reason not to have a bare except. There are good reasons without that, > as well. Well, you are right of course. I fixed it. Thanks for keeping me sharp. :) -- Maurits van Rees | http://maurits.vanrees.org/ [NL] Work | http://zestsoftware.nl/ "Do not worry about your difficulties in computers, I can assure you mine are still greater." ___ 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 )