Re: [Zope-dev] When is the configuration read in Zope 2.7?
Things changed around a bit since I did this patch. I'm trying to get a new one working but am having some issues with the 2.7 trunk in svn. I think in general the startup sequence could use some clean up. I'm working on mapping how it all works maybe that would help make it less opaque. -EAD On May 15, 2004, at 12:53 PM, Chris McDonough wrote: I think Fred might have some ideas about how to do the ZOPE_CONFIG feature better if you can coax them out of him. ;-) On Sat, 2004-05-15 at 03:56, Andreas Jung wrote: --On Samstag, 15. Mai 2004 1:59 Uhr +0200 Stefan H. Holek [EMAIL PROTECTED] wrote: Zope tests fail for me, unfortunately Andreas cannot reproduce this. The ZOPE_CONFIG patch was responsible for other failures. I reverted the change and check for a better solution by next week. -aj ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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-dev] Getting Zope 2.7 trunk working
I'm trying to do work off of the 2.7 trunk in svn. After doing: svn svn://svn.zope.org/repos/main/Zope/trunk zope ./configure make make instance when I run bin/zopectl debug I get the following, what am I doing wrong? No handlers could be found for logger Init Starting debugger (the name app is bound to the top-level Zope object) 2004-05-17 11:33:09 WARNING Init Ambiguous name for method of OFS.Uninstalled.BrokenClass: 'manage' != 'manage_main' 2004-05-17 11:33:09 WARNING Init Ambiguous name for method of OFS.Uninstalled.BrokenClass: 'manage' != 'manage_workspace' 2004-05-17 11:33:10 ERROR Zope.ZODBMountPoint Failed to mount database. exceptions.AttributeError ('Connection' object has no attribute '_getMountedConnection') Traceback (most recent call last): File /home/edahl/src/zope/lib/python/Products/ZODBMountPoint/Mount.py, line 93, in _getOrOpenObject conn = self._getMountedConnection(anyjar) File /home/edahl/src/zope/lib/python/Products/ZODBMountPoint/Mount.py, line 71, in _getMountedConnection conn = anyjar._getMountedConnection(db_name) AttributeError: 'Connection' object has no attribute '_getMountedConnection' 2004-05-17 11:33:10 ERROR Zope Default Object Creation Could not add a /temp_folder mount point due to an error. Traceback (most recent call last): File /home/edahl/src/zope/lib/python/OFS/Application.py, line 358, in install_tempfolder_and_sdc manage_addMounts(app, ('/temp_folder',)) File /home/edahl/src/zope/lib/python/Products/ZODBMountPoint/ MountedObject.py, line 283, in manage_addMounts mo._test(app) File /home/edahl/src/zope/lib/python/Products/ZODBMountPoint/Mount.py, line 126, in _test self._getOrOpenObject(parent) File /home/edahl/src/zope/lib/python/Products/ZODBMountPoint/Mount.py, line 93, in _getOrOpenObject conn = self._getMountedConnection(anyjar) File /home/edahl/src/zope/lib/python/Products/ZODBMountPoint/Mount.py, line 71, in _getMountedConnection conn = anyjar._getMountedConnection(db_name) AttributeError: 'Connection' object has no attribute '_getMountedConnection' ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] When is the configuration read in Zope 2.7?
Things changed around a bit since I did this patch. I'm trying to get a new one working but am having some issues with the 2.7 trunk in svn. I think in general the startup sequence could use some clean up. I'm working on mapping how it all works maybe that would help make it less opaque. -EAD On May 15, 2004, at 12:53 PM, Chris McDonough wrote: I think Fred might have some ideas about how to do the ZOPE_CONFIG feature better if you can coax them out of him. ;-) On Sat, 2004-05-15 at 03:56, Andreas Jung wrote: --On Samstag, 15. Mai 2004 1:59 Uhr +0200 Stefan H. Holek [EMAIL PROTECTED] wrote: Zope tests fail for me, unfortunately Andreas cannot reproduce this. The ZOPE_CONFIG patch was responsible for other failures. I reverted the change and check for a better solution by next week. -aj ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] When is the configuration read in Zope 2.7?
Ok, I think I have a fix for this but we have a little semantics issue. I thought that once the Zope config was set it could not be changed. In the new ZOPE_CONFIG patch the environ variable only gets used as a last resort in Zope.app() if no other configuration has been set. To do this I added a isConfigured() function to App.config to check its _config global. I'm assuming that this is the official Zope config, correct? Now there is a test testZopeRunConfigure in lib/python/Zope/Startup/tests/testStarter.py that runs App.config.getConfiguration() and then makes a test config file and sets it. The result is a test where the config is reset within one run. This test fails with the semantics described above. Which is correct? I'm enclosing the patch for reference. -EAD ZOPE_CONFIG.patch Description: Binary data On May 17, 2004, at 12:20 PM, Erik A.Dahl wrote: Things changed around a bit since I did this patch. I'm trying to get a new one working but am having some issues with the 2.7 trunk in svn. I think in general the startup sequence could use some clean up. I'm working on mapping how it all works maybe that would help make it less opaque. -EAD On May 15, 2004, at 12:53 PM, Chris McDonough wrote: I think Fred might have some ideas about how to do the ZOPE_CONFIG feature better if you can coax them out of him. ;-) On Sat, 2004-05-15 at 03:56, Andreas Jung wrote: --On Samstag, 15. Mai 2004 1:59 Uhr +0200 Stefan H. Holek [EMAIL PROTECTED] wrote: Zope tests fail for me, unfortunately Andreas cannot reproduce this. The ZOPE_CONFIG patch was responsible for other failures. I reverted the change and check for a better solution by next week. -aj ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] manage_permission from script
Thanks for the suggestion but no joy here. Here is the full trace... Python 2.3.3 (#1, Jan 27 2004, 09:17:28) [GCC 3.2 20020903 (Red Hat Linux 8.0 3.2-7)] on linux2 Type help, copyright, credits or license for more information. import Zope app = Zope.app() app.testfolder Folder instance at 410d9f50 tf = app.testfolder tf.getPhysicalRoot().manage_permission(View, [Owner,]) Traceback (most recent call last): File stdin, line 1, in ? File /home/edahl/zope-2.7.0/lib/python/AccessControl/Role.py, line 164, in manage_permission for p in self.ac_inherited_permissions(1): File /home/edahl/zope-2.7.0/lib/python/AccessControl/Role.py, line 82, in ac_inherited_permissions for p in self._subobject_permissions(): File /home/edahl/zope-2.7.0/lib/python/OFS/ObjectManager.py, line 212, in _subobject_permissions return (Products.__ac_permissions__+ AttributeError: aq_acquire On Apr 7, 2004, at 7:30 PM, [EMAIL PROTECTED] wrote: For setting permission on the root application object, use setPermissionDefault of SecurityInfo. Eh, this only works for my own defined permissions. However I just tried this from my product and it does what it supposed to do: self.getPhysicalRoot().manage_permission('View', ['Owner']) Sandor ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-dev] manage_permission from script
I'm trying to use manage_permission from a script against the root application object. When I do I get the following error from ObjectManager. This definitely works from within zope since I'm able to edit permissions from the ZMI. I guess the app object returned from Zope.app() doesn't have an acquisition wrapper? -EAD app.manage_permission(View, ['Owner',], 1) Traceback (most recent call last): File stdin, line 1, in ? File /home/edahl/zope-2.7.0/lib/python/AccessControl/Role.py, line 164, in manage_permission for p in self.ac_inherited_permissions(1): File /home/edahl/zope-2.7.0/lib/python/AccessControl/Role.py, line 82, in ac_inherited_permissions for p in self._subobject_permissions(): File /home/edahl/zope-2.7.0/lib/python/OFS/ObjectManager.py, line 212, in _subobject_permissions return (Products.__ac_permissions__+ AttributeError: aq_acquire ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] Re: running test.py with instance_home products.
Or use this patch http://zope.org/Collectors/Zope/1233 that finds the config file via the environment variable ZOPE_CONFIG during a normal import Zope; app=Zope.app() dance. -EAD On Mar 2, 2004, at 10:52 AM, Tres Seaver wrote: Chris Withers wrote: Chris McDonough wrote: Has anyone found a reasonable strategy for using Zope's test.py to test products that are installed outside the Zope software home? I try running it from the software home and using the --dir option to point it to where my product is, but it tells me it can't find any tests. I think I run test.py (or somethign similar) from a shell script in which I set the PRODUCTS_PATH environment variable, as well as INSTACNE_HOME and SOFTWARE_HOME. How shoudl I be looking to do that in Zope 2.7? ;-) test.py needs to grow a --config-file option; if passed in, it should do the Zope.startup() dance with the passed file, e.g.:: --- 8 -- import Zope import App.config from Zope.Startup import handlers, options def installConfigFileForTesting(config_file) opts = options.ZopeOptions() opts.realize(args=('-C', config_file)) handlers.handleConfig(opts.configroot, opts.confighandlers) App.config.setConfiguration(opts.configroot) Zope.startup() --- 8 -- Tres. -- === Tres Seaver[EMAIL PROTECTED] Zope Corporation Zope Dealers http://www.zope.com ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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-dev] Understanding 2.7 Product import
Ok 2.7 has an instance/Products directory. What magic is letting them be imported? I'm running a bunch of data loader scripts that create persistent zope products. I have found that: import Globals sets things up so that my data loader scripts can import products properly (even though their path is not in sys.path). I looked around in Globals to figure out what's going on and didn't find it. It would be nice if something in: import Zope. would kick off the special import magic! It seems a lot more intuitive to have this at the top of the __main__ script instead of Globals. -EAD ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] app = Zope.app() backwards incompatibility notice / discussion
Whatever happened to the ZOPE_CONFIG env idea? What I have found is that I started putting Zope.config(os.getenv(ZOPE_CONFIG)) in all my scripts. Why can't his happen within Zope.app()? Something like this. *** lib/python/Zope/__init__.py.orig 2003-12-21 19:24:25.0 -0500 --- lib/python/Zope/__init__.py 2004-02-16 14:15:48.0 -0500 *** *** 45,52 --- 45,59 from Zope.App.startup import startup as _startup _startup() + from Zope.Startup.run import configure + class ZopeConfig(Exception):pass + def app(*args, **kw): Utility for scripts to open a connection to the database + configfile = os.getenv(ZOPE_CONFIG) + if not configfile: + raise ZopeConfig, ERROR: ZOPE_CONFIG environment variable not found + configure(configfile) startup() return bobo_application(*args, **kw) *** *** 56,62 import ZPublisher return ZPublisher.test('Zope', *args, **kw) - from Zope.Startup.run import configure # Zope.App.startup.startup() sets the following variables in this module. DB = None --- 63,68 -EAD On Dec 22, 2003, at 1:37 PM, Dieter Maurer wrote: Chris McDonough wrote at 2003-12-21 18:16 -0500: ... Will need to do this under 2.7b4+: import Zope Zope.configure('/path/to/configfile') app = Zope.app() ... Jim Roepke suggested that if an ZOPE_CONFIG envvar was set with the config file path, that import Zope; Zope.app() could be made to just work, A very good suggestion! but I'm not sure this is any better than requiring that developers change their scripts. For developpers, it is much better: Add an environment variable at one (or a few) central place versus change lots of scripts. Guessing at the config file location is also fraught with problems, and I'd be hesitant to do it. The suggestion was to use the value of ZOPE_CONFIG as config file path. Thus, you do not need to guess... -- Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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-dev] Options problems with 2.7 and Zope.configure(/instance/etc/zope.conf)
I'm moving a bunch of scripts that do the import Zope, app=Zope.app() dance to 2.7. I added the configure call and things were find until I ran a script that had positional arguments. This gave me a ERROR: positional arguments are not supported. This comes from zdoptions.py:226. Basically zdoptions.py is parsing sys.argv. I don't think it needs to do this from the Zope.configure call since it is getting the config from zope.conf. We could prevent the sys.argv parse by passing changing lib/python/Zope/Startup/run.py:39 to: opts.realize(args=[], doc=Sorry, no option docs yet., raise_getopt_errs=0) It looks like all that zdoptions.py is looking for in sys.argv is its configfile. Since we passed this in to Zope.configure it doesn't seem nessesary. Would this mess other stuff up? I don't want zope parsing my script options! -EAD ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] How to make Zope fail nicely under high load?
using the _v_ variables won't work for this since different threads won't agree on who was latest. Its definitely a bad idea to do queries for these three data points. What about putting them in the temp_folder then you can still use ZEO with a bunch of clients that will all share the same data but you don't need to write the values to disk every time they change. Even putting them in a normal ZODB storage would be a _lot_ faster than doing a query. -EAD On Feb 12, 2004, at 8:19 AM, Bjorn Stabell wrote: Toby wrote: One of the optimization we're thinking of is storing results of ZCatalog searches (e.g., number of replies to postings) in volatile variables so we don't have to run the catalog search at all. We'd like to use memory space shared between threads for this. Using ZEO would require us to store this in the ZODB. Storing that in ZODB would be a bad idea. Theres no reason to think that this cache would be faster than ZCatalog. I dont see why you would be *required* to store in ZODB... just dont share your cache between publisher threads on different Zope instances. (my apologies if this is obvious) Okay, for example, since it's a BBS we need to have quick access to: the latest poster the latest posting the latest registered member All of these are complex queries (in the case of the latest registered member it's not even a query but a brute-force search). What I think most ASP/PHP boards do is that they store these values in the database instead of querying for them all the time. Since many of these can be found through queries, they don't really need persistent storage, but updates need to be seen by all threads; thus the requirement for ZODB if we use ZEO, but the possibility to use (even faster) shared memory if we don't use ZEO. In effect we want to do something like this: def getLatestPoster(self): if not hasattr(self, '_v_latestPoster'): self._v_latestPoster = whatever_query() return self._v_latestPoster return self._v_latestPoster def setLatestPoster(self, poster): self._v_latestPoster = poster But instead of having thread-local variables we wanted to use Dieter Maurer's SharedResource in order to share the cache between threads: http://www.dieter.handshake.de/pyprojects/zope/SharedResource.html Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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-dev] Zope-2.6.3 issue with CMF-1.3.3 portal_types
I downloaded 2.6.3 to do some testing and found that with a totally generic CMF-1.3.3 there is an issue with opening properties of a portal type. Here is the stack trace: Traceback (innermost last): Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Products.CMFCore.utils, line 313, in manage_propertiesForm Module Shared.DC.Scripts.Bindings, line 261, in __call__ Module Shared.DC.Scripts.Bindings, line 292, in _bindAndExec Module App.special_dtml, line 174, in _exec Module DocumentTemplate.DT_In, line 703, in renderwob Module DocumentTemplate.DT_Let, line 76, in render Module DocumentTemplate.DT_Util, line 201, in eval - __traceback_info__: select_variable Module string, line 0, in ? AttributeError: min I walked back up this stack but I can't say I quite get it. Any body else? Error is provoked just by licking on one of the type objects in portal_types of a newly created totally generic portal. -EAD ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] app = Zope.app() backwards incompatibility notice / discussion
I do this dance a lot and this sounds fine to me. I tried using zopectl run with my scripts but you couldn't pass parameters to the script (which lowered the usefulness for me). -EAD On Dec 21, 2003, at 6:16 PM, Chris McDonough wrote: The extant import Zope; app = Zope.app() dance to get a hold of the Zope root object stopped working long ago on the 2.7 branch and HEAD due to the new configuration machinery, which implies that users be explicit about configuration settings rather than allowing Zope to guess. Up til now, the dance to get Zope 2.7 to start properly from within a script was byzantine and obscure. I've made a checkin which makes it a little easier (or at least I'm about to as soon as the full unit test suite comes back passed ;-). Code which used to do: import Zope app = Zope.app() Will need to do this under 2.7b4+: import Zope Zope.configure('/path/to/configfile') app = Zope.app() (I wont bother telling you what the dance was for 2.7 before now, it was pretty awful). I realize this is suboptimal from a backwards compatibility perspective, but I'm not sure how to make it any better, seeing as the config file has some fairly important information in it (like which databases to use) and guessing would be very bad in this context. Jim Roepke suggested that if an ZOPE_CONFIG envvar was set with the config file path, that import Zope; Zope.app() could be made to just work, but I'm not sure this is any better than requiring that developers change their scripts. Guessing at the config file location is also fraught with problems, and I'd be hesitant to do it. I'm apt just to recommend that we require that developers add the Zope.configure(filename) line to their scripts as opposed to doing anything more magical. I'm sure there will be indignant wails about it, but c'est la vie. ;-) Note that FWIW, you can also do (on UNIX): zopectl run scriptname .. which will run a script with the name app set up as the root Zope application object. This might be the easiest way to run scripts which need to operate against Zope objects going forward. - C ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] Reminder: bug day tomorrow Oct 21
I'm getting close to needing to roll out an upgrade for a client site that will need to use python2.2 or . I have zope-2.6.2 working with python2.2.3 but when I try and use python2.3.2 things don't go so well. I'm wondering should I wait for 2.7 (and python2.3.2) or just go with what I have. I would like to roll the upgrade next week (but I might be able to put it off for another week). -EAD On Monday, October 20, 2003, at 10:59 AM, Brian Lloyd wrote: Hi all - A quick reminder that we'll be having a bug day tomorrow 10/21 to try to knock out some remaining issues in the drive to get a Zope 2.7 final out. Hope to see you on #zope-bugday ! Brian Lloyd[EMAIL PROTECTED] V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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-dev] Zope 2.6.2, Zeo 2.0.1b1 and python 2.2.3
I'm trying to get this combo working (I know its not officially supported). It works fine except for when a second client updates zeo the changes aren't seen from the first client (until its restarted). I ran the zeo tests with 2.2.3 and they all pass. Zope 2.6.2 seems to work fine even with zeo when only one client is doing updates. Where would I look to try and track down the problem (somewhere in the caching code?) Is this even worth pursuing? I have another library that I would like to use but it requires 2.2.3. -EAD ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] Zope.app() dance with 2.7
Chris, I took the code from zopectl that is uses to do the debug thing and scripts now work. Here is the code... import os if (os.environ.has_key('ZOPEVERSION') and os.environ['ZOPEVERSION'] == '2.7'): from Zope.Startup.options import ZopeOptions from Zope.Startup import handlers as h from App import config opts=ZopeOptions() opts.configfile=os.path.join(os.environ['ZOPE_HOME'],'etc/zope.conf') opts.realize() h.handleConfig(opts.configroot,opts.confighandlers) config.setConfiguration(opts.configroot) from Zope.Startup import dropPrivileges dropPrivileges(opts.configroot) You need to set ZOPEVERSION to 2.7 for it to work. Is there a better way to figure out the current zope version? It would be nice if the Zope module had a __version__ that you could check (or is there one somewhere else that I missed). I'm running this against the code from cvs but I bet it would work with 2.7.0b1 -EAD On Thursday, August 7, 2003, at 12:18 PM, Chris Withers wrote: Chris McDonough wrote: You can use zopectl debug to do this. What about when you're not debugging? What about scripts that pump stuff into Zope and the like? cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] 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-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] __setattr__ and acquisition ( was RE: __getattr__and acquisition)
Yep. This is a problem for me I'm trying to find something through acquisition in my __setattr__. Self is totally unwrapped. Can anyone think of a creative solution? aq_acquire doesn't help because self is not a wrapped object. :( Can't pass in the object I want because the whole point of the setattr is to get around the function call. -EAD Shane Hathaway wrote: Nicholas Henke (by way of Nicholas Henke ) wrote: Given the following code: I can see why access to self.thing fails in Inner::__setattr__, but the question is how do I do that -- can I not use __setattr__ and have to use a setAttr that is accessed via O.I.setAttr('help','me rhonda') ? Acquisition uses a subtle trick that makes everything work: the self passed to most methods is actually an acquisition wrapper, rather than the object itself. But the self passed to certain methods like __setattr__() is not wrapped. I'm sure there's a good reason. HTH. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] How to override __getattr__ and not break acquisition
Ok I need to override __getattr__ in one of my product classes. I'm sure this is killing acquisition but not sure about the persistence stuff (I think this is working). Is there a way to make this work? Here is what I'm doing: def __getattr__(self, name): if name == 'myattr': return self.myattr() I assume that somewhere in the Acquisition code there is a __getattr__ but I can't find it. I tried calling Implicit.__getattr__ but its not there. If some one has an example that would be great. -EAD ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )