[Zope] Re: [Zope-Annce] Technical Preview of Blob support in ZODB
Christian Theune wrote: the ZODB team is proud to announce a technical preview of a Blob implementation for ZODB. Cool :-) Blobs are used to efficiently storage large amounts of binary data within a database. This implementation uses real files on the file system in combination with any ZODB storage (FileStorage, ...) and native support for ZEO clusters. It is efficient in terms of memory and CPU usage. Hmm, can all the other benefits be used without storing blobs in seperate files on filesystems? FileStorage backup semantics are now nice with repozo, how would you back up related blobs? I guess I also have an irrational paranoia about separate files having the correct transactional semantics. Anything I can read to prove my paranoia to be irrational? ;-) 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] Missing content! Urgent
Michael Havard wrote: We're missing 16 days worth of content. Have a read of this: http://www.catb.org/~esr/faqs/smart-questions.html#urgent Python 2.3.5, Zope 2.8.4, Plone 2.1.2, and a host of other products. ZEO configuration. Persistent disk caching is on. You've got Plone in the mix, you may get more help asking on a Plone-specific list... Is the missing content somehow captured in data.fs.tmp or is it somewhere else that I can retrieve it? If it is how do I get it back? You may want to ask about that on zodb-dev@zope.org but I've never heard of symptoms like yours. I can only hope/guess that it's one of your extra products that's done something weird. You could help by providing more information about what type of objects made up your missing data: was it a Plone site? specific types of content in a Plone site? Instances of some other type of object? cheers, Chris - this is why you should test backups ;-) -- 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] LAST INSERT ID driving me crazy
This is how it works for MySQL: insert into table_name ( ItemID, ItemDate, etc ) values ( dtml-sqlvar ItemID type=int, dtml-sqlvar ItemDate type=string, etc ) dtml-var sql_delimiter select LAST_INSERT_ID() as BaptismID You have to have the select LAST_INSERT_ID call in the same query as the insert, and you have to have the sql_delimiter. I have a vague recollection that LAST_INSERT_ID is MySQL specific. Cliff Alric Aneron wrote: Hi guys, HOW HOW HOW HOW!!! Do I get at the last_insert_id() function, this is driving me absolutely crazy!! Zope docs say use select last_insert_id() but it doesn't work, gives me an error about bad SQL syntax around LIMIT 1000. I tried googling it, I tried searching through other docs. And it just won't do it! I would like to make a separate ZSQL Method that will return to me the last insert id. Any help would be appreciated. Thank you. - Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less. ___ 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: Missing content! Urgent
Sorry. I know better, just got in a panic. Chris Withers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Michael Havard wrote: We're missing 16 days worth of content. Have a read of this: http://www.catb.org/~esr/faqs/smart-questions.html#urgent Python 2.3.5, Zope 2.8.4, Plone 2.1.2, and a host of other products. ZEO configuration. Persistent disk caching is on. You've got Plone in the mix, you may get more help asking on a Plone-specific list... Is the missing content somehow captured in data.fs.tmp or is it somewhere else that I can retrieve it? If it is how do I get it back? You may want to ask about that on zodb-dev@zope.org but I've never heard of symptoms like yours. I can only hope/guess that it's one of your extra products that's done something weird. You could help by providing more information about what type of objects made up your missing data: was it a Plone site? specific types of content in a Plone site? Instances of some other type of object? cheers, Chris - this is why you should test backups ;-) -- 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 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: Missing content! Urgent
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Havard wrote: We're missing 16 days worth of content. Python 2.3.5, Zope 2.8.4, Plone 2.1.2, and a host of other products. ZEO configuration. Persistent disk caching is on. Yesterday everything was fine. All the content was there and accessible. Today I try to log in and the server doesn't respond. I go out and restart the zope client, still no response. I restart the zeo server and the site delivers content. Problem! The content is from two weeks ago. All of the content from the last 16 days is missing. Thinking maybe someone restored from an older backup I went out to our daily backups and pulled the previous days data.fs backup. A restore didn't work. It still shows the outdated content. I went out to look at the backups again and noticed that the date on the data.fs was 4/14 while the date on data.fs.tmp was 4/26. data.fs.tmp is a 9 meg file. Is the missing content somehow captured in data.fs.tmp or is it somewhere else that I can retrieve it? If it is how do I get it back? You could try the following (back up everything first, of course!): - Stop the application server, then the storage server. - Test the existing storage file: $ /path/to/python /path/to/zope/utilities/ZODBTools/fstest.py \ var/Data.fs - On the storage server, concatenate the 'tmp' file to the end of the main file, e.g.:: $ cat var/Data.fs.tmp var/Data.fs - Move the 'tmp' file aside, e.g.:: $ mv var/Data.fs.tmp var/Data.fs.tmp-ASIDE - Test the concatenated storage file: $ /path/to/python /path/to/zope/utilities/ZODBTools/fstest.py \ var/Data.fs - Restart the storage server in debug mode and watch the log output: $ bin/zeoctl start tail -100f var/error.log Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEVjS6+gerLs4ltQ4RAiqrAKC1AVhW1A1yobCieSsNWgivaJ4rZACg1yfj b9muiVfu4p5MlWbf1xG14Po= =nIFY -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] Converting from week no. to date
DateTime().strftime(%U) converts from date to week no. Is it possible to convert from (week,year,weekday) to a specific date in a python script in zope ? I could install the mx.DateTime module in python and then make a product with a method that used ISO.Week() but is there a more straight forward approach ? ___ 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] Converting from week no. to date
--On 1. Mai 2006 17:16:13 +0200 Jonas Nielsen [EMAIL PROTECTED] wrote: DateTime().strftime(%U) converts from date to week no. Is it possible to convert from (week,year,weekday) to a specific date in a python script in zope ? The DateTime API does not support this. -aj -- ZOPYX Ltd. Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope Plone development, Consulting pgpHibAFnV5by.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] Converting from week no. to date
On 5/1/06, Jonas Nielsen [EMAIL PROTECTED] wrote: DateTime().strftime(%U) converts from date to week no. Is it possible to convert from (week,year,weekday) to a specific date in a python script in zope ? I could install the mx.DateTime module in python and then make a product with a method that used ISO.Week() but is there a more straight forward approach ? Well, steal some code from http://svn.nuxeo.org/trac/pub/file/CalCore/trunk/src/calcore/isoweek.py maybe? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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: Windows Server 2003, II6 and ASP404 vs form posts
For anyone else who might search the list in the future: Microsoft has confirmed that ASP error handlers in current versions of IIS 6 do not, can not, and will not -- no matter what the security settings -- get at POST data. There's a discussion of the changes at: I think that is not 100% true-- I am not sure where the difference lies -- but as we discussed I am using ASP404 on Windows 2003 (at http://www.coursesbywire.com) with form Posting functioning. The only issue (that I ran up against and had to solve) is that the method used in ASP404 to determine whether the original request was a POST or a GET no longer works on Win2003 (as it did on Win2000) -- it is necessary to introduce a kludge in the ASP code. http://blogs.msdn.com/david.wang/archive/2005/11/29/Child_URL_Execution_and_SSI_exec.aspx The author confirmed that the changes also affect custom error handlers. So, the days of serving Zope pages on IIS via the 404handler.asp approach are pretty much over. Not quite -- but maybe numbered. I agree though that starting out now using it when it was not previously in use might be a bad plan. I am not totally sure what is causing your problem but on my (fully patched Win2003)server the Post data is available. I had a look at Enfold's Proxy when I this issue first came up for me but found that it did not solve my problem (though it could be that I just didn't understand something about it). In my case putting Apache in front did not seem a reasonable solution either as I am running IIS on the box and needed it to stay. ___ 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] ZEO ClientDisconnected error
Hi there, One of my clients is using Plone on Solaris 9. We have set up one ZEO client on a Solaris machine and a ZEO server on another Solaris machine (for testing purposes only at this stage). Performance is great but every morning, the first hit to the Plone site returns a ClientDisconnected error (see full error log below). It looks like the socket on the server gets corrupted or something. When the error occurs, the server is non-responsive for a while (anywhere between 10 sec and 2 minutes) and then eventually the server responds. Has anybody seen that before? Is it Zope related or should I look in other directions? Researching Zope on Solaris, I read somewhere (can't remember where now) that Solaris doesn't like long-running processes too much (well, the Zope process, for instance). Could it be the culprit here? Any advise or pointer welcome. Cyrille (in the logs below, appserv05 is the ZEO client, pehi is the ZEO server) From event.log: = ERROR ZEO.zrpc.Connection(C) (pehi.myclient.govt.nz:8100) Error caught in asyncore raise socket.error, why error: (9, 'Bad file descriptor') 2006-04-28T09:09:52 = From the error log: = Time 2006-04-28 09:09 User Name admin (admin) Request URL http://plone.appserv05.myclient.govt.nz/front-page/document_view Exception Type ClientDisconnected Exception Value Traceback (innermost last): •Module ZPublisher.Publish, line 114, 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.CMFCore.FSPageTemplate, line 195, in _exec •Module Products.CMFCore.FSPageTemplate, line 134, in pt_render •Module Products.PageTemplates.PageTemplate, line 104, in pt_render FSPageTemplate at /myclient/Plone/document_view used for /myclient/Plone/front-page •Module TAL.TALInterpreter, line 206, in __call__ •Module TAL.TALInterpreter, line 250, in interpret •Module TAL.TALInterpreter, line 711, in do_useMacro •Module TAL.TALInterpreter, line 250, in interpret •Module TAL.TALInterpreter, line 426, in do_optTag_tal •Module TAL.TALInterpreter, line 411, in do_optTag •Module TAL.TALInterpreter, line 406, in no_tag •Module TAL.TALInterpreter, line 250, in interpret •Module TAL.TALInterpreter, line 711, in do_useMacro •Module TAL.TALInterpreter, line 250, in interpret •Module TAL.TALInterpreter, line 481, in do_setGlobal_tal •Module Products.PageTemplates.TALES, line 221, in evaluate URL: file:CMFPlone/skins/plone_templates/global_defines.pt Line 3, Column 0 Expression: PythonExpr language or here.Language() or default_language Names: •{'container': PloneSite at /myclient/Plone, • 'context': ATDocument at /myclient/Plone/front-page, • 'default': Products.PageTemplates.TALES.Default instance at 0xacaf58, • 'here': ATDocument at /myclient/Plone/front-page, • 'loop': Products.PageTemplates.TALES.SafeMapping object at 0x22027d8, • 'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0xabd5d0, • 'nothing': None, • 'options': {'args': ()}, • 'repeat': Products.PageTemplates.TALES.SafeMapping object at 0x22027d8, • 'request': HTTPRequest, URL=http://plone.appserv05.myclient.govt.nz/front-page/document_view, • 'root': Application at , • 'template': FSPageTemplate at /myclient/Plone/document_view used for /myclient/Plone/front-page, • 'traverse_subpath': [], 'user': admin} •Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ __traceback_info__: language or here.Language() or default_language •Module Python expression language or here.Language() or default_language, line 1, in expression •Module Products.Archetypes.ClassGen, line 58, in generatedAccessor •Module Products.Archetypes.Field, line 768, in get •Module Products.Archetypes.Field, line 637, in get __traceback_info__: ('language', ATDocument at /myclient/Plone/front-page, {'field': Field language(string:rw), 'schema': Products.Archetypes.Schema.Schema object at 0x171a330}) •Module Products.Archetypes.Storage, line 175, in get •Module UserDict, line 19, in __getitem__ •Module ZODB.Connection, line 704, in setstate •Module ZODB.Connection, line 760, in _setstate •Module ZODB.serialize, line 495, in setGhostState •Module ZODB.serialize, line 488, in getState •Module ZODB.serialize, line 436, in _persistent_load •Module ZODB.Connection, line 207, in get •Module ZEO.ClientStorage, line 746, in load •Module ZEO.ClientStorage, line 769, in loadEx •Module ZEO.ClientStorage, line
[Zope] Re: ZEO ClientDisconnected error
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Cyrille Bonnet wrote: Hi there, One of my clients is using Plone on Solaris 9. We have set up one ZEO client on a Solaris machine and a ZEO server on another Solaris machine (for testing purposes only at this stage). Performance is great but every morning, the first hit to the Plone site returns a ClientDisconnected error (see full error log below). It looks like the socket on the server gets corrupted or something. When the error occurs, the server is non-responsive for a while (anywhere between 10 sec and 2 minutes) and then eventually the server responds. Has anybody seen that before? Is it Zope related or should I look in other directions? Researching Zope on Solaris, I read somewhere (can't remember where now) that Solaris doesn't like long-running processes too much (well, the Zope process, for instance). Could it be the culprit here? Any advise or pointer welcome. I would check for a rude firewall between your appserver and the storage server: one which is closing sockets it sees as idle for too long. Dieter Maurer has a product which works around such scenarios: http://mail.zope.org/pipermail/zodb-dev/2005-June/008967.html Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEVsxj+gerLs4ltQ4RAh+IAKChzq20oj0sFmD9jNxpzQWtis98xQCfamtY Fyeu1abM7pUBG4P1ANbQ8mM= =eXdz -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] Re: ZEO ClientDisconnected error
Hi Tres, thanks for your response: it is very helpful. The posting you refer to is particularly helpful. Thanks for digging it up for me! Cheers, Cyrille Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Cyrille Bonnet wrote: Hi there, One of my clients is using Plone on Solaris 9. We have set up one ZEO client on a Solaris machine and a ZEO server on another Solaris machine (for testing purposes only at this stage). Performance is great but every morning, the first hit to the Plone site returns a ClientDisconnected error (see full error log below). It looks like the socket on the server gets corrupted or something. When the error occurs, the server is non-responsive for a while (anywhere between 10 sec and 2 minutes) and then eventually the server responds. Has anybody seen that before? Is it Zope related or should I look in other directions? Researching Zope on Solaris, I read somewhere (can't remember where now) that Solaris doesn't like long-running processes too much (well, the Zope process, for instance). Could it be the culprit here? Any advise or pointer welcome. I would check for a rude firewall between your appserver and the storage server: one which is closing sockets it sees as idle for too long. Dieter Maurer has a product which works around such scenarios: http://mail.zope.org/pipermail/zodb-dev/2005-June/008967.html Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEVsxj+gerLs4ltQ4RAh+IAKChzq20oj0sFmD9jNxpzQWtis98xQCfamtY Fyeu1abM7pUBG4P1ANbQ8mM= =eXdz -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 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] strange behaviour:can not access source-view.gif but a copy of it
Hi there, in a plone site (but I see nothing plone related with my problem) I can not access an image with the id view-source.gif (it is used by kupu). when I copied it to the plone root the copy was named copy_of_view-source.gif all tough no prior object of that name existed. After renaming to view-source.gif and trying to access it trough its URL www.xxx.yy/view-source.gif nothing happens, only the watch is spinning to tell that the browser is still busy. if I copy that very same image to an other name, the copy can be accessed without problems. Can anybody give me a hint what the reason could be, or give me an idea how to hunt it down. thanks robert begin:vcard fn:robert rottermann n:rottermann;robert email;internet:[EMAIL PROTECTED] tel;work:031 333 10 20 tel;fax:031 333 10 23 tel;home:031 333 36 03 x-mozilla-html:FALSE version:2.1 end:vcard ___ 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-Checkins] SVN: Zope/branches/regebro-wsgi_support2/lib/python/Products/PythonScripts/tests/testPythonScript.py Temporarily getting rid of an annoying error.
Log message for revision 67784: Temporarily getting rid of an annoying error. Changed: U Zope/branches/regebro-wsgi_support2/lib/python/Products/PythonScripts/tests/testPythonScript.py -=- Modified: Zope/branches/regebro-wsgi_support2/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/branches/regebro-wsgi_support2/lib/python/Products/PythonScripts/tests/testPythonScript.py 2006-05-01 09:47:46 UTC (rev 67783) +++ Zope/branches/regebro-wsgi_support2/lib/python/Products/PythonScripts/tests/testPythonScript.py 2006-05-01 10:11:02 UTC (rev 67784) @@ -223,7 +223,8 @@ def testBadImports(self): self.assertPSRaises(ImportError, body=from string import *) -self.assertPSRaises(ImportError, body=import mmap) +self.assertPSRaises(ImportError, body=from datetime import datetime) +#self.assertPSRaises(ImportError, body=import mmap) def testAttributeAssignment(self): # It's illegal to assign to attributes of anything that ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/regebro-wsgi_support2/lib/python/ Neater shutdown with twisted.
Log message for revision 67785: Neater shutdown with twisted. Changed: U Zope/branches/regebro-wsgi_support2/lib/python/Lifetime/__init__.py U Zope/branches/regebro-wsgi_support2/lib/python/ZServer/HTTPResponse.py U Zope/branches/regebro-wsgi_support2/lib/python/ZServer/PubCore/ZServerPublisher.py U Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py -=- Modified: Zope/branches/regebro-wsgi_support2/lib/python/Lifetime/__init__.py === --- Zope/branches/regebro-wsgi_support2/lib/python/Lifetime/__init__.py 2006-05-01 10:11:02 UTC (rev 67784) +++ Zope/branches/regebro-wsgi_support2/lib/python/Lifetime/__init__.py 2006-05-01 10:12:03 UTC (rev 67785) @@ -31,6 +31,11 @@ import ZServer ZServer.exit_code = exit_code _shutdown_phase = 1 +try: +from twisted.internet import reactor +reactor.callLater(0.1, reactor.stop) +except ImportError: +pass if fast: # Someone wants us to shutdown fast. This is hooked into SIGTERM - so # possibly the system is going down and we can expect a SIGKILL within Modified: Zope/branches/regebro-wsgi_support2/lib/python/ZServer/HTTPResponse.py === --- Zope/branches/regebro-wsgi_support2/lib/python/ZServer/HTTPResponse.py 2006-05-01 10:11:02 UTC (rev 67784) +++ Zope/branches/regebro-wsgi_support2/lib/python/ZServer/HTTPResponse.py 2006-05-01 10:12:03 UTC (rev 67785) @@ -313,6 +313,7 @@ def start_response(self, status, headers, exc_info=None): # Used for WSGI +self._request.reply_code = int(status.split(' ')[0]) status = 'HTTP/%s %s\r\n' % (self._request.version, status) self.write(status) headers = '\r\n'.join([': '.join(x) for x in headers]) Modified: Zope/branches/regebro-wsgi_support2/lib/python/ZServer/PubCore/ZServerPublisher.py === --- Zope/branches/regebro-wsgi_support2/lib/python/ZServer/PubCore/ZServerPublisher.py 2006-05-01 10:11:02 UTC (rev 67784) +++ Zope/branches/regebro-wsgi_support2/lib/python/ZServer/PubCore/ZServerPublisher.py 2006-05-01 10:12:03 UTC (rev 67785) @@ -33,5 +33,6 @@ for r in res: a['wsgi.output'].write(r) finally: +# TODO: Support keeping connections open. a['wsgi.output']._close = 1 a['wsgi.output'].close() Modified: Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py === --- Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py 2006-05-01 10:11:02 UTC (rev 67784) +++ Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py 2006-05-01 10:12:03 UTC (rev 67785) @@ -115,12 +115,15 @@ try: from App.config import getConfiguration config = getConfiguration() +import ZServer if config.twisted_servers: if not _use_twisted: raise ImportError(You do not have twisted installed.) twisted.internet.reactor.run() +# Storing the exit code in the ZServer even for twisted, +# but hey, it works... +sys.exit(ZServer.exit_code) else: -import ZServer import Lifetime Lifetime.loop() sys.exit(ZServer.exit_code) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/skel/bin/runzope.bat.in changes so it's easier to move a Zope instance between zope versions.
Log message for revision 67786: changes so it's easier to move a Zope instance between zope versions. Changed: U Zope/trunk/skel/bin/runzope.bat.in -=- Modified: Zope/trunk/skel/bin/runzope.bat.in === --- Zope/trunk/skel/bin/runzope.bat.in 2006-05-01 10:12:03 UTC (rev 67785) +++ Zope/trunk/skel/bin/runzope.bat.in 2006-05-01 11:13:52 UTC (rev 67786) @@ -1,8 +1,8 @@ @set PYTHON=PYTHON @set ZOPE_HOME=ZOPE_HOME @set INSTANCE_HOME=INSTANCE_HOME [EMAIL PROTECTED] SOFTWARE_HOME=SOFTWARE_HOME [EMAIL PROTECTED] CONFIG_FILE=INSTANCE_HOME\etc\zope.conf [EMAIL PROTECTED] SOFTWARE_HOME=%ZOPE_HOME%\lib\python [EMAIL PROTECTED] CONFIG_FILE=%INSTANCE_HOME%\etc\zope.conf @set PYTHONPATH=%SOFTWARE_HOME% @set ZOPE_RUN=%SOFTWARE_HOME%\Zope2\Startup\run.py %PYTHON% %ZOPE_RUN% -C %CONFIG_FILE% %1 %2 %3 %4 %5 %6 %7 ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/skel/bin/runzope.bat.in further changes so it's easier to move an instance between zope versions.
Log message for revision 67788: further changes so it's easier to move an instance between zope versions. Changed: U Zope/trunk/skel/bin/runzope.bat.in -=- Modified: Zope/trunk/skel/bin/runzope.bat.in === --- Zope/trunk/skel/bin/runzope.bat.in 2006-05-01 11:14:30 UTC (rev 67787) +++ Zope/trunk/skel/bin/runzope.bat.in 2006-05-01 11:19:33 UTC (rev 67788) @@ -1,6 +1,6 @@ [EMAIL PROTECTED] PYTHON=PYTHON @set ZOPE_HOME=ZOPE_HOME @set INSTANCE_HOME=INSTANCE_HOME [EMAIL PROTECTED] PYTHON=%ZOPE_HOME%\bin\python.exe @set SOFTWARE_HOME=%ZOPE_HOME%\lib\python @set CONFIG_FILE=%INSTANCE_HOME%\etc\zope.conf @set PYTHONPATH=%SOFTWARE_HOME% ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/skel/bin/runzope.bat.in further changes so it's easier to move an instance between zope versions.
Log message for revision 67789: further changes so it's easier to move an instance between zope versions. Changed: U Zope/branches/2.9/skel/bin/runzope.bat.in -=- Modified: Zope/branches/2.9/skel/bin/runzope.bat.in === --- Zope/branches/2.9/skel/bin/runzope.bat.in 2006-05-01 11:19:33 UTC (rev 67788) +++ Zope/branches/2.9/skel/bin/runzope.bat.in 2006-05-01 11:19:56 UTC (rev 67789) @@ -1,6 +1,6 @@ [EMAIL PROTECTED] PYTHON=PYTHON @set ZOPE_HOME=ZOPE_HOME @set INSTANCE_HOME=INSTANCE_HOME [EMAIL PROTECTED] PYTHON=%ZOPE_HOME%\bin\python.exe @set SOFTWARE_HOME=%ZOPE_HOME%\lib\python @set CONFIG_FILE=%INSTANCE_HOME%\etc\zope.conf @set PYTHONPATH=%SOFTWARE_HOME% ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py Added an error message for misconfiguration.
Log message for revision 67790: Added an error message for misconfiguration. Changed: U Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py -=- Modified: Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py === --- Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py 2006-05-01 11:19:56 UTC (rev 67789) +++ Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py 2006-05-01 11:24:08 UTC (rev 67790) @@ -116,9 +116,13 @@ from App.config import getConfiguration config = getConfiguration() import ZServer +if config.twisted_servers and config.servers: +raise ZConfig.ConfigurationError( +You can't run both ZServer servers and twisted servers.) if config.twisted_servers: if not _use_twisted: -raise ImportError(You do not have twisted installed.) +raise ZConfig.ConfigurationError( +You do not have twisted installed.) twisted.internet.reactor.run() # Storing the exit code in the ZServer even for twisted, # but hey, it works... ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/OFS/tests/test_XMLExportImport.py Fix test failures on Windows.
Log message for revision 67792: Fix test failures on Windows. Changed: U Zope/trunk/lib/python/OFS/tests/test_XMLExportImport.py -=- Modified: Zope/trunk/lib/python/OFS/tests/test_XMLExportImport.py === --- Zope/trunk/lib/python/OFS/tests/test_XMLExportImport.py 2006-05-01 12:05:40 UTC (rev 67791) +++ Zope/trunk/lib/python/OFS/tests/test_XMLExportImport.py 2006-05-01 12:06:18 UTC (rev 67792) @@ -11,6 +11,7 @@ # ## import unittest +import os import tempfile import transaction from StringIO import StringIO @@ -68,16 +69,20 @@ transaction.savepoint(optimistic=True) # need an OID! oid = dm._p_oid -ostream = tempfile.NamedTemporaryFile(suffix='.xml') +handle, path = tempfile.mkstemp(suffix='.xml') try: +ostream = os.fdopen(handle,'wb') data = exportXML(connection, oid, ostream) -ostream.flush() -newobj = importXML(connection, ostream.name) +ostream.close() +newobj = importXML(connection, path) +self.failUnless(isinstance(newobj, DTMLMethod)) +self.assertEqual(newobj.read(), dm.read()) finally: -ostream.close() +# if this operaiton fails with a 'Permission Denied' error, +# then comment it out as it's probably masking a failure in +# the block above. +os.remove(path) -self.failUnless(isinstance(newobj, DTMLMethod)) -self.assertEqual(newobj.read(), dm.read()) def test_OFS_ObjectManager__importObjectFromFile_xml(self): from OFS.DTMLMethod import DTMLMethod @@ -95,13 +100,17 @@ oid = dm._p_oid sub = app._getOb('sub') -ostream = tempfile.NamedTemporaryFile(suffix='.xml') +handle, path = tempfile.mkstemp(suffix='.xml') try: +ostream = os.fdopen(handle,'wb') data = exportXML(connection, oid, ostream) -ostream.flush() -sub._importObjectFromFile(ostream.name, 0, 0) +ostream.close() +sub._importObjectFromFile(path, 0, 0) finally: -ostream.close() +# if this operaiton fails with a 'Permission Denied' error, +# then comment it out as it's probably masking a failure in +# the block above. +os.remove(path) def test_suite(): return unittest.TestSuite(( ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/regebro-wsgi_support2/ Added CHANGES changes, and the new stuff into skel.
Log message for revision 67793: Added CHANGES changes, and the new stuff into skel. Changed: U Zope/branches/regebro-wsgi_support2/doc/CHANGES.txt U Zope/branches/regebro-wsgi_support2/skel/etc/zope.conf.in -=- Modified: Zope/branches/regebro-wsgi_support2/doc/CHANGES.txt === --- Zope/branches/regebro-wsgi_support2/doc/CHANGES.txt 2006-05-01 12:06:18 UTC (rev 67792) +++ Zope/branches/regebro-wsgi_support2/doc/CHANGES.txt 2006-05-01 12:59:29 UTC (rev 67793) @@ -48,6 +48,27 @@ - Using FastCGI is offically deprecated. Features added + + - Experimental WSGI and Twisted support for http. +Zope now has a WSGI interface for integration with other +web-servers than ZServer. Most notably Twisted is supported. +The WSGI application is ZPublisher.WSGIPublisher.publish_module + +You can make ZServer use the twisted interface with the +use-wsgi on keyword in the http-server section in zope.conf. + +You can run Twisted by installing Twisted (2.1 recommended) and +replacing the http-server section with a server section in +zope.conf. It is not possible to run a Twisted server together with +a ZServer at the same time. + + server +address 8080 +type Zope2-HTTP + /server + +WSGI: http://www.python.org/dev/peps/pep-0333/ +Twisted: http://twistedmatrix.com/ - The traversal has been refactored to take heed of Zope3s IPublishTraverse adapter interfaces. The ZCML directives Modified: Zope/branches/regebro-wsgi_support2/skel/etc/zope.conf.in === --- Zope/branches/regebro-wsgi_support2/skel/etc/zope.conf.in 2006-05-01 12:06:18 UTC (rev 67792) +++ Zope/branches/regebro-wsgi_support2/skel/etc/zope.conf.in 2006-05-01 12:59:29 UTC (rev 67793) @@ -904,6 +904,8 @@ # valid keys are address and force-connection-close address 8080 # force-connection-close on + # You can also use the WSGI interface between ZServer and ZPublisher: + # use-wsgi on /http-server # Examples: @@ -947,6 +949,13 @@ #user admin #password 123 # /clock-server +# +# server +## This uses Twisted as the web-server. You must install Twisted +## separately. You can't run Twisted and ZServer at same time. +#address 8080 +#type Zope2-HTTP +# /server # Database (zodb_db) section ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/ Experimental WSGI + Twisted support.
Log message for revision 67794: Experimental WSGI + Twisted support. Merge from svn+ssh://[EMAIL PROTECTED]/repos/main/Zope/branches/regebro-wsgi_support2 Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/Lifetime/__init__.py U Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py U Zope/trunk/lib/python/ZPublisher/Publish.py A Zope/trunk/lib/python/ZPublisher/WSGIPublisher.py U Zope/trunk/lib/python/ZServer/HTTPResponse.py U Zope/trunk/lib/python/ZServer/HTTPServer.py U Zope/trunk/lib/python/ZServer/PubCore/ZServerPublisher.py U Zope/trunk/lib/python/ZServer/component.xml U Zope/trunk/lib/python/ZServer/datatypes.py U Zope/trunk/lib/python/Zope2/Startup/__init__.py U Zope/trunk/lib/python/Zope2/Startup/datatypes.py U Zope/trunk/lib/python/Zope2/Startup/handlers.py U Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml U Zope/trunk/skel/etc/zope.conf.in -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2006-05-01 12:59:29 UTC (rev 67793) +++ Zope/trunk/doc/CHANGES.txt 2006-05-01 13:17:32 UTC (rev 67794) @@ -48,6 +48,27 @@ - Using FastCGI is offically deprecated. Features added + + - Experimental WSGI and Twisted support for http. +Zope now has a WSGI interface for integration with other +web-servers than ZServer. Most notably Twisted is supported. +The WSGI application is ZPublisher.WSGIPublisher.publish_module + +You can make ZServer use the twisted interface with the +use-wsgi on keyword in the http-server section in zope.conf. + +You can run Twisted by installing Twisted (2.1 recommended) and +replacing the http-server section with a server section in +zope.conf. It is not possible to run a Twisted server together with +a ZServer at the same time. + + server +address 8080 +type Zope2-HTTP + /server + +WSGI: http://www.python.org/dev/peps/pep-0333/ +Twisted: http://twistedmatrix.com/ - The traversal has been refactored to take heed of Zope3s IPublishTraverse adapter interfaces. The ZCML directives Modified: Zope/trunk/lib/python/Lifetime/__init__.py === --- Zope/trunk/lib/python/Lifetime/__init__.py 2006-05-01 12:59:29 UTC (rev 67793) +++ Zope/trunk/lib/python/Lifetime/__init__.py 2006-05-01 13:17:32 UTC (rev 67794) @@ -31,6 +31,11 @@ import ZServer ZServer.exit_code = exit_code _shutdown_phase = 1 +try: +from twisted.internet import reactor +reactor.callLater(0.1, reactor.stop) +except ImportError: +pass if fast: # Someone wants us to shutdown fast. This is hooked into SIGTERM - so # possibly the system is going down and we can expect a SIGKILL within Modified: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2006-05-01 12:59:29 UTC (rev 67793) +++ Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2006-05-01 13:17:32 UTC (rev 67794) @@ -223,7 +223,8 @@ def testBadImports(self): self.assertPSRaises(ImportError, body=from string import *) -self.assertPSRaises(ImportError, body=import mmap) +self.assertPSRaises(ImportError, body=from datetime import datetime) +#self.assertPSRaises(ImportError, body=import mmap) def testAttributeAssignment(self): # It's illegal to assign to attributes of anything that Modified: Zope/trunk/lib/python/ZPublisher/Publish.py === --- Zope/trunk/lib/python/ZPublisher/Publish.py 2006-05-01 12:59:29 UTC (rev 67793) +++ Zope/trunk/lib/python/ZPublisher/Publish.py 2006-05-01 13:17:32 UTC (rev 67794) @@ -122,7 +122,6 @@ return response except: - # DM: provide nicer error message for FTP sm = None if response is not None: Copied: Zope/trunk/lib/python/ZPublisher/WSGIPublisher.py (from rev 67793, Zope/branches/regebro-wsgi_support2/lib/python/ZPublisher/WSGIPublisher.py) Modified: Zope/trunk/lib/python/ZServer/HTTPResponse.py === --- Zope/trunk/lib/python/ZServer/HTTPResponse.py 2006-05-01 12:59:29 UTC (rev 67793) +++ Zope/trunk/lib/python/ZServer/HTTPResponse.py 2006-05-01 13:17:32 UTC (rev 67794) @@ -311,6 +311,16 @@ self._close=1 self._request.reply_code=response.status +def start_response(self, status, headers, exc_info=None): +# Used for WSGI +
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/OFS/subscribers.py remove zLOG use.
Log message for revision 67798: remove zLOG use. Changed: U Zope/branches/2.9/lib/python/OFS/subscribers.py -=- Modified: Zope/branches/2.9/lib/python/OFS/subscribers.py === --- Zope/branches/2.9/lib/python/OFS/subscribers.py 2006-05-01 14:12:47 UTC (rev 67797) +++ Zope/branches/2.9/lib/python/OFS/subscribers.py 2006-05-01 14:14:26 UTC (rev 67798) @@ -18,9 +18,8 @@ import warnings -import sys +from logging import getLogger -from zLOG import LOG, ERROR from Acquisition import aq_base from App.config import getConfiguration from AccessControl import getSecurityManager @@ -35,6 +34,7 @@ deprecatedManageAddDeleteClasses = [] +LOG = getLogger('OFS.subscribers') def compatibilityCall(method_name, *args): Call a method if events have not been setup yet. @@ -152,7 +152,7 @@ except ConflictError: raise except: -LOG('Zope', ERROR, '_delObject() threw', error=sys.exc_info()) +LOG.error('_delObject() threw', exc_info=True) # In debug mode when non-Manager, let exceptions propagate. if getConfiguration().debug_mode: if not getSecurityManager().getUser().has_role('Manager'): ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/OFS/tests/test shush log output from tests.
Log message for revision 67801: shush log output from tests. Changed: U Zope/branches/2.9/lib/python/OFS/tests/testAppInitializer.py U Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py U Zope/branches/2.9/lib/python/OFS/tests/testProductInit.py -=- Modified: Zope/branches/2.9/lib/python/OFS/tests/testAppInitializer.py === --- Zope/branches/2.9/lib/python/OFS/tests/testAppInitializer.py 2006-05-01 14:27:29 UTC (rev 67800) +++ Zope/branches/2.9/lib/python/OFS/tests/testAppInitializer.py 2006-05-01 14:27:56 UTC (rev 67801) @@ -14,6 +14,8 @@ import os, sys, unittest, tempfile, cStringIO +from logging import getLogger + import ZODB from OFS.Application import Application, AppInitializer, get_products import Zope2.Startup @@ -121,7 +123,12 @@ i = self.getOne() self.configure(bad_cfg) -status = i.install_tempfolder_and_sdc() +try: +logger = getLogger('Zope.ZODBMountPoint') +logger.disabled = 1 +status = i.install_tempfolder_and_sdc() +finally: +logger.disabled = 0 self.failIf(status) def test_install_tempfolder_and_sdc_unlimited_sessions(self): Modified: Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py === --- Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py 2006-05-01 14:27:29 UTC (rev 67800) +++ Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py 2006-05-01 14:27:56 UTC (rev 67801) @@ -7,6 +7,7 @@ from AccessControl.SpecialUsers import emergency_user, nobody, system from Acquisition import Implicit from App.config import getConfiguration +from logging import getLogger from OFS.ObjectManager import ObjectManager from OFS.SimpleItem import SimpleItem from zope.app.testing.placelesssetup import PlacelessSetup @@ -14,6 +15,7 @@ from Products.Five import zcml from Products.Five.eventconfigure import setDeprecatedManageAddDelete +logger = getLogger('OFS.subscribers') class FauxRoot( Implicit ): @@ -284,7 +286,11 @@ om = self._makeOne() ob = ItemForDeletion(fail_on_delete=True) om._setObject(ob.getId(), ob) -om._delObject(ob.getId()) +try: +logger.disabled = 1 +om._delObject(ob.getId()) +finally: +logger.disabled = 0 def test_delObject_exception(self): # Test exception behavior in manage_beforeDelete @@ -293,8 +299,12 @@ om = self._makeOne() ob = ItemForDeletion(fail_on_delete=True) om._setObject(ob.getId(), ob) -om._delObject(ob.getId()) - +try: +logger.disabled = 1 +om._delObject(ob.getId()) +finally: +logger.disabled = 0 + def test_delObject_exception_debug_manager(self): # Test exception behavior in manage_beforeDelete in debug mode # Manager user @@ -303,7 +313,11 @@ om = self._makeOne() ob = ItemForDeletion(fail_on_delete=True) om._setObject(ob.getId(), ob) -om._delObject(ob.getId()) +try: +logger.disabled = 1 +om._delObject(ob.getId()) +finally: +logger.disabled = 0 def test_delObject_exception_debug(self): # Test exception behavior in manage_beforeDelete in debug mode @@ -313,7 +327,11 @@ om = self._makeOne() ob = ItemForDeletion(fail_on_delete=True) om._setObject(ob.getId(), ob) -self.assertRaises(DeleteFailed, om._delObject, ob.getId()) +try: +logger.disabled = 1 +self.assertRaises(DeleteFailed, om._delObject, ob.getId()) +finally: +logger.disabled = 0 def test_delObject_exception_debug_deep(self): # Test exception behavior in manage_beforeDelete in debug mode @@ -325,7 +343,11 @@ ob = ItemForDeletion(fail_on_delete=True) om1._setObject('om2', om2, set_owner=False) om2._setObject(ob.getId(), ob) -self.assertRaises(DeleteFailed, om1._delObject, 'om2') +try: +logger.disabled = 1 +self.assertRaises(DeleteFailed, om1._delObject, 'om2') +finally: +logger.disabled = 0 def test_hasObject(self): om = self._makeOne() Modified: Zope/branches/2.9/lib/python/OFS/tests/testProductInit.py === --- Zope/branches/2.9/lib/python/OFS/tests/testProductInit.py 2006-05-01 14:27:29 UTC (rev 67800) +++ Zope/branches/2.9/lib/python/OFS/tests/testProductInit.py 2006-05-01 14:27:56 UTC (rev 67801) @@ -170,7 +170,14 @@ f.write('Syntax Error!') f.close() self.configure(cfg) -self.assertRaises(SyntaxError, self.import_bad_product) +try: +from logging
[Zope-Checkins] SVN: Zope/branches/2.9/ - Collector #2062: Fix manage_historyCopy, which was broken, and write tests for it.
Log message for revision 67804: - Collector #2062: Fix manage_historyCopy, which was broken, and write tests for it. Changed: U Zope/branches/2.9/doc/CHANGES.txt U Zope/branches/2.9/lib/python/OFS/History.py A Zope/branches/2.9/lib/python/OFS/tests/testHistory.py -=- Modified: Zope/branches/2.9/doc/CHANGES.txt === --- Zope/branches/2.9/doc/CHANGES.txt 2006-05-01 15:20:47 UTC (rev 67803) +++ Zope/branches/2.9/doc/CHANGES.txt 2006-05-01 15:39:48 UTC (rev 67804) @@ -18,6 +18,9 @@ Bugs fixed + - Collector #2062: Fix manage_historyCopy, which was broken, and write +tests for it. + - Collector #2061: Fix problems where windows line endings are passed to restricted code compilers. Modified: Zope/branches/2.9/lib/python/OFS/History.py === --- Zope/branches/2.9/lib/python/OFS/History.py 2006-05-01 15:20:47 UTC (rev 67803) +++ Zope/branches/2.9/lib/python/OFS/History.py 2006-05-01 15:39:48 UTC (rev 67804) @@ -144,15 +144,12 @@ if serial != self._p_serial: self.manage_beforeHistoryCopy() state=self._p_jar.oldstate(self, serial) -# Scrub the object before restoring the old state base = aq_base(self) -base._p_changed=0 -base._p_deactivate() -base.__setstate__(state) -base._p_changed=1 - +base._p_activate() # make sure we're not a ghost +base.__setstate__(state) # change the state +base._p_changed = True # marke object as dirty self.manage_afterHistoryCopy() - + if RESPONSE is not None and URL1 is not None: RESPONSE.redirect(URL1+'/manage_workspace') Added: Zope/branches/2.9/lib/python/OFS/tests/testHistory.py === --- Zope/branches/2.9/lib/python/OFS/tests/testHistory.py 2006-05-01 15:20:47 UTC (rev 67803) +++ Zope/branches/2.9/lib/python/OFS/tests/testHistory.py 2006-05-01 15:39:48 UTC (rev 67804) @@ -0,0 +1,97 @@ +import unittest +import Testing +import Zope2 +Zope2.startup() + +import os +import shutil +import transaction +import tempfile +import ZODB + +from OFS.Application import Application +from Products.PythonScripts.PythonScript import manage_addPythonScript +from ZODB.FileStorage import FileStorage + +class HistoryTests(unittest.TestCase): + +def setUp(self): +# set up a zodb +# we can't use DemoStorage here 'cos it doesn't support History +self.dir = tempfile.mkdtemp() +self.s = FileStorage(os.path.join(self.dir,'testHistory.fs'),create=True) +self.connection = ZODB.DB(self.s).open() +r = self.connection.root() +a = Application() +r['Application'] = a +self.root = a +# create a python script +manage_addPythonScript(a,'test') +self.ps = ps = a.test +# commit some changes +ps.write('return 1') +t = transaction.get() +# undo note made by Application instantiation above. +t.description = None +t.note('Change 1') +t.commit() +ps.write('return 2') +t = transaction.get() +t.note('Change 2') +t.commit() +ps.write('return 3') +t = transaction.get() +t.note('Change 3') +t.commit() + +def tearDown(self): +# get rid of ZODB +transaction.abort() +self.connection.close() +self.s.close() +del self.root +del self.connection +del self.s +shutil.rmtree(self.dir) + +def test_manage_change_history(self): +r = self.ps.manage_change_history() +self.assertEqual(len(r),3) # three transactions +for i in range(3): +entry = r[i] +# check no new keys show up without testing +self.assertEqual(len(entry.keys()),7) +# the transactions are in newest-first order +self.assertEqual(entry['description'],'Change %i' % (3-i)) +self.failUnless('key' in entry) +# lets not assume the size will stay the same forever +self.failUnless('size' in entry) +self.failUnless('tid' in entry) +self.failUnless('time' in entry) +if i: +# check times are increasing +self.failUnless(entry['time']r[i-1]['time']) +self.assertEqual(entry['user_name'],'') +self.assertEqual(entry['version'],'') + +def test_manage_historyCopy(self): +# we assume this works 'cos it's tested above +r = self.ps.manage_change_history() +# now we do the copy +self.ps.manage_historyCopy( +keys=[r[2]['key']] + ) +# do a commit, just
[Zope-Checkins] SVN: Products.Five/trunk/ Merging alecm-viewlet-support -r67779:67780 to add supports for viewlets on trunk.
Log message for revision 67811: Merging alecm-viewlet-support -r67779:67780 to add supports for viewlets on trunk. Changed: U Products.Five/trunk/README.txt A Products.Five/trunk/browser/ProviderExpression.py U Products.Five/trunk/browser/TrustedExpression.py U Products.Five/trunk/browser/pagetemplatefile.py A Products.Five/trunk/browser/tests/provider.txt A Products.Five/trunk/browser/tests/provider.zcml A Products.Five/trunk/browser/tests/provider_error.pt A Products.Five/trunk/browser/tests/provider_messagebox.pt A Products.Five/trunk/browser/tests/provider_namespace.pt A Products.Five/trunk/browser/tests/provider_namespace2.pt A Products.Five/trunk/browser/tests/test_provider.py A Products.Five/trunk/viewlet/ -=- Modified: Products.Five/trunk/README.txt === --- Products.Five/trunk/README.txt 2006-05-01 21:03:36 UTC (rev 67810) +++ Products.Five/trunk/README.txt 2006-05-01 22:05:06 UTC (rev 67811) @@ -36,6 +36,8 @@ * Zope 2 security declarations in ZCML instead of in Python code. +* Content Providers and Viewlets + Together with another product, CMFonFive, Five can integrate into CMF. For more information, see ``doc/features.txt``. Copied: Products.Five/trunk/browser/ProviderExpression.py (from rev 67780, Products.Five/branches/alecm-viewlet-support/browser/ProviderExpression.py) Modified: Products.Five/trunk/browser/TrustedExpression.py === --- Products.Five/trunk/browser/TrustedExpression.py2006-05-01 21:03:36 UTC (rev 67810) +++ Products.Five/trunk/browser/TrustedExpression.py2006-05-01 22:05:06 UTC (rev 67811) @@ -25,6 +25,8 @@ getEngine, installHandlers,\ SecureModuleImporter +from ProviderExpression import ProviderExpr + from ReuseUtils import rebindFunction ModuleImporter = SecureModuleImporter @@ -52,7 +54,7 @@ if isinstance(path, str): path = path.split('/') else: path=list(path) - + REQUEST = get(ob, 'REQUEST', None) if REQUEST is None: REQUEST=FakeRequest() @@ -91,7 +93,7 @@ raise KeyError(name) object = o continue - + t=get(object, '__bobo_traverse__', M) if t is not M: o=t(REQUEST, name) else: @@ -123,18 +125,21 @@ __init__ = rebindFunction(StringExpr.__init__.im_func, PathExpr=PathExpr, ) - + + installHandlers = rebindFunction(installHandlers, PathExpr=PathExpr, StringExpr=StringExpr, PythonExpr=PythonExpr, ) +def installHandlers2(engine): +installHandlers(engine) +engine.registerType('provider', ProviderExpr) + _engine=None getEngine = rebindFunction(getEngine, _engine=_engine, - installHandlers=installHandlers + installHandlers=installHandlers2 ) - - Modified: Products.Five/trunk/browser/pagetemplatefile.py === --- Products.Five/trunk/browser/pagetemplatefile.py 2006-05-01 21:03:36 UTC (rev 67810) +++ Products.Five/trunk/browser/pagetemplatefile.py 2006-05-01 22:05:06 UTC (rev 67811) @@ -33,10 +33,10 @@ Uses Zope 2's engine, but with security disabled and with some initialization and API from Zope 3. - + def __init__(self, filename, _prefix=None, content_type=None): # XXX doesn't use content_type yet - + self.ZBindings_edit(self._default_bindings) path = self.get_path_from_prefix(_prefix) @@ -53,8 +53,8 @@ PageTemplateFile.__init__(self, self.filename, _prefix) except: pass - - + + def get_path_from_prefix(self, _prefix): if isinstance(_prefix, str): path = _prefix @@ -62,24 +62,24 @@ if _prefix is None: _prefix = sys._getframe(2).f_globals path = package_home(_prefix) -return path +return path _cook = rebindFunction(PageTemplateFile._cook, getEngine=getEngine) - + pt_render = rebindFunction(PageTemplateFile.pt_render, getEngine=getEngine) def _pt_getContext(self): try: root = self.getPhysicalRoot() -view = self._getContext() except AttributeError: -# self has no attribute getPhysicalRoot. This typically happens -# when the template has no proper acquisition context. -# That also means it has no view. /regebro root = self.context.getPhysicalRoot() -view = None +# Even if the context isn't a view (when would
[Zope-Checkins] SVN: Products.Five/trunk/CHANGES.txt Updated CHANGES
Log message for revision 67812: Updated CHANGES Changed: U Products.Five/trunk/CHANGES.txt -=- Modified: Products.Five/trunk/CHANGES.txt === --- Products.Five/trunk/CHANGES.txt 2006-05-01 22:05:06 UTC (rev 67811) +++ Products.Five/trunk/CHANGES.txt 2006-05-02 01:07:42 UTC (rev 67812) @@ -2,6 +2,14 @@ Five Changes +Five 1.5 (unreleased) += + +Features + + +* Added Viewlet and Content Provider support. + Five 1.4 (unreleased) = ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/alecm-viewlet-support/ Removing merged branch
Log message for revision 67813: Removing merged branch Changed: D Products.Five/branches/alecm-viewlet-support/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope-dev] Windows Test Failures and XMLExportImport
Benji York wrote: 2000--Zope---branches---2.9--2.4\build\lib\python\OFS\tests\test_XMLExportImport.py, I suspect the following pattern needs to be changed: ostream = tempfile.NamedTemporaryFile(suffix='.xml') try: data = exportXML(connection, oid, ostream) ostream.flush() sub._importObjectFromFile(ostream.name, 0, 0) finally: ostream.close() ..since I bet the file created will be locked, and when the read line after the flush tries to read, it's told it can't... gotta love windows file semantics :-( 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] Re: Help with two strange errors.
On 4/30/06, Lennart Regebro [EMAIL PROTECTED] wrote: Also, the ZServer test seems to leave cruft behind. Possibly a thread, that the gets detected by the zope.server tests, because it will complain that a thread is left behind by those test, while if I skip the ZServer tests with -t '!ZServer' it works fine. In fact, you get this problem with trunk as well, so no matter. :-) I ran it with trunk, and didn't get the error, so I thought it was only my branch. But I was just unlucky. It seems that this error comes up about 9 times of ten on both branches. Still: Does anybody with more experience of those things have any good idea of how to debug that? We might wanna figure out if it is purely a testing error or not... So, only the weird import mmap-problem remains. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.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] Windows Test Failures and XMLExportImport
Chris Withers wrote: I suspect the following pattern needs to be changed: ostream = tempfile.NamedTemporaryFile(suffix='.xml') try: data = exportXML(connection, oid, ostream) ostream.flush() sub._importObjectFromFile(ostream.name, 0, 0) finally: ostream.close() Yep, that looks like it. Either I'll make my first commit to Zope 2 ever :) or if you want to, you can change it to something like this: import tempfile import os fname = 'import_export.xml' tempdir = tempfile.mkdtemp() try: ostream = open(fname, 'wb') try: data = exportXML(connection, oid, ostream) finally: ostream.close() sub._importObjectFromFile(fname, 0, 0) finally: os.rmdir(tempdir) Thanks for looking into this. -- Benji York Senior Software Engineer Zope Corporation ___ 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] Windows Test Failures and XMLExportImport
Benji York wrote: Yep, that looks like it. Either I'll make my first commit to Zope 2 ever :) or if you want to, you can change it to something like this: import tempfile import os fname = 'import_export.xml' tempdir = tempfile.mkdtemp() try: ostream = open(fname, 'wb') try: data = exportXML(connection, oid, ostream) finally: ostream.close() sub._importObjectFromFile(fname, 0, 0) finally: os.rmdir(tempdir) Thanks for looking into this. I'm actually trying to write some tests for historyCopy, so I'm seeing these failrues when I run the OFS tests, so I'll fix 'em... However, if you can point me in the direction of any tests that use a scratch ZODB to test ZODB-stuff (ie: historyCopy in my case...) I'd be very greatful if you could point me at them. Also, if I do a writeable checkout of Zope 2 trunk or Zope 2.9 branch, any ideas how I then compile things suchthat I can run the tests, and how do I run the tests once I've successfully compiled everything? 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] buildbot svn failures?
Hi All, Any idea what's causing the svn failrues on the buildbot. This only seems to be affecting the Windows builds, with the Zope 2 3 trunk not currently building... 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] i18n for 'structure' in TAL
Hi there, i18n doesn't actually work for things marked as 'structure' in a page template in both Zope 2 and Zope 3. Zope 2 does do this with PlacelessTranslationService (through some tortuous route I won't go into). I think in practice large systems such as Plone, Silva and CPS are all translating snippets with bits of HTML in there, so i18n for structure is important. Zope 2 + Five i18n work however. Zope 3 presumably doesn't work either. I have a monkey patch lying around that fixes this in Zope 2.x and I could check the fix in directly (and fix it Zope 3.3 trunk too), if there are no objections. I realize we're getting close to a release and we're in feature freeze now, so this may be considered to be too large a change for this round. Regards, Martijn ___ 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] Zope 2.10: Remaining tasks
Philipp von Weitershausen wrote: The feature freeze date for the June release is only days away. It was planned to be May 1st, but due to lots of pending branches, we might let it slip for a *couple* of days (not more!). I've compiled a rough list of outstanding tasks for Zope 2.10: http://www.zope.org/Wikis/DevSite/Projects/Zope2.10/Tasks Please complete and/or correct this list. Unicode in Zope 2 sounds like a big and nebulous topic about storing unicode in Zope 2. I hope this one is definitely off the agenda for Zope 2.10 as the changes are possibly quite wide ranging. Regards, Martijn ___ 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] Zope 2.10: Remaining tasks
--On 1. Mai 2006 18:46:07 +0200 Martijn Faassen [EMAIL PROTECTED] wrote: Philipp von Weitershausen wrote: The feature freeze date for the June release is only days away. It was planned to be May 1st, but due to lots of pending branches, we might let it slip for a *couple* of days (not more!). I've compiled a rough list of outstanding tasks for Zope 2.10: http://www.zope.org/Wikis/DevSite/Projects/Zope2.10/Tasks Please complete and/or correct this list. Unicode in Zope 2 sounds like a big and nebulous topic about storing unicode in Zope 2. I hope this one is definitely off the agenda for Zope 2.10 as the changes are possibly quite wide ranging. I don't think that there is any related code :-) -aj -- ZOPYX Ltd. Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope Plone development, Consulting pgpigV9RJbtJA.pgp Description: 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 )
Re: [Zope-dev] Re: Zope 2.10: Remaining tasks
On 4/29/06, Florent Guillaume [EMAIL PROTECTED] wrote: It is up to the release managers (Stephan, Andreas) and the Pope to decide the exact feature freeze date, but I would suggest that we start merging those branches real soon. Some crucial branches, namely the 3.3 integration is scheduled for 2dn or 3rd, so I guess a release will be the 3rd or 4th. Good enough for me. I've fixed my stuff now in any case. One remaining question about my stuff remains: Why, after my changes, it is possible to import mmap in a PythonScript if and only if, you have Twisted installed...!?!? Temporarily I changed the test from import mmap to from datetime import datetime which still raises an error. Another small task I know Julien Anguenot would like to do is fix the zpt engine (in Zope 3 I guess now) to work properly with mixed html/xhtml inclusion of macros. He's done most of the work with Fred Drake at the end of last year, but never got around to intergrate it. I'd see that as a bugfix, so he can fix it anyway, but of course, if it's included in the first release it will get better tested. :-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.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] Zope 2.10: Remaining tasks
Martijn Faassen wrote: Philipp von Weitershausen wrote: The feature freeze date for the June release is only days away. It was planned to be May 1st, but due to lots of pending branches, we might let it slip for a *couple* of days (not more!). I've compiled a rough list of outstanding tasks for Zope 2.10: http://www.zope.org/Wikis/DevSite/Projects/Zope2.10/Tasks Please complete and/or correct this list. Unicode in Zope 2 sounds like a big and nebulous topic about storing unicode in Zope 2. I hope this one is definitely off the agenda for Zope 2.10 as the changes are possibly quite wide ranging. I just noticed this today. :) I'm not sure where it came from. I've just removed this entry. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.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 )