[Zope-dev] is INSTANCE_HOME broken on Win32?
Hello :-) I'm trying to make Squishdot work with INSTANCE_HOME nicely. However, the testing is going wrong on a normal Win32 Install... I had lots of lines that went something like: f=open('%s/Products/%s.dtml' % (SOFTWARE_HOME,file)) Which generates: E:\Zope\2.2.0\lib\python/Products/Squishdot/validArticle.dtml That's not very nice in itself but seems to work with Python's open... However, when I change them all to be like, for example: f=open('%s/Products/%s.dtml' % (INSTANCE_HOME,file)) I then get: 'E:\\Zope\\2.2.0/Products/Squishdot/validArticle.dtml' which is: - horrible - wrong - doesn't work ;-) Anyway, I'm looking for something like INSTANCE_HOME or SOFTWARE_HOME that: - works in an INSTANCE_HOME setup - works in a non-INSTANCE_HOME setup - works on both Unix and Windows.. Any ideas? cheers, Chris ___ 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] Re: ZPatterns: Error: User error! :-/
Steve Alexander wrote: > > I have a customizer folder with various data-plugins and customizers. > File lib/python/Products/ZPatterns/Providers.py, line 178, in > namesForRegistration > (Object: PlugInBase) > TypeError: (see above) > > I'll start to look into this. > > Any advice would be most welcome. Found the problem... I did have different versions of ZPatterns on both machines after all. ZPatterns-0-4-1snap1 ZPatterns-0-4-2a1 Sorry... user error :-) -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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 )
RE: [Zope-dev] Z SQL Method Patch
Casey, I just wanted to thank you very, very, VERY much for that tip! I've spent far too many hours debugging very long, complex Z SQL methods. This will be an enormous help! By the way, it works like a charm on ZMySQLDA. Thanks! - T.J. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Casey Duncan Sent: Thursday, September 07, 2000 4:26 PM To: [EMAIL PROTECTED] Subject: [Zope-dev] Z SQL Method Patch In debugging some Z SQL methods I found it quite hard to diagnose certain errors returned by the database backend because Zope doesn't return the SQL sent to the server, instead it returns "Could not render the query template!" which is not really true for this case. In looking at the source code of DA.py (lib/python/Shared/DC/ZRDB), and I think I found a simple solution: in manage_test insert the following indented after line 343 (except:) try: src=self(REQUEST, src__=1) except: pass This re-renders the query template if possible without sending it to the backend and returns the SQL in src. The result is your backend error message followed by the SQL generated. This should really save time debugging any dynamic Z SQL methods. It was moderately tested on Zope 2.2.1/PostgreSQL 7 via PyGreSQLDA. It should not be database dependant though. Enjoy. -Casey Duncan ___ 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] ZPatterns: Error reimporting .zexp containing Folder w/ CustomizerSupportSupport
I have a customizer folder with various data-plugins and customizers. I just exported it from one zope installation, for importing into one on a different server. The installations are more or less identical -- same zope version, same products. When I try to reimport it, I get the following error: Error Type: TypeError Error Value: No data plug-ins available to link to in /emb Traceback (innermost last): File lib/python/ZPublisher/Publish.py, line 222, in publish_module File lib/python/ZPublisher/Publish.py, line 187, in publish File python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File lib/python/ZPublisher/Publish.py, line 171, in publish File lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_importObject) File lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_importObject) File lib/python/OFS/ObjectManager.py, line 535, in manage_importObject (Object: ApplicationDefaultPermissions) File lib/python/OFS/ObjectManager.py, line 290, in _setObject (Object: ApplicationDefaultPermissions) File lib/python/Products/ZPatterns/PlugIns.py, line 211, in manage_afterAdd (Object: PlugInBase) File lib/python/OFS/ObjectManager.py, line 298, in manage_afterAdd (Object: PlugInBase) File lib/python/Products/ZPatterns/PlugIns.py, line 211, in manage_afterAdd (Object: Transactional) File lib/python/OFS/ObjectManager.py, line 298, in manage_afterAdd (Object: Transactional) File lib/python/Products/ZPatterns/PlugIns.py, line 64, in manage_afterAdd (Object: PlugInBase) File lib/python/Products/ZPatterns/PlugIns.py, line 120, in _addPlugIn (Object: Transactional) File lib/python/Products/ZPatterns/PlugIns.py, line 168, in manage_refreshPlugIns (Object: Transactional) File lib/python/Products/ZPatterns/PlugIns.py, line 332, in manage_refreshPlugIns File lib/python/Products/ZPatterns/Providers.py, line 101, in _PlugInsChanged File lib/python/Products/ZPatterns/Providers.py, line 178, in namesForRegistration (Object: PlugInBase) TypeError: (see above) I'll start to look into this. Any advice would be most welcome. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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 )
Re: [Zope-dev] is INSTANCE_HOME broken on Win32?
From: Chris Withers <[EMAIL PROTECTED]> > I'm trying to make Squishdot work with INSTANCE_HOME nicely. > However, the testing is going wrong on a normal Win32 Install... > > I had lots of lines that went something like: > > f=open('%s/Products/%s.dtml' % (SOFTWARE_HOME,file)) > > Which generates: > > E:\Zope\2.2.0\lib\python/Products/Squishdot/validArticle.dtml > > That's not very nice in itself but seems to work with Python's open... > > However, when I change them all to be like, for example: > >f=open('%s/Products/%s.dtml' % (INSTANCE_HOME,file)) > > I then get: > > 'E:\\Zope\\2.2.0/Products/Squishdot/validArticle.dtml' This looks correct to me. If no explicit INSTANCE_HOME is set, it defaults to SOFTWARE_HOME minus '/lib/python'. On the other hand, I wonder why you're constructing '%s/Products/' paths explicitly like this. If this code is inside the Product to which you would like the path, the proper way to get the path is: from Globals import package_home path = package_home(globals()) # path now probably equals 'E:\\Zope\\2.2.0\\lib\\python\\Products\\Squishdot' in your example. I have no idea if or where this is documented, sadly. I'll definitely put it in my 'writing INSTANCE_HOME-friendly Products' howto, as soon as I get around to writing such a thing :-/ Or perhaps you could? ;-) Cheers, Evan @ digicool & 4-am ___ 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] User Info Folder Product Released
Hi all, I just released a Zope product, but since I'm a Zope newbie I'm still wondering whether there is something fundamentally wrong with my idea or not. Could someone check that thing and tell me whether I'm completely off base ? I'm pretty sure there would be a way to solve the same problem using ZPatterns, but I'm still at the very beginning of the learning curve, so I'd rather do with something without too many dependencies. Anyway, here's the product's blurb: User Info Folders maintain a collection of ZClasses synchronized with a user folder. You can specify the name of the product and the name of the ZClass in this product. The User Info Folder will then automatically maintain one instance of the specified ZClass for each user in the "nearest" User Folder in the hierarchy (the acquired 'acl_users' object). This can be very useful if you want to create ZClasses representing user-specific information: an instance of this ZClass will be automatically maintained by the User Info Folder for each user, allowing it to be referenced by URLs. The URL for the product is http://www.zope.org/Members/did/UserInfoFolder Thanks for your feedback, Didier -- Didier Frick Freelance Software Developer & Consultant http://www.dfr.ch/ ___ 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 )
Re: [Zope-dev] PATH_TRANSLATED delimted with backslash ?
Steve Alexander writes: > > When I look at the DTML Document through the web, the "self" object > passed to the breadcrumbs external method is the folder that contains > the DTML Document. > (I thought that should only be the case for DTML Methods!) I expect, it is the folder containing the external method, too. Therefore, you get this folder as "self". You can provide the "self" explicitly in your call: )"> Dieter ___ 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 )
Re: [Zope-dev] PATH_TRANSLATED delimted with backslash ?
Dieter Maurer wrote: > > Steve Alexander writes: > > > > When I look at the DTML Document through the web, the "self" object > > passed to the breadcrumbs external method is the folder that contains > > the DTML Document. > > (I thought that should only be the case for DTML Methods!) > I expect, it is the folder containing the external method, too. > Therefore, you get this folder as "self". > > You can provide the "self" explicitly in your call: > > )"> Thanks for the comment Dieter. I'm just using . There are no further parameters. Therefore, the magic of should supply the appropriate this() argument. The external method works for other objects elsewhere in the heirarchy -- the self argument of the external method is getting set correctly in general. Just, not for this DTML Document. Any other ideas? I have a workable workaround, so I'm not sufficiently motivated to dive into the code just yet :-) -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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] Bug in OFS/Traversable.py
The unrestrictedTraverse method creates a fake REQUEST "object" (really a dictionary) and sends this to a __bobo_traverse__. If this __bobo_traverse__ uses the object properties of the REQUEST object, or needs the real REQUEST object it will fail. If __bobo_traverse__ raises an exception while being called from the unrestrictedTraverse method, which may easily happen if the author of the __bobo_traverse__ method expected a real REQUEST object, unrestrictedTraverse just raises the Unauthorized exception. This is extremely confusing. I would much appreciate that the _real_ REQUEST object was sent to my __bobo_traverse__, and that the exception propagated is a little more informative. I have worked around this problem like this, def __bobo_traverse__(self, REQUEST, name): if type(REQUEST) == type({}): # do something else: # do what I really wanted to do but would appreciate if the problem did not exist :-) -- Regards David. ___ 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] Back from the dead & xmlc
Zope Devers, THis is going to seem strange coming from someone who hasn't been on the list in a long time, but I was at the Linux Expo in San Jose, and sat in on a Web app talk. Lutris was in charge of the panel, and they talked about xmlc. I went to their booth and asked about it. I think it could be the best way to get hard-core python people to jump on zope's band-wagon, and stop the dtml frowning. If you who are in the know about zope have time, please read a quick bit on what it is. http://xmlc.enhydra.org Especially the tutorial: http://staff.plugged.net.au/dwood/xmlc/index.html Is there any obvious reason why Zope wouldn't benefit tremendously from this design and programming separation and pure python boost? All my best, Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ 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] Custom dtml tag
Im playing with a custom dtml-tag along the lines of constructs a url to a catalog query. It works fine, I would just like to extend it a bit and for this I would need to get to the calling object. For example, there will be a different query depending upon the object the dtml-query tag is contained in. Does this make sense, does anyone know the answer? Thanks in advance. -- Andy McKay, Developer. ActiveState. ___ 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 )