[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py test for unicode workaround in ZRPythonExpr
Log message for revision 72743: test for unicode workaround in ZRPythonExpr Changed: U Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py -=- Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py === --- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2007-02-21 11:00:37 UTC (rev 72742) +++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2007-02-21 11:36:18 UTC (rev 72743) @@ -132,6 +132,15 @@ self.assertEqual(result.encode('ascii').startswith(ascii_str), True) self.assertEqual(zpt.output_encoding, 'iso-8859-15') +def testPT_RenderUnicodeExpr(self): +# Check workaround for unicode incompatibility of ZRPythonExpr. +# See http://mail.zope.org/pipermail/zope/2007-February/170537.html +manage_addPageTemplate(self.app, 'test', + text='span tal:content=python: unicode(\'\xfe\', \'iso-8859-15\') /', + encoding='iso-8859-15') +zpt = self.app['test'] +result = zpt.pt_render() # should not raise a UnicodeDecodeError + def testPT_RenderWithISO885915(self): manage_addPageTemplate(self.app, 'test', text=iso885915_str, encoding='iso-8859-15') zpt = self.app['test'] ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py test for unicode workaround in ZRPythonExpr
Log message for revision 72744: test for unicode workaround in ZRPythonExpr Changed: U Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py -=- Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2007-02-21 11:36:18 UTC (rev 72743) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2007-02-21 11:37:25 UTC (rev 72744) @@ -132,6 +132,15 @@ self.assertEqual(result.encode('ascii').startswith(ascii_str), True) self.assertEqual(zpt.output_encoding, 'iso-8859-15') +def testPT_RenderUnicodeExpr(self): +# Check workaround for unicode incompatibility of ZRPythonExpr. +# See http://mail.zope.org/pipermail/zope/2007-February/170537.html +manage_addPageTemplate(self.app, 'test', + text='span tal:content=python: unicode(\'\xfe\', \'iso-8859-15\') /', + encoding='iso-8859-15') +zpt = self.app['test'] +result = zpt.pt_render() # should not raise a UnicodeDecodeError + def testPT_RenderWithISO885915(self): manage_addPageTemplate(self.app, 'test', text=iso885915_str, encoding='iso-8859-15') zpt = self.app['test'] ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] Zope Tests: 7 OK
Summary of messages to the zope-tests list. Period Tue Feb 20 12:00:00 2007 UTC to Wed Feb 21 12:00:00 2007 UTC. There were 7 messages: 7 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.6 Python-2.1.3 : Linux From: Zope Unit Tests Date: Tue Feb 20 21:05:43 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007300.html Subject: OK : Zope-2.6 Python-2.3.6 : Linux From: Zope Unit Tests Date: Tue Feb 20 21:07:13 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007301.html Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Tue Feb 20 21:08:43 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007302.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Tue Feb 20 21:10:13 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007303.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Feb 20 21:11:44 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007304.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Feb 20 21:13:14 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007305.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Feb 20 21:14:44 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007306.html ___ 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] strange image error
hi changed from i386 arch to amd64 and it works. same freebsd 6.1. thanks for help, oli On Feb 13, 2007, at 10:08 PM, Dieter Maurer wrote: Oliver Petznick wrote at 2007-2-13 13:16 +0100: aloha zopers. i have a zope2.9 instance installed on a freebsd box - zope is installed out of the ports - python2.4 also. if i request a image bigger than about 100kb from the server it stops loading after some bytes and fires this error (it makes no difference if i use firefox2 or wget..): 2007-02-13T12:12:28 ERROR ZServer uncaptured python exception, closing channel ZServer.HTTPServer.zhttp_channel connected 80.190.201.39:63877 at 0xdc96bec channel#: 28 requests: (socket.error:(1, 'Operation not permitted') [/usr/local/lib/ python2.4/asynchat.py|initiate_send|219] [/usr/local/www/Zope29/lib/ python/ZServer/medusa/http_server.py|send|417] [/usr/local/lib/ python2.4/asyncore.py|send|332]) some hints would be cool Maybe, your operating system log files contain some hints. Apparently, the socket (to be written to) was in a really strange state. -- Dieter ___ 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: problem with input elements and unicode/utf-8
--- In [EMAIL PROTECTED], Daryl Daly [EMAIL PROTECTED] wrote: I have setup a test case which seems to show the problem. This test removes the database component. New install of zope 2.10.2: Zope Version (Zope 2.10.2-final, python 2.4.4, linux2) Python Version 2.4.4 (#1, Oct 23 2006, 13:58:00) [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] System Platform linux2 I created a page template which contains: html tal:define=dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;; charset=utf-8'); head title tal:content=template/titleThe title/title meta http-equiv=content-type content=text/html;charset=utf-8 /head body tal:define=test_str python:u'This is a test \u00e9 \u00ae \u2022 \u2024 \u2219 \u03b2'.encode('utf-8') span tal:content=test_str/span form input name=t1 value= tal:attributes=value test_str /form /body /html When this page is viewed in Firefox (v 1.5.0.9), it shows the characters correctly. When viewed in IE6, the non-ascii characters show as garbage. If I add this to the zope.conf: cgi-environment HTTP_ACCEPT_CHARSET utf-8 /cgi-environment the non-ascii characters show correctly in IE6 (except one of them shows as a box - there is no 'garbage') Is this zope.conf setup required for IE6 or am I doing something wrong? Thanks, Daryl. How about changing the following line 996 in /lib/python/zope/publisher/http.py ( as described in http://www.zope.org/Collectors/Zope/2280 ) header_present = 'HTTP_ACCEPT_CHARSET' in self.request to header_present = 'HTTP_ACCEPT_CHARSET' in self.request.keys() I think this is a bug. After doing that change, IE6 and IE7 behaved consistently. Regards Jost - Need Mail bonding? Go to the Yahoo! Mail QA for great tips from Yahoo! Answers users.___ 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: problem with input elements and unicode/utf-8
--On 21. Februar 2007 02:05:36 -0800 Jostein Leira [EMAIL PROTECTED] wrote: header_present = 'HTTP_ACCEPT_CHARSET' in self.request to header_present = 'HTTP_ACCEPT_CHARSET' in self.request.keys() I assume that the request implementation of Zope 3 and Zope 2 differ a bit when it comes to the 'in' operator. If request.keys() works for Zope 3 request as well I would like to see this fixed in Zope 3. Andreas pgp3NSJhXHeVN.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] Re: problem with input elements and unicode/utf-8
--On 21. Februar 2007 11:30:11 +0100 Andreas Jung [EMAIL PROTECTED] wrote: --On 21. Februar 2007 02:05:36 -0800 Jostein Leira [EMAIL PROTECTED] wrote: header_present = 'HTTP_ACCEPT_CHARSET' in self.request to header_present = 'HTTP_ACCEPT_CHARSET' in self.request.keys() I assume that the request implementation of Zope 3 and Zope 2 differ a bit when it comes to the 'in' operator. If request.keys() works for Zope 3 request as well I would like to see this fixed in Zope 3. After checking the implements and the unittests: I don't see any difference in the behavior of both statements. They behave identical. -aj pgpXfr69GXPtY.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] How to get REST friendly urls from sql database
On Tuesday 20 February 2007 16:37, Andreas Jung wrote: --On 20. Februar 2007 16:30:43 +0100 Gaute Amundsen [EMAIL PROTECTED] wrote: Hi. Normally a url to an article in our CMS system would look roughly like this: http://www.dom.tld/aritcles/25245 Where 25245 would be an object of some metatype, say 'article'. Now what if I wanted to get the data for that page from an sql server instead, I would expect to end up with a url like this: http://www.dom.tld/aritcles/index_html?id=25245 Now, having recently read the Roy Fielding paper, and expecting to do some caching, I would much prefer to have it the first way, even when I have to get the data out of a DB. Anybody have any ideas on how this might be done? How about Apache rewrite rules or a script called index_html that fetches the object by its ID? That's pretty much boring straight-forward stuff :-) -aj I was certain that the index_html way required the ? preceding the arguments to work. Easy enoug to test. Will do. Hm.. but rewrite rules would be better I guess. I was actually considering that solution for something else*, just before posting this.. D'oh! (* the task of having the same objects appear under different urls in different states ) Thanks Gaute ___ 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 get REST friendly urls from sql database
On Tuesday 20 February 2007 17:39, Paul Winkler wrote: snip Another option is that the object at /articles could be an instance of a class that looks something like: class MyArticleContainer(): def __before_publishing_traverse__(self, unused, request): # Save the rest of the path as 'traverse_subpath'. request.set('traverse_subpath', reversed(request['TraversalRequestNameStack'])) # Tell the publisher to stop traversing now. request['TraversalRequestNameStack'][:] = [] def __call__(self, *args, **kw): subpath = self.REQUEST['traverse_subpath'] data = get_data_however_you_like(subpath) return data For background, read the stuff about traversal hooks at http://wiki.zope.org/zope2/ZPublisher Hm.. that looks more like what I had in mind when I posted, but allso quite a bit more overhead than rewriterules. At least for me that has never written a product. I will have to think about that one.. Would you care to elaborate a little bit on what the tradeoffs would be? If I wanted my articles in many variants, ie. a large state space, I guess this way would be good? Gaute ___ 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 call a script by it's name stored in a variable.
- Original Message - From: rieh25 [EMAIL PROTECTED] To: zope@zope.org Sent: Tuesday, February 20, 2007 10:30 PM Subject: [Zope] How to call a script by it's name stored in a variable. How can I do something like this? var = '/Projects/test_py' return call_by_name(var) Another option: if the script you want to call is in the same folder as the calling script then this will work: var = 'test_py' return getattr(context, var)() Jonathan ___ 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: How to get REST friendly urls from sql database
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gaute Amundsen wrote: On Tuesday 20 February 2007 17:39, Paul Winkler wrote: snip Another option is that the object at /articles could be an instance of a class that looks something like: class MyArticleContainer(): def __before_publishing_traverse__(self, unused, request): # Save the rest of the path as 'traverse_subpath'. request.set('traverse_subpath', reversed(request['TraversalRequestNameStack'])) # Tell the publisher to stop traversing now. request['TraversalRequestNameStack'][:] = [] def __call__(self, *args, **kw): subpath = self.REQUEST['traverse_subpath'] data = get_data_however_you_like(subpath) return data For background, read the stuff about traversal hooks at http://wiki.zope.org/zope2/ZPublisher Or you can give 'MyArticleContainer' a '__getitem__' method which returns a non-persistent instance fabricated from the key passed to it (assuming you need only that one bit of information). Tres. - -- === Tres Seaver +1 540-429-0999 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF3F8g+gerLs4ltQ4RAkkgAJ9pTuCKKAOrPSFOUVvrVI9FYhhxOQCg0Cwz JAg6TDKquR2kKhvJoFoIUUE= =OGlZ -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 )
Re: [Zope] How to get REST friendly urls from sql database
On Wed, Feb 21, 2007 at 12:32:30PM +0100, Gaute Amundsen wrote: On Tuesday 20 February 2007 17:39, Paul Winkler wrote: snip Another option is that the object at /articles could be an instance of a class that looks something like: class MyArticleContainer(): def __before_publishing_traverse__(self, unused, request): # Save the rest of the path as 'traverse_subpath'. request.set('traverse_subpath', reversed(request['TraversalRequestNameStack'])) # Tell the publisher to stop traversing now. request['TraversalRequestNameStack'][:] = [] def __call__(self, *args, **kw): subpath = self.REQUEST['traverse_subpath'] data = get_data_however_you_like(subpath) return data For background, read the stuff about traversal hooks at http://wiki.zope.org/zope2/ZPublisher Hm.. that looks more like what I had in mind when I posted, but allso quite a bit more overhead than rewriterules. At least for me that has never written a product. Well, it may feel like a lot of work to you the first time :-) I will have to think about that one.. Would you care to elaborate a little bit on what the tradeoffs would be? My approach might be good if: - the logic for looking up articles is more complex than can be comfortably expressed using apache rewrite rules, and/or - the logic for looking up articles requires state that's internal to zope. You could instead follow Andreas' suggestion and use a through-the-web Script. It might look something like: article_id = traverse_subpath[-1] data = context.get_the_data_somehow(article_id) return data Your URLs would then look like: http://example.com/folder_id/script_id/article_id Note that naming the script index_html doesn't really help, because http://example.com/folder_id/article_id wouldn't invoke the script. -- Paul Winkler http://www.slinkp.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] Re: How to get REST friendly urls from sql database
Surely it should make no difference to caching as they are both GETs? The first is certainly prettier, if you want URLs like that then ZSQL methods should be able to help you (read the online zope book), or roll your own looking at the traverse subpath. Laurence Gaute Amundsen wrote: Hi. Normally a url to an article in our CMS system would look roughly like this: http://www.dom.tld/aritcles/25245 Where 25245 would be an object of some metatype, say 'article'. Now what if I wanted to get the data for that page from an sql server instead, I would expect to end up with a url like this: http://www.dom.tld/aritcles/index_html?id=25245 Now, having recently read the Roy Fielding paper, and expecting to do some caching, I would much prefer to have it the first way, even when I have to get the data out of a DB. Anybody have any ideas on how this might be done? Regards Gaute Amundsen ___ 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 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: problem with input elements and unicode/utf-8
On Wed, February 21, 2007 2:05 am, Jostein Leira wrote: How about changing the following line 996 in /lib/python/zope/publisher/http.py ( as described in http://www.zope.org/Collectors/Zope/2280 ) header_present = 'HTTP_ACCEPT_CHARSET' in self.request to header_present = 'HTTP_ACCEPT_CHARSET' in self.request.keys() I think this is a bug. After doing that change, IE6 and IE7 behaved consistently. After making this change, Firefox behaviour does not change but I get a UnicodeDecodeError in IE6. Here is the error_log entry: Time2007/02/21 10:05:31.895 US/Pacific User Name (User Id) Anonymous User (None) Request URL http://192.168.45.20:8080/test/test_form Exception Type UnicodeDecodeError Exception Value 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128) Traceback (innermost last): * Module ZPublisher.Publish, line 119, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 42, in call_object * Module Shared.DC.Scripts.Bindings, line 313, in __call__ * Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec * Module Products.PageTemplates.ZopePageTemplate, line 331, in _exec * Module Products.PageTemplates.ZopePageTemplate, line 427, in pt_render * Module Products.PageTemplates.PageTemplate, line 89, in pt_render * Module zope.pagetemplate.pagetemplate, line 117, in pt_render * Module zope.tal.talinterpreter, line 271, in __call__ * Module zope.tal.talinterpreter, line 346, in interpret * Module zope.tal.talinterpreter, line 408, in do_startTag * Module zope.tal.talinterpreter, line 505, in attrAction_tal UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128) Display traceback as text REQUEST form -C '' cookies lazy items SESSION bound method SessionDataManager.getSessionData of SessionDataManager at /session_data_manager other TraversalRequestNameStack [] AUTHENTICATED_USER SpecialUser 'Anonymous User' URL 'http://192.168.45.20:8080/test/test_form' URL2'http://192.168.45.20:8080' SERVER_URL 'http://192.168.45.20:8080' AUTHENTICATION_PATH '' traverse_subpath[] BASE1 'http://192.168.45.20:8080' BASE2 'http://192.168.45.20:8080/test' BASE3 'http://192.168.45.20:8080/test/test_form' PUBLISHED ZopePageTemplate at /test/test_form URL1'http://192.168.45.20:8080/test' ACTUAL_URL 'http://192.168.45.20:8080/test/test_form' URL0http://192.168.45.20:8080/test/test_form URL1http://192.168.45.20:8080/test URL2http://192.168.45.20:8080 BASE0 http://192.168.45.20:8080 BASE1 http://192.168.45.20:8080 BASE2 http://192.168.45.20:8080/test BASE3 http://192.168.45.20:8080/test/test_form environ HTTP_ACCEPT '*/*' CONNECTION_TYPE 'Keep-Alive' HTTP_USER_AGENT 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)' SERVER_NAME '0.0.0.0' GATEWAY_INTERFACE 'CGI/1.1' SERVER_SOFTWARE 'Zope/(Zope 2.10.2-final, python 2.4.4, linux2) ZServer/1.1' REMOTE_ADDR '192.168.45.151' HTTP_ACCEPT_LANGUAGE'en-us' SCRIPT_NAME '' REQUEST_METHOD 'GET' HTTP_HOST '192.168.45.20:8080' PATH_INFO '/test/test_form' SERVER_PORT '8080' SERVER_PROTOCOL 'HTTP/1.1' channel.creation_time 1172081131 HTTP_ACCEPT_ENCODING'gzip, deflate' PATH_TRANSLATED '/test/test_form' ___ 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] frameset problems
I have this page: frameset rows=75%,25% frame src=dtml-var page frame src=dtml-call expr=getproperty(page=_['page']) /frameset The 'page' variable is in the request but no matter what I try I am having problems passing it the the python script 'getproperty'. Can anyone point me in the correct direction? Regards Garry ___ 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] frameset problems
- Original Message - From: Garry Saddington [EMAIL PROTECTED] To: zope@zope.org Sent: Wednesday, February 21, 2007 1:44 PM Subject: [Zope] frameset problems I have this page: frameset rows=75%,25% frame src=dtml-var page frame src=dtml-call expr=getproperty(page=_['page']) /frameset The 'page' variable is in the request but no matter what I try I am having problems passing it the the python script 'getproperty'. Can anyone point me in the correct direction? the source for a frame is loaded by the browser as an http request, therefore you need to pass variables in the url, eg. frame src=getproperty?page=dtml-var page Jonathan ___ 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: problem with input elements and unicode/utf-8
Andreas Jung [EMAIL PROTECTED] wrote: --On 21. Februar 2007 11:30:11 +0100 Andreas Jung wrote: --On 21. Februar 2007 02:05:36 -0800 Jostein Leira wrote: header_present = 'HTTP_ACCEPT_CHARSET' in self.request to header_present = 'HTTP_ACCEPT_CHARSET' in self.request.keys() I assume that the request implementation of Zope 3 and Zope 2 differ a bit when it comes to the 'in' operator. If request.keys() works for Zope 3 request as well I would like to see this fixed in Zope 3. After checking the implements and the unittests: I don't see any difference in the behavior of both statements. They behave identical. -aj In my Zope 2.10.2 installation the two statements really do behave different. -Jost - Looking for earth-friendly autos? Browse Top Cars by Green Rating at Yahoo! Autos' Green Center. ___ 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 2.6.4 + Win32 server
Hi David, David VanKirk wrote: I'm trying to migrate from a Linux server with Oracle to a win32 server with MS SQL Server. I need to run it behind a webserver so that I can connect through SSL. I've tried IIS, Apache + PCGI, and Apache + FastCGI. Has anyone been able to successfully run a Zope + win32 Web Server successfully, that can help. I run Zope behind Apache on Windows for several projects, some with MS SQL server. I'm very happy using Zope behind Apache on Windows, and have always been happy with the standard setup - never had to use PCGI or FastCGI. I also use Zope Plone (in the form of Enfold Server) behind IIS in one case, but frankly the IIS aspect is not one I am 100% happy with. What problems are you having? Do you actually need PCGI/FastCGI? -- Regards, PhilK 'let's hear it for the vague blur' ___ 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] frameset problems
Garry Saddington schrieb: I have this page: frameset rows=75%,25% frame src=dtml-var page frame src=dtml-call expr=getproperty(page=_['page']) /frameset The 'page' variable is in the request but no matter what I try I am having problems passing it the the python script 'getproperty'. Can anyone point me in the correct direction? dtml-call? wtf! This will never ever work since dtml-call does not return values. You might want to use dtml-var instead. (Let alone you should try to not use dtml at all) You above example would also not work since _['page'] would read a variable named page from _ namespace, which would try to look up properties first and only as last resort look for request variables. There is REQUEST even in DTML. Also note, design has long since moved away from frames (Yes I know ZMI still uses them) - it makes things with application servers much more easy if you don't use frames. Easiest way is to return rendered pages from python script for example pagename=context.getProperty('page','defaultpage') return context[pagename]() as a python script would do the trick. 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: problem with input elements and unicode/utf-8
Andreas Jung wrote at 2007-2-20 17:52 +0100: ... I can reproduce this error. Obviously RestrictedPython.compile_restricted_eval() can't deal correctly with unicode strings. Newer Python versions need to know the encoding of the source. In standard Python scripts, a coding comment in the form # -*- coding ... is used. For PageTemplates, the template would need to provide the encoding information in some way (though I do not know precisely how this should happen). -- Dieter ___ 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 2.6.4 + Win32 server
Hi David, Please stay on the list - have added back in as CC. David VanKirk wrote: I was under the impression that you needed PCGI or FastCGI to get Zope and Apache to communicate. If you have another method, I'm open to try it. No, not at all - in fact FastCGI at least is deprecated in current versions. Just be informed that I'm using an older version of Zope (2.6.4) so if there have been advancements that have been made since then with communicating with Apache, I'm not able to use those. Well, if you need Apache or IIS for SSL support, and you do not need to have SSL for the link between Apache and Zope, then there is nothing exotic at all involved. There are 3rd party solutions to use IIS (which cannot proxy on its own), but Apache is all you need. The Zope book has the gist here: - http://www.plope.com/Books/2_7Edition/VirtualHosting.stx That's the latest version, but the version on the Zope site is for 2.6, and as you can see little has changed: - http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/VirtualHosting.stx The gist is: - - Zope serves over HTTP. - Apache can /proxy/ HTTP. - The Zope Virtual Host Monster can rewrite the URLs generated by Zope to those required to pass the traffic through Apache. You don't need to do anything on the Zope side other than ensure that the VHM is present - all the work is done by a rewrite rule in the Apache virtual hosts setup. The rewrite rules can be fiddly, and a great resource is the Rewrite Rule Witch: - http://betabug.ch/zope/witch I've mainly done this with Apache 2.0.x, but I have used the same basic setup under 1.3.x - I can't recall if there were any great differences, but I still have one running server with 1.3.x on it, so I should be able to help either way. Can I suggest that you read up and have a play, and come back with any specific questions? I found the rewrite rules very fiddly at first, but soon got used to them - you might need some patience to get to grips with that part, but that's the only bit that caused me any pain. You don't say how you will be connecting Zope to MS SQL Server, but I can recommend the eGenix ODBC DA - it's not free, but it's not expensive either, and if you value your time at all it's cheaper and safer than doing it any other way... HTH! -- Regards, PhilK 'let's hear it for the vague blur' ___ 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: problem with input elements and unicode/utf-8
--On 21. Februar 2007 21:27:38 +0100 Dieter Maurer [EMAIL PROTECTED] wrote: Andreas Jung wrote at 2007-2-20 17:52 +0100: ... I can reproduce this error. Obviously RestrictedPython.compile_restricted_eval() can't deal correctly with unicode strings. Newer Python versions need to know the encoding of the source. In standard Python scripts, a coding comment in the form # -*- coding ... is used. This has absolutely nothing to do with the problem. Andreas pgp45QknFmywG.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] Re: problem with input elements and unicode/utf-8
Jostein Leira wrote at 2007-2-21 02:05 -0800: ... header_present = 'HTTP_ACCEPT_CHARSET' in self.request to header_present = 'HTTP_ACCEPT_CHARSET' in self.request.keys() I think this is a bug. After doing that change, IE6 and IE7 behaved consistently. HTTPRequest.keys is a very costly method. In the case, that in has a bug (and does not work reliably), then self.request.has_key('HTTP_ACCEPT_CHARSET') should be used (even better would be to implement in by calling has_key). -- Dieter ___ 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] Copy and Paste Problem
Florian Fahrbach wrote at 2007-2-21 08:44 +0100: I hope somebody knows an answer to my rather strange problem. It seems that in our Zope-Installation (2.74) we screwed up the Copy/Cut/Paste-Mechanism. We can not copy any objects in the ZMI at all. The result always is, that the same object ist pasted several times (Paste-Button stays at the bottom of the ZMI) or a copy error occurs. When we empty the caches/cookies etc. of the browser and restart it, we can copy one object, before the same behaviour starts again. Does anyone know what the problem could be? copy/paste works with a cookie as clipboard (_cb, I think). Your description seems to indicate that something with the cookie handling goes wrong. Unfortunately, it is quite difficult to imagine that cookie problems should result in objects copied several times from one paste Your problem is weird enough that I would use debugging to find out what happens precisely (search for pdb.set_trace). -- Dieter ___ 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] __bobo_traverse__ and wrappers
Hi all! Some days ago I begin this threat: http://www.mail-archive.com/zope@zope.org/msg26355.html Dieter point me to the solution and I try something like: def __bobo_traverse__(self, REQUEST, nombre): obj = getattr(self, nombre, None) if obj is None: self.REQUEST.set('TraversalRequestNameStack', self.REQUEST[TraversalRequestNameStack] + [nombre]) resultado = self() if type(resultado) == type(unicode()): return WrapperUnicode(resultado) elif type(resultado) == type(str()): return WrapperStr(resultado) else: return resultado return obj and the wrappers: class WrapperStr(str): __roles__ = None class WrapperUnicode(unicode): __roles__ = None But when I try to launch this zope raises a NotFound exception If I inspect de content of resultado I could see an unicode string then the WrapperUnicode is used to wrap the result Can you point me where the problem is, please? Thanks a lot! -- 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] Zope 2.6.4 + Win32 server
Hi David, Once again, please stay on the list - you need to hit reply to all. David VanKirk wrote: I appreciate your help and links, but I'm still not getting anything. I did say it was fiddly! I've go to get some urgent stuff out of the way, but I'll have some time later and will do a fully worked example. In the meantime... I enabled the proxy_module to use with the P option on the rewrite rule. I've also added the following line to my VirtualHost section: RewriteRule ^($|/.*) http://127.0.0.1:8080/VirtualHostBase/https/%{SERVER_NAME}:443/VirtualHostRoot$1 [L,P] but when I go to http://127.0.0.1/manage I get a Forbidden error. You can turn on some logging in Apache for rewrites. I did setup the Virtual Host Monster in Zope, so if I were to construct the URL like the ReWrite rule does manually, it starts to load the page, but the frames all have 404 errors because it's querying Apache on port 443 for the resources after Zope returns the VHMed URL. Is this an application that loads in a frame-set? Maybe you could send me a copy of you httpd.conf/ssl.conf files so I can see if there's something I'm missing? I'll send an annotated version. -- Regards, PhilK 'let's hear it for the vague blur' ___ 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 )