[Zope-Annce] Zope Debugger 0.8.1 Released!
This release adds support for both Zope 2.7 and Zope 2.8. Zope Debugger is an enhanced version of pdb for use with Zope. It can be used simply by inserting the following lines in any python code you'd like to debug, including Script (Python)'s and FSPythonScripts: from Products.zdb import set_trace set_trace() It requires no changes to Zope, CMF or Plone or any funky interaction with any specific kind of editing software. All you really need to do is insert the snippet above and make sure your Zope instance is running in foreground mode. For more information, please see: http://www.simplistix.co.uk/software/zope/zdb cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Announce maillist - Zope-Announce@zope.org http://mail.zope.org/mailman/listinfo/zope-announce Zope-Announce for Announcements only - no discussions (Related lists - Users: http://mail.zope.org/mailman/listinfo/zope Developers: http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/ZRPythonExpr.py Forward port fix for Collector #1914.
Log message for revision 39045: Forward port fix for Collector #1914. Changed: U Zope/trunk/lib/python/Products/PageTemplates/ZRPythonExpr.py -=- Modified: Zope/trunk/lib/python/Products/PageTemplates/ZRPythonExpr.py === --- Zope/trunk/lib/python/Products/PageTemplates/ZRPythonExpr.py 2005-10-11 15:19:18 UTC (rev 39044) +++ Zope/trunk/lib/python/Products/PageTemplates/ZRPythonExpr.py 2005-10-11 15:36:27 UTC (rev 39045) @@ -62,8 +62,11 @@ def call_with_ns(f, ns, arg=1): td = Rtd() -td.this = ns['here'] -td._push(ns['request']) +# prefer 'context' to 'here'; fall back to 'None' +this = ns.get('context', ns.get('here')) +td.this = this +request = ns.get('request', {}) +td._push(request) td._push(InstanceDict(td.this, td)) td._push(ns) try: ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/tests/testZRPythonExpr.py Forward port fix for Collector #1914 (omitted test).
Log message for revision 39046: Forward port fix for Collector #1914 (omitted test). Changed: A Zope/trunk/lib/python/Products/PageTemplates/tests/testZRPythonExpr.py -=- Added: Zope/trunk/lib/python/Products/PageTemplates/tests/testZRPythonExpr.py === --- Zope/trunk/lib/python/Products/PageTemplates/tests/testZRPythonExpr.py 2005-10-11 15:36:27 UTC (rev 39045) +++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZRPythonExpr.py 2005-10-11 15:37:04 UTC (rev 39046) @@ -0,0 +1,48 @@ + Unit tests for Products.PageTemplates.ZRPythonExpr + +$Id + +import unittest + +class MiscTests(unittest.TestCase): + +def test_call_with_ns_prefer_context_to_here(self): +from Products.PageTemplates.ZRPythonExpr import call_with_ns +context = ['context'] +here = ['here'] +request = {'request': 1} +names = {'context' : context, 'here': here, 'request' : request} +result = call_with_ns(lambda td: td.this, names) +self.failUnless(result is context, result) + +def test_call_with_ns_no_context_or_here(self): +from Products.PageTemplates.ZRPythonExpr import call_with_ns +request = {'request': 1} +names = {'request' : request} +result = call_with_ns(lambda td: td.this, names) +self.failUnless(result is None, result) + +def test_call_with_ns_no_request(self): +from Products.PageTemplates.ZRPythonExpr import call_with_ns +context = ['context'] +here = ['here'] +names = {'context' : context, 'here': here} + +def _find_request(td): +ns = td._pop() # peel off 'ns' +instance_dict = td._pop() # peel off InstanceDict +request = td._pop() +td._push(request) +td._push(instance_dict) +td._push(ns) +return request + +result = call_with_ns(_find_request, names) +self.assertEqual(result, {}) + +def test_suite(): +return unittest.makeSuite(MiscTests) + +if __name__ == '__main__': +unittest.main(defaultTest='test_suite') + ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Coders] Zope tests: 8 OK
Summary of messages to the zope-tests list. Period Mon Oct 10 11:01:02 2005 UTC to Tue Oct 11 11:01:02 2005 UTC. There were 8 messages: 8 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:22:51 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003295.html Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:24:21 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003296.html Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:25:51 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003297.html Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:27:21 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003298.html Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:28:51 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003299.html Subject: OK : Zope-2_8-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:30:21 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003300.html Subject: OK : Zope-trunk Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:31:52 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003301.html Subject: OK : Zope-trunk Python-2.4.1 : Linux From: Zope Unit Tests Date: Mon Oct 10 22:33:22 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003302.html ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
Re: [Zope-dev] Allowing python logging from restricted code
Hi Jim, Jim Fulton wrote: I think you need to be very careful with this. What's the concern? I'm, at most, planning on making the getLogger function and the top level logging constants (eg: logging.INFO, etc) available... IMO, this is something that should not be turned on by default. OTOH, I have no problem with making this possible to turn on. zope.conf option? Also, do you have any comment on the second half of my proposal, which was to do with making it possible to define more than just event and access logs in zope.conf? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org 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: [Zope-Checkins] SVN: Zope/trunk/lib/python/Shared/DC/ZRDB/ Collector #556: sqlvar now returns 'null' rather than 'None'.
Andreas Jung wrote: IMO there is no need to ship the Zope core with *any* DB package except the ZODB. I dunno, it's very handy to be able to rely on something RDB-like being installed when you want to tests things like ZSQL methods... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Allowing python logging from restricted code
We are currently finishing up a debug_log much like the error log that Python scripts can write too. We would happily make that source available if you think it will fit the bill. Cheers, Tim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Withers Sent: Tuesday, October 11, 2005 2:50 AM To: [EMAIL PROTECTED] Cc: zope-dev Subject: Re: [Zope-dev] Allowing python logging from restricted code Hi Jim, Jim Fulton wrote: I think you need to be very careful with this. What's the concern? I'm, at most, planning on making the getLogger function and the top level logging constants (eg: logging.INFO, etc) available... IMO, this is something that should not be turned on by default. OTOH, I have no problem with making this possible to turn on. zope.conf option? Also, do you have any comment on the second half of my proposal, which was to do with making it possible to define more than just event and access logs in zope.conf? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org 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 - Zope-Dev@zope.org 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] Re: RestrictedPython, TALES Expressions and CMF
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sidnei da Silva wrote: (sorry for the cross-post) I'm currently facing an issue that seems to be a result of a bad interaction between CMF, TALES and Restricted Python. The issue currently happens when: 1. A TALES 'Path Expression' in 'Caching Policy Manager' is evaluated 2. The result of evaluating a sub-expression is a Python Script (eg: object/modified where 'modified' is a Python Script) 3. The context as built by CMF doessn't define 'here' What happens in this case is that the call will end up in PageTemplates/ZRPythonExpr.py:call_with_ns, which is reproduced here for your pleasure: def call_with_ns(f, ns, arg=1): td = Rtd() td.this = ns['here'] td._push(ns['request']) td._push(InstanceDict(td.this, td)) td._push(ns) try: if arg==2: return f(None, td) else: return f(td) finally: td._pop(3) 'call_with_ns' should be invoked only for objects with either a '__render_with_namespace__' attribute (PythonScripts fit here) or those with 'isDocTemp' true. Its only real purpose is to set up the namespace before calling a DTMLMethod; I don't even understand why PythonScripts have such a method. I'm guessing that you get to this point via CMFCore.Expression's __call__ method, which calls a compiled path expression. Now, given that there has been a decision of deprecating 'here' in favor of 'context', I'm not exactly sure about the fix. CMF seems to create expression contexts in two places off the top of my head: In 'CMFCore/Expression.py' and 'CMFCore/CachingPolicyManager.py'. None of those define 'here' or 'context' but instead just 'object'. In 'Products/PageTemplates/TALES.py', in the 'translate' function, 'here' is also hardcoded, but that should be less of an issue as code reaching into that function *should* have a proper expression context. 'here' is *never* the proper key to expect; I would class that a bug. The question then is, which code is wrong? PageTemplates for relying on 'here' being defined, or CMF for not defining 'here'? I volunteer to provide a fix with tests as soon as someone clarifies which one needs to be fixed. The 'call_with_ns' bit is *definitely* the wrong code path for PythonScripts, which should be simple callables (I think). I think PythonScripts get their '__render_with_namespace__' attribute by way of 'Shared.DC.Script.Bindings', which is only in order to support a really *goofy* use case (being able to get at the DTML '_' namespace when it is bound). I would be willing to bet that *nobody* does this who actually needs it. If we *must* go through that path, then the 'call_with_ns' code needs to be hardened two ways: - It should prefer 'context' to 'here' ('here' is deprectated in Zope). - It should be willing to supply 'None' if the 'context'/'here' keys are not present in the namespace. As a reminder, 'actions' as defined by 'portal_actions' tool and anything that derives from 'ActionProviderBase' suffer from the same issue. We could work around the issue in the CMF by supplying a (temporary, deprecated) 'here' key in the context we create. The problem with Zope assuming that 'here' or 'context' are mandatory namespace keys is that, in our case, we have multiple candidates for the role, and therefore wish to use unambiguous name. Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDS7bg+gerLs4ltQ4RArczAJ47bJIYNRFb40klCPDJBuuXSgJjgQCgh85v c9al2avb9+rBcqP2GiQIfqw= =uIWu -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: [Zope-CMF] Re: RestrictedPython, TALES Expressions and CMF
On Tue, Oct 11, 2005 at 08:58:08AM -0400, Tres Seaver wrote: | 'call_with_ns' should be invoked only for objects with either a | '__render_with_namespace__' attribute (PythonScripts fit here) or those | with 'isDocTemp' true. Its only real purpose is to set up the namespace | before calling a DTMLMethod; I don't even understand why PythonScripts | have such a method. | | I'm guessing that you get to this point via CMFCore.Expression's | __call__ method, which calls a compiled path expression. That is correct. | Now, given that there has been a decision of deprecating 'here' in | favor of 'context', I'm not exactly sure about the fix. | | CMF seems to create expression contexts in two places off the top of | my head: In 'CMFCore/Expression.py' and | 'CMFCore/CachingPolicyManager.py'. None of those define 'here' or | 'context' but instead just 'object'. | | In 'Products/PageTemplates/TALES.py', in the 'translate' function, | 'here' is also hardcoded, but that should be less of an issue as code | reaching into that function *should* have a proper expression context. | | 'here' is *never* the proper key to expect; I would class that a bug. Bingo. | The question then is, which code is wrong? PageTemplates for relying | on 'here' being defined, or CMF for not defining 'here'? I volunteer | to provide a fix with tests as soon as someone clarifies which one | needs to be fixed. | | The 'call_with_ns' bit is *definitely* the wrong code path for | PythonScripts, which should be simple callables (I think). I think | PythonScripts get their '__render_with_namespace__' attribute by way of | 'Shared.DC.Script.Bindings', which is only in order to support a really | *goofy* use case (being able to get at the DTML '_' namespace when it is | bound). I would be willing to bet that *nobody* does this who actually | needs it. | | If we *must* go through that path, then the 'call_with_ns' code needs | to be hardened two ways: | | - It should prefer 'context' to 'here' ('here' is deprectated in | Zope). | | - It should be willing to supply 'None' if the 'context'/'here' keys | are not present in the namespace. From glancing at the code it looks like this is the right thing to do. I wonder who's the person that gets the last word on that dark corner of Zope. Would that be Fred? | As a reminder, 'actions' as defined by 'portal_actions' tool and | anything that derives from 'ActionProviderBase' suffer from the same | issue. | | We could work around the issue in the CMF by supplying a (temporary, | deprecated) 'here' key in the context we create. The problem with Zope | assuming that 'here' or 'context' are mandatory namespace keys is that, | in our case, we have multiple candidates for the role, and therefore | wish to use unambiguous name. Yeah, I would like to avoid that one, but considering all Zope versions out there have the issue, we might need to provide the temporary fix for a while, to be deprecated in a couple versions. -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com ___ Zope-Dev maillist - Zope-Dev@zope.org 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] fresh install zope3.1.0 (binary installer) on windows
Could we create some docs on 'Newbie: How-to install the recent Zope3.1.0 on windows using the binary installer' provided at zope.org ? At the moment http://dev.zope.org/Zope3/Zope310 is the only available doc. It says 'Installation instructions for both Windows and Un*x/Linux are now available in the top level README.txt file of the distribution. The binary installer is recommended for Windows.' Which means, you need to download the tarball to get to install instructions. Would you like to comment on the questions below ? Questions when using the binary installer on windows: * already installed zope3 versions are recognized by the installer * the user is prompted to uninstall first * user knows where to uninstall * user knows the name of the program to uninstall * installer uninstalls on demand * installer installs and exits * user knows the place of the installation * zope program group is created with contents of the program group * start.bat - startup zope * nt-service - install as a windows service * uninstall * documentation * zope docs * online docs * create a new zope instance * install and start zeo * ...and your questions here I will add your comments to http://zopewiki.org/ZopeOnWindowsInstaller for a quick start. Michael -- http://zope.org/Members/d2m http://planetzope.org ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Allowing python logging from restricted code
Hi Tim, Tim McLaughlin wrote: We are currently finishing up a debug_log much like the error log that Python scripts can write too. We would happily make that source available if you think it will fit the bill. I';d sure be interested in taking a look, but python's logging package is pretty all-inclusive and extremely flexible. All that it needs is some security declarations to make it available from restricted code and the ability to define more than just and event and access log in zope.conf... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org 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] reading zope.config file for ClientStorage
Mika, David P (Research) wrote: from Zope.Startup import options, handlers opts = options.ZopeOptions() opts.configfile='c:\Zope-Instance-Test\etc\zope-with-zeo.conf' opts.load_schema() opts.load_configfile() What does your zope-with-zeo.conf file look like? The schema file that is being used by ZopeOptions is Zope/Startup/zopeschema.xml. This only has a skeleton zodb_db section. It looks like the meat potatoes are in ZODB/component.xml, but I don't see how that is actually pulled in. There will be an import statement in zopeschema.xml cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] proxy role for an external method
Reinoud van Leeuwen wrote: On Mon, Oct 10, 2005 at 07:27:11PM +0200, Andreas Jung wrote: Are you using CMF/Plone? yes. the main part of the function is: for brain in self.portal_catalog(portal_type='User', SearchableText=SearchableText): user = brain.getObject() if user is None: continue results.append(getUserInfo(user)) This works in a pyhton script but not in an external one At this point I'd recommend my SainBrains product: http://www.simplistix.co.uk/software/zope/sanebrains Then, change your user = line to: user = brain._unrestrictedGetObject() cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] Zope security and packing the database
Cameron Beattie wrote: I have created a script based on zope_pack from the Zope book which allows a username and password to be specified when it is called. I wish to create a user specifically for this purpose that only has the ability to pack the ZODB. What permission is ZODB packing protected by? granted the backup role all available permissions. But the user can't login to http://mydomain.com/Control_Panel/Database/main/manage_workspace I don't know what zope_pack looks like, can you show us? What error message do you get? Any tracebacks? cheers, Chris PS: I wouldn't do zodb packing by whacking a url. There's a script that scripts with ZOpe now that opens up a ZEO connection and does the pack that way, that's what I'd do... -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] Re: Presentations Available
Hi Nick, Nick Davis wrote: BTW Both Chris and I come from the UK where complaining about things is a national sport so please no-one take offence. ;-) Nah, the Plone stuff is beyond mere national past time. The excruciating agony it's caused me on a fairly regular basis for a number of years now is what's behind it, and the talk I gave at the Plone conference is merely a more in depth look at why it makes my cry ;-) Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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: Re: ZAjax anyone?
On Mon, 10 Oct 2005 23:28:03 +0800 Bakhtiar A Hamid wrote: we have zope (dtml/script/zsql-method) that do specific calls that spits out results via xmlrpc. on the browser side, we have all these ajax libs - openrico, dojo, mochikits, azax, DataRequestor, jsolait, tim morgan's mini, etc we just need to connect the dots. the ajax lib + our java functions/etc will call dtml/script/sql-method via xmlrpc(builtin) or jasonrpc(with the jsonrpc product) and page will be updated inline(?) not much voodo involved. everything is there already. a simple demo is at http://myzope.kedai.com.my/blogs/kedai/demo/; a script python that just spits out DateTime().pCommon(), and the other, a script python tah calls html file randomly. replace that with anythin we want. zope rox! but i guess we all know that Thanks, this was a nice briefing. I like the demos, and as a single additional comment I would add that for json-rpc I myself too made some (although more crude looking) simple demos, that do not have a live server but that are installable: so that you can start playing with it on your own server and modify any client or server scripts, if you install the demo + jsonserver2 into Zope as two individual products. Downloads: http://www.zope.org/Members/ree/jsonserver2_pkg/ Guide for the demos: http://www.zope.org/Members/ree/jsonserver2_exa -- Balazs Ree ___ 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] Stepper 1.3.0 Released!
Stepper is a framework for scripting and running asynchronous tasks on Zope servers. This is a new release that adds support for Zope 2.8. It also fixes numerous small bugs and adds several minor new features. For more information, please see: http://www.simplistix.co.uk/software/zope/stepper cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] Zope Debugger lets WingDbg fail to connect toclient
Hi Peter, Frey, Peter wrote: sorry, here it is. It is the the WingDbg Product, but you probably will be unable to install/use it as it depends on the WingIDE (at least part of it) to be installed on the server, too. And as WingIDE is not open source, I am not allowed to hand it on. Yeah, I don't need it to run, just wanted to take a look. The patching is a bit worse than I expected, it doesn't look like WinDbg makes any attempt to call back to the original version of the method it's patching, which is a bit sad :-( That said, I'd expect zdb not to work when WinDbg is installed, and not the other way round... I'm CC'ing in a support address I found for Wing-IDE in the hope that one of those guys will contact me. I believe zdb replaces a lot of the code they currently have in WingDbg, hopefully I can persuade them to use zdb instead, then everyone can be happy ;-) cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] Re: Re: ZAjax anyone?
Ah even better! Thanks guys. I was going to reply just to mention I have a not as cool way of using Zope with Ajax at my site now too. www.zajax.net Seems every rock I turn over, I find 3 others worth investigating. Lots of cool stuff going on out there. I put up my own demo, but it's not nearly the prefered way of doing things by most people. I myself, prefer DTML over ZPT, so my demo is based on that. I also am using one of the larger client frameworks available, Dojo Toolkit. The js file is around 130k if I remember. The smaller ones are great and do the job, but I wanted something larger and more widely used like Dojo to build off of. I know eventually I'll look at the JSON stuff too. Sound interesting. GregOn 10/11/05, Balazs Ree [EMAIL PROTECTED] wrote: On Mon, 10 Oct 2005 23:28:03 +0800 Bakhtiar A Hamid wrote: we have zope (dtml/script/zsql-method) that do specific calls that spits out results via xmlrpc. on the browser side, we have all these ajax libs - openrico, dojo, mochikits, azax, DataRequestor, jsolait, tim morgan's mini, etc we just need to connect the dots. the ajax lib + our java functions/etc will call dtml/script/sql-method via xmlrpc(builtin) or jasonrpc(with the jsonrpc product) and page will be updated inline(?) not much voodo involved. everything is there already. a simple demo is at http://myzope.kedai.com.my/blogs/kedai/demo/; a script python that just spits out DateTime().pCommon(), and the other, a script python tah calls html file randomly. replace that with anythin we want. zope rox! but i guess we all know thatThanks, this was a nice briefing.I like the demos, and as a single additional comment I would add that forjson-rpc I myself too made some (although more crude looking) simple demos, that do not have a live server but that are installable: so thatyou can start playing with it on your own server and modify any client orserver scripts, if you install the demo + jsonserver2 into Zope as two individual products.Downloads:http://www.zope.org/Members/ree/jsonserver2_pkg/Guide for the demos: http://www.zope.org/Members/ree/jsonserver2_exa--Balazs Ree___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 )-- Greg Fischer1st Byte Solutions http://www.1stbyte.com ___ 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] Zope Debugger 0.8.1 Released!
This release adds support for both Zope 2.7 and Zope 2.8. Zope Debugger is an enhanced version of pdb for use with Zope. It can be used simply by inserting the following lines in any python code you'd like to debug, including Script (Python)'s and FSPythonScripts: from Products.zdb import set_trace set_trace() It requires no changes to Zope, CMF or Plone or any funky interaction with any specific kind of editing software. All you really need to do is insert the snippet above and make sure your Zope instance is running in foreground mode. For more information, please see: http://www.simplistix.co.uk/software/zope/zdb cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] How to create a file and send it by e-mail ?
Hello all, I'm developing using ZPT and I need to create a file (CSV format) but I'm having some problems: * 1. *I only know how to create files with python but I get an *Error Type: NameError* *Error Value: global name 'file' is not defined. * I think ZOPE doe's not allow python to create files for security reasons. Can I change this security policy or it will make my application unsafe? Is there another way to create a file using ZOPE API calls ? * 2.*When I create my file how can I send it as an attachment by mail ? (I already have setup my mail host object and I can send mail's successfully.) thanks for your time.. * * ___ 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] How to create a file and send it by e-mail ?
Nicolas Georgakopoulos schrieb: Hello all, I'm developing using ZPT and I need to create a file (CSV format) but I'm having some problems: * 1. *I only know how to create files with python but I get an *Error Type: NameError* *Error Value: global name 'file' is not defined. While I wonder how do you create a file in python using file? * I think ZOPE doe's not allow python to create files for security reasons. Can I change this security policy or it will make my application unsafe? Is there another way to create a file using ZOPE API calls ? You dont need a real (filesystem-) file if all you want is sending it over the net. Usually you just build a string - for example in python scripts via print/return printed or as a list which you join. * 2.*When I create my file how can I send it as an attachment by mail ? (I already have setup my mail host object and I can send mail's successfully.) This is a bit more difficult, there are examples to send mails with attachments per DTML, but if you want to avoid you either open the python email package for python scripts or use ChrisWs product (but I did not have the time to test it - so try it :-) Regards Tino ___ 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] Re: Re: ZAjax anyone?
Greg Fischer wrote: Ah even better! Thanks guys. I was going to reply just to mention I have a not as cool way of using Zope with Ajax at my site now too. www.zajax.net http://www.zajax.net/ Seems every rock I turn over, I find 3 others worth investigating. Lots of cool stuff going on out there. I put up my own demo, but it's not nearly the prefered way of doing things by most people. I myself, prefer DTML over ZPT, so my demo is based on that. I also am using one of the larger client frameworks available, Dojo Toolkit. The js file is around 130k if I remember. The smaller ones are great and do the job, but I wanted something larger and more widely used like Dojo to build off of. I know eventually I'll look at the JSON stuff too. Sound interesting. Hi, Greg Cool! I like the way you do the how-to. Do you plan similar how-tos for other JS libraries/techniques? Would you accept contributions? I find myself looking at mochikit (http://mochikit.com) occasionally. In its ajax-tables demo, it uses a tal(esque) syntax for dom manipulation in client javascript, which could be interesting for fans of page templates. For the future, dare I ask, maybe some zope3 stuff? I think the zope community really needs zope-oriented how-tos and evaluations of the various AJAX libraries. zajax.net has the right name to be a prime focus of such activities, should you be willing to do that. Thanks! -Jim Washington ___ 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: proxy role for an external method
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jens Vagelpohl wrote: On 10 Oct 2005, at 23:14, Peter Bengtsson wrote: I understood that Plone does some extra magic, so I have to setup a securoty context... I'll post it here if I have a working solution Shouldn't really be the problem. Isn't portal_catalog just another ZCatalog that has nothing to do with Plone except it's located inside a Plone instance. It *is* a problem. The reason is most likiely all the extra stuff the catalog tool adds to the query before it reaches the actual catalog. The workaround is something like this: from Products.ZCatalog.ZCatalog import ZCatalog results = ZCatalog.searchResults(portal_catalog, **kws) That way you circumvent any query munging done in the catalog tool searchResults method, specifically the effective/expires and allowedRolesAndUsers filtering. CMF's CatalogTool grep an 'unrestrictedSearchResults' method which does exactly that -- it can only be called from trusted code, but an ExternalMethod certainly qualifies. Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDS7f5+gerLs4ltQ4RAhkSAKC7zy58wb+UmoiFb0e5fhCRB9SjSgCgzkRK qIGTnVO1neNoaAD1hr9T/Og= =T5H3 -END 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] How to show the DTML Method's results within Plone?
Hello again... i have a DTML Method like you can see bellow that produces a table after quring some table (using python GetHeader and GetData custom modules) But the result is a table with the query results in another page. I would like to show the table with the query results within Plone's enviroment. How can i do this? Thank you very much!!! head META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=ISO-8859-7 script type=text/javascript src=./plone_javascript_variables.js script type=text/javascript src=./plone_javascripts.js /head style type=text/css media=screen!-- @import url(/plone.css); --/style style type=text/css media=screen!-- @import url(/ploneColumns.css); --/style style type=text/css media=all!-- @import url(/ploneCustom.css); --/style dtml-var standard_html_header table id=sortable class=listing summary=Content listing cellpadding=0 cellspacing=0 thead dtml-in expr=GetHeader(sysDSN=sysDSN, usr=usr, mypass=mypass, sTable=sTable, sFields=sFields) th dtml-in sequence-item nbsp;dtml-var sequence-itemnbsp; /dtml-in /th /dtml-in /thead tbody dtml-in expr=GetData(sysDSN=sysDSN, usr=usr, mypass=mypass, sTable=sTable, sFields=sFields) dtml-if sequence-even tr class=even dtml-else tr class=odd /dtml-if dtml-in sequence-item tddtml-var sequence-item/td /dtml-in /tr /dtml-in /tbody /table dtml-var standard_html_footer ___ Χρησιμοποιείτε Yahoo!; Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr ___ 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] reading zope.config file for ClientStorage
OK, the opts object really did have everything loaded. On careful inspection the opts.configroot has an attribute databases with a list of Zope.Startup.datatypes.ZopeDatabase instances. I can do what I originally set out to do which was to open a ZEO.ClientStorage configured from the zope-with-zeo.conf file (the ZEO.ClientStorage is now wrapped in a ZEOClient object): from Zope.Startup import options, handlers opts = options.ZopeOptions() opts.configfile='c:\Zope-Instance-Test\etc\zope-with-zeo.conf' opts.load_schema() opts.load_configfile() for db in opts.configroot.databases: if is instance(db.config.storage, ZODB.config.ZEOClient): db.config.storage.open() What does your zope-with-zeo.conf file look like? My zope-with-zeo.conf file is pretty standard except for a designation to use a zeoclient. I've also included a username and password as my zeo server is using digest authentication: zodb_db main mount-point / zeoclient server localhost:8090 storage 1 name zeostorage var $INSTANCE/var username metalfor password my_zeo_cleartext_password /zeoclient /zodb_db Thanks much! Dave Mika ___ 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 MailTemplates 1.0.0
I installed the MailTemplates product to Zope and try to run the example from the readme file: -- Simple Example This example sends a simple templated mail to a specific address. Add the following to a Mail Template called my_mt: tal:body xmlns:tal=http://xml.zope.org/namespaces/tal; xmlns:metal=http://xml.zope.org/namespaces/metal; Dear tal:x replace=options/mto/, tal:x replace=user/getId/ would like to thank you for your interest in: a href= tal:define=url root/absolute_url tal:attributes=href url tal:content=url/ tal:x replace=option/message/ cheers, The Web Team /tal:body Now add a Script (Python) in the same folder containing the following: container.my_mt( mfrom='[EMAIL PROTECTED]', mto='[EMAIL PROTECTED]', message='This is a test!' ) return 'Mail Sent!' -- I cant make it work, when I try to test the python script I get a page like this : h2Site Error/h2 pAn error was encountered while publishing this resource. /p p strongError Type: KeyError/strongbr/ strongError Value: u'option'/strongbr/ /p can anyone give me a clue ? ___ 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] How to show the DTML Method's results within Plone?
Try https://lists.sourceforge.net/lists/listinfo/plone-users 2005/10/11, Thomas Apostolou [EMAIL PROTECTED]: Hello again... i have a DTML Method like you can see bellow that produces a table after quring some table (using python GetHeader and GetData custom modules) But the result is a table with the query results in another page. I would like to show the table with the query results within Plone's enviroment. How can i do this? Thank you very much!!! head META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=ISO-8859-7 script type=text/javascript src=./plone_javascript_variables.js script type=text/javascript src=./plone_javascripts.js /head style type=text/css media=screen!-- @import url(/plone.css); --/style style type=text/css media=screen!-- @import url(/ploneColumns.css); --/style style type=text/css media=all!-- @import url(/ploneCustom.css); --/style dtml-var standard_html_header table id=sortable class=listing summary=Content listing cellpadding=0 cellspacing=0 thead dtml-in expr=GetHeader(sysDSN=sysDSN, usr=usr, mypass=mypass, sTable=sTable, sFields=sFields) th dtml-in sequence-item dtml-var sequence-item /dtml-in /th /dtml-in /thead tbody dtml-in expr=GetData(sysDSN=sysDSN, usr=usr, mypass=mypass, sTable=sTable, sFields=sFields) dtml-if sequence-even tr class=even dtml-else tr class=odd /dtml-if dtml-in sequence-item tddtml-var sequence-item/td /dtml-in /tr /dtml-in /tbody /table dtml-var standard_html_footer ___ Χρησιμοποιείτε Yahoo!; Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr ___ 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 ) -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ 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] help with MailTemplates 1.0.0
Nicolas Georgakopoulos wrote: I installed the MailTemplates product to Zope and try to run the example from the readme file: -- Simple Example This example sends a simple templated mail to a specific address. Add the following to a Mail Template called my_mt: tal:body xmlns:tal=http://xml.zope.org/namespaces/tal; xmlns:metal=http://xml.zope.org/namespaces/metal; Dear tal:x replace=options/mto/, tal:x replace=user/getId/ would like to thank you for your interest in: a href= tal:define=url root/absolute_url tal:attributes=href url tal:content=url/ tal:x replace=option/message/ d'oh, that's a typo ;-) tal:x replace=options/message/ I'll go and correct that in svn now :-) cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] help with MailTemplates 1.0.0
(for the 2nd time, please keep this on the list...) (just for the light on thinking, that means hit reply all or make sure zope@zope.org is in the cc list) Nicolas Georgakopoulos wrote: Your documentation have anothe problem , you forgot to set a subject in your example :( Oh dear, yes, I remember, I recently made subject required :-S I'll have to fix that soon... After I set a subject it say's : strongError Type: AttributeError/strongbr/ strongError Value: 'str' object has no attribute '_send'/strongbr/ I don't know how to setup the _send attribute Yes, and? Where's the rest of the traceback? I can't help you without it.. cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] help with MailTemplates 1.0.0
(sheesh, what is it with people, is 'reply all' that hard to find? ;-) Tino Wildenhain wrote: tal:x replace=options/message/ *yuck* tal to render plain text. Now thats ugly ;) Suggest something better... I find it convenient, especially for generating html mail, which customer have a habit of liking ;-) On the development front, the fewer languages anyone needs to know to do development, the better. TAL/TALES works just as well here... Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] help with MailTemplates 1.0.0
Chris Withers wrote: (for the 2nd time, please keep this on the list...) (just for the light on thinking, that means hit reply all or make sure zope@zope.org is in the cc list) Sorry for that , it was on purpose.. I'm new to Zope and thought that it wasn't right to bother the rest of the list with my beginner problem... Nicolas Georgakopoulos wrote: Your documentation have anothe problem , you forgot to set a subject in your example :( Oh dear, yes, I remember, I recently made subject required :-S I'll have to fix that soon... After I set a subject it say's : strongError Type: AttributeError/strongbr/ strongError Value: 'str' object has no attribute '_send'/strongbr/ I don't know how to setup the _send attribute Yes, and? Where's the rest of the traceback? I can't help you without it.. cheers, Chris Traceback (innermost last): Module ZPublisher.Publish, line 113, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Products.PythonScripts.PythonScript, line 323, in _exec Module None, line 1, in mailAction.py - PythonScript at /testFordelete/mailAction.py - Line 1 Module Products.MailTemplates.BaseMailTemplate, line 117, in send Module Products.MailTemplates.BaseMailTemplate, line 107, in _send AttributeError: 'str' object has no attribute '_send' Thank's for your help, looking forward to test your product tomorrow ;) (don't have more time for today) ___ 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] How to create a file and send it by e-mail ?
(yet again, please CC zope@zope.org in replies..) Nicolas Georgakopoulos wrote: I think I need it... I don't ;-) I have made a web page (ZPT) that a user answer's to a questionnaire , most of the answers are provided by check boxes and radio buttons. When the user submit the answers a mail is send with the answers by text in a string format like coma separated values. You have a python script to do this, right? The problem is that my client request to get the answer by mail with a file as an attachment so he can analyze the data with a statistical program SPSS. Can this be done with Zope File Object ? (I don't think it can... ) You don't need a file object. Build the thing you want to send as a string called data, and have a string variable called filename containing the name you want to use for the attachment. Then you need create a MIMEBase object for it: # some imports from email.MIMEBase import MIMEBase from email import Encoders # now create the attachment msg = MIMEBase(maintype, subtype) msg.set_payload(data) Encoders.encode_base64(msg) msg.add_header('Content-Disposition', 'attachment', filename=filename) # now render the MailTemplate wrapper = context.my_mail_template.as_message( # insert params here ) # finally, attach the file and send wrapper.attach(msg) wrapper.send() You may also be interested in something I will likely add for the 1.1.0 release: https://secure.simplistix.co.uk/support/issue180 cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] help with MailTemplates 1.0.0
Nicolas Georgakopoulos wrote: Sorry for that , it was on purpose.. I'm new to Zope and thought that it wasn't right to bother the rest of the list with my beginner problem... The opposite is true.. by keeping this on the list, not only can other people help out, but other people can learn, and this becomes a resource for others once archived by google and gmane ;-) Module Products.MailTemplates.BaseMailTemplate, line 117, in send Module Products.MailTemplates.BaseMailTemplate, line 107, in _send AttributeError: 'str' object has no attribute '_send' Hmmm, what have you selected in the MailHost drop-down on the Mail Template's edit page? Whatever you have selected is resolving to a string instead of a MailHost object :-S cheers, Chris PS: What Zope version are you using? -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] help with MailTemplates 1.0.0
Chris Withers wrote: Nicolas Georgakopoulos wrote: Sorry for that , it was on purpose.. I'm new to Zope and thought that it wasn't right to bother the rest of the list with my beginner problem... The opposite is true.. by keeping this on the list, not only can other people help out, but other people can learn, and this becomes a resource for others once archived by google and gmane ;-) Module Products.MailTemplates.BaseMailTemplate, line 117, in send Module Products.MailTemplates.BaseMailTemplate, line 107, in _send AttributeError: 'str' object has no attribute '_send' Hmmm, what have you selected in the MailHost drop-down on the Mail Template's edit page? Whatever you have selected is resolving to a string instead of a MailHost object :-S I have selected a Zope mailhost object cheers, Chris PS: What Zope version are you using? Zope-2.8.1-final ___ 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] Error Type: ExpatError
Hi all I try to read an xml file using from xml.dom.minidom import parseString It works fine but when I push the reload button raise these error Error Type: ExpatError Error Value: no element found: line 1, column 0 These error is intermittence These is the trace back any idea? Traceback (innermost last): Module ZPublisher.Publish, line 113, in publish 111 | missing_name, 112 | dont_publish_class, 113| request, bind=1) 114 | 115 |if result is not response: Module ZPublisher.mapply, line 88, in mapply 086 | 087 |args=tuple(args) 088|if debug is not None: return debug(object,args,context) 089 |else: return object(*args) Module ZPublisher.Publish, line 40, in call_object 038 | 039 |def call_object(object, args, request): 040|result=apply(object,args) # Type scr to step into published object. 041 |return result 042 | Module Shared.DC.Scripts.Bindings, line 311, in __call__ 309 |def __call__(self, *args, **kw): 310 |'''Calls the script.''' 311|return self._bindAndExec(args, kw, None) 312 | 313 |def __render_with_namespace__(self, namespace): Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec 346 |exec bindcode 347 |bound_data = bound_data[0] 348|return self._exec(bound_data, args, kw) 349 |finally: 350 |security.removeContext(self) Module Products.PythonScripts.PythonScript, line 323, in _exec 321 |f = new.function(fcode, g, None, fadefs) 322 | 323|result = f(*args, **kw) 324 |if keyset is not None: 325 |# Store the result in the cache. Module None, line 9, in Lanzar - ComandoYanged at /SitiosYanged/Huete/Web/Lanzar - Line 9 006 |if 'Camino' not in args: args['Camino'] = traverse_subpath 007 |if 'Usuario' not in args: args['Usuario'] = str(context.Dame('usuario')) 008|args = context.ObtenerNodo(args) 009 | 010 |if args is None: Module Products.Yanged.SitioYanged, line 268, in ObtenerNodo 266 | 267 | if 'NodoRaiz' not in args: 268|args['NodoRaiz'] = parseString(self.Dame({'nombre': self.getId() + '.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE)) 269 | if 'Nodos' not in args: args['Nodos'] = args['NodoRaiz'].childNodes 270 | if 'Nivel' not in args: args['Nivel'] = 0 Module xml.dom.minidom, line 1929, in parseString 1927 |if parser is None: 1928 |from xml.dom import expatbuilder 1929|return expatbuilder.parseString(string) 1930 |else: 1931 |from xml.dom import pulldom Module xml.dom.expatbuilder, line 940, in parseString 938 |else: 939 |builder = ExpatBuilder() 940|return builder.parseString(string) 941 | 942 | Module xml.dom.expatbuilder, line 223, in parseString 221 |parser = self.getParser() 222 |try: 223|parser.Parse(string, True) 224 |self._setup_subset(string) 225 |except ParseEscape: ExpatError: no element found: line 1, column 0 Thanks! -- Mis Cosas http://blogs.sistes.net/Garito/ ___ 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] help with MailTemplates 1.0.0
Nicolas Georgakopoulos wrote: Whatever you have selected is resolving to a string instead of a MailHost object :-S I have selected a Zope mailhost object Please explain exactly what you did, including how you create the MailHost, the Mail Template and the Python Script, in detail... I just tried to reproduce this on a fresh Zope 2.8.1 instance and couldn't... Using the first example, the mail rendered and sent just fine. I'm still far from convinced the thing you think is a MailHost object is actually a MailHost object, did you perhaps delete or rename your MailHost object? Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] Re: Re: ZAjax anyone?
Jim, I am more than happy to take contributions from others. Using other libs or maybe even just some Zope techniques in general is great. Right now, I just loaded that stuff up over the last few days, so it's quite limited. But, if you have anything you would like to share, please zip it up and email it over to me. Just put together all the html for the body, I'll post it for ya, with credit to you of course. I am sure that if I get a bunch of other how-tos to post, I will probably have to grow things a bit, but it will evolve over time. All of this stuff is a learning process for me, so I wanted to put up that site to share my experiences in hopes that others could benefit. Zope 3, I would love to put stuff up for that, but I havent even touched Zope 3 yet. I am more than happy to put of info on that as well. Thanks! GregOn 10/11/05, Jim Washington [EMAIL PROTECTED] wrote: Greg Fischer wrote: Ah even better!Thanks guys. I was going to reply just to mention I have a not as cool way of using Zope with Ajax at my site now too. www.zajax.net http://www.zajax.net/ Seems every rock I turn over, I find 3 others worth investigating. Lots of cool stuff going on out there.I put up my own demo, but it's not nearly the prefered way of doing things by most people.I myself, prefer DTML over ZPT, so my demo is based on that.I also am using one of the larger client frameworks available, Dojo Toolkit.The js file is around 130k if I remember.The smaller ones are great and do the job, but I wanted something larger and more widely used like Dojo to build off of. I know eventually I'll look at the JSON stuff too.Sound interesting. Hi, GregCool!I like the way you do the how-to.Do you plan similar how-tosfor other JS libraries/techniques?Would you accept contributions? Ifind myself looking at mochikit ( http://mochikit.com) occasionally.Inits ajax-tables demo, it uses a tal(esque) syntax for dom manipulationin client _javascript_, which could be interesting for fans of page templates.For the future, dare I ask, maybe some zope3 stuff? I think the zope community really needs zope-oriented how-tos andevaluations of the various AJAX libraries.zajax.net has the right nameto be a prime focus of such activities, should you be willing to do that. Thanks!-Jim Washington-- Greg Fischer1st Byte Solutionshttp://www.1stbyte.com ___ 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] ODBC database adapter for zope2.8.1 on windows
Andreas Jung wrote: google for mxodbc --On 10. Oktober 2005 16:37:45 +0530 Sreekanth S Rameshaiah [EMAIL PROTECTED] wrote: Dear Friends, Is there any good ODBC database adapter for zope2.8.1 on windows? Thanks and Regards, - sree Is there any free ODBC DA? (Not necessary rock-solid-good, rather free.) I didn't find any open source based while searching for one last week. Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ 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] ODBC database adapter for zope2.8.1 on windows
--On 11. Oktober 2005 19:08:53 +0200 Johan Carlsson [EMAIL PROTECTED] wrote: Is there any free ODBC DA? (Not necessary rock-solid-good, rather free.) You can continue searching and trying for free alternative or just spent some bucks for mxODBC..it's worth the money, it just works. Maybe calculate your time you waste have wasted to so far for searching and trying ... -aj pgpdYxtRb3N0z.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] Zope security and packing the database
I have created a script based on zope_pack from the Zope book which allows a username and password to be specified when it is called. I wish to create a user specifically for this purpose that only has the ability to pack the ZODB. What permission is ZODB packing protected by? I don't know. That's part of the problem. I can't see any permissions that allow or disallow this. granted the backup role all available permissions. But the user can't login to http://mydomain.com/Control_Panel/Database/main/manage_workspace I don't know what zope_pack looks like, can you show us? vi zope_pack #!/usr/bin/python import sys, urllib host = sys.argv[1] days = sys.argv[2] user = sys.argv[3] pwd = sys.argv[4] class MyUrlOpener(urllib.FancyURLopener): def prompt_user_passwd(self, host, realm): return (user,pwd) def __init__(self, *args): self.version = Zope Packer urllib.FancyURLopener.__init__(self, *args) def main(): urllib._urlopener = MyUrlOpener() url = %s/Control_Panel/Database/manage_pack?days:float=%s % \ (host, days) try: f = urllib.urlopen(url).read() except IOError: print Cannot open URL %s, aborting % url print Successfully packed ZODB on host %s % host if __name__ == '__main__': main() What error message do you get? If I use a user that has the Owner role it works correctly. If I use the backup user then urllib can't get the url due to no authentication so errors as follows: File /usr/lib/python2.4/urllib.py, line 180, in open return getattr(self, name)(url) File /usr/lib/python2.4/urllib.py, line 305, in open_http return self.http_error(url, fp, errcode, errmsg, headers) File /usr/lib/python2.4/urllib.py, line 318, in http_error result = method(url, fp, errcode, errmsg, headers) File /usr/lib/python2.4/urllib.py, line 615, in http_error_401 return getattr(self,name)(url, realm) File /usr/lib/python2.4/urllib.py, line 628, in retry_http_basic_auth return self.open(newurl) Any tracebacks? Nothing appears in the log. PS: I wouldn't do zodb packing by whacking a url. There's a script that scripts with ZOpe now that opens up a ZEO connection and does the pack that way, that's what I'd do... I don't use ZEO - can I just do the scripted packing bit without all the associated ZEO setup? Regards Cameron ___ 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 )