Re: Errors running CMFPlone/Extensions/setupSite.py with Zope 2.7
Andy McKay <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.installers |
|---|---|
| Message-ID | <[email protected]> |
> See this URL for information about the above error message:
>
> http://mail.zope.org/pipermail/zope-dev/2003-August/020274.html
Following that thread through Eric seemed to have a solution. I made
some minor hacks and setupSite.py works just fine. Of course I have a
load of other 2.7 problems to get through - but hey this is one more done ;)
Im not sure what this dropPrivileges is about, but it looks ok so far.
$ diff -u ~/cvs/CMFPlone-2/Extensions/setupSite.py setupSite.py
--- /home/andy/cvs/CMFPlone-2/Extensions/setupSite.py 2003-11-25
15:52:40.000000000 -0800
+++ setupSite.py 2003-12-14 22:34:57.000000000 -0800
@@ -13,9 +13,22 @@
os.environ['SOFTWARE_HOME'] = swhome
sys.path.insert(0, '%s' % swhome)
- # have to set up env first
- from App import FindHomes
+ # have to set up env first
import Zope
+
+ from App import FindHomes
+ from Zope.Startup.options import ZopeOptions
+ from Zope.Startup import handlers as h
+ from App import config
+ opts = ZopeOptions()
+ opts.configfile = os.path.join(swhome,'etc/zope.conf')
+ sys.argv = sys.argv[:1] # gotta love this ;)
+ opts.realize()
+ h.handleConfig(opts.configroot,opts.confighandlers)
+ config.setConfiguration(opts.configroot)
+
+ #from Zope.Startup import dropPrivileges
+ #dropPrivileges(opts.configroot)
app = Zope.app()
--
Andy McKay
ClearWind Consulting
http://www.clearwind.ca
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/