Re: [Zope-dev] Re: Re: Re: favicon.ico for 2.10?
Duncan Booth wrote: What may be more significant is that simply retrieving favicon.ico into IE displays garbage. I don't know why; IE seems perfectly capable of displaying it on the address bar or favourites, but in the main browser window it displays a short curved line and nothing else. Is the method that's returning it setting the right content type? 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] Re: [Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py External methods can now live outside of Products based python packages.
Note that Zope2.app() opens a new ZODB connection which you need to close at some point. I suggest something along the lines of: app = Zope2.app() try: products = app.Control_Panel.Products ... finally: app._p_jar.close() I am also wondering if this code would break if a product was removed from the file system, but still had its persistent part hanging around in Control_Panel.Products. Stefan On 2. Mai 2006, at 22:59, Rocky Burt wrote: Log message for revision 67869: External methods can now live outside of Products based python packages. Changed: U Zope/trunk/lib/python/App/FactoryDispatcher.py -=- Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py === --- Zope/trunk/lib/python/App/FactoryDispatcher.py 2006-05-02 20:57:53 UTC (rev 67868) +++ Zope/trunk/lib/python/App/FactoryDispatcher.py 2006-05-02 20:59:07 UTC (rev 67869) @@ -13,12 +13,36 @@ # Implement the manage_addProduct method of object managers +import types import Acquisition, sys, Products from Globals import InitializeClass from AccessControl import ClassSecurityInfo from AccessControl.PermissionMapping import aqwrap from AccessControl.Owned import UnownableOwner +import Zope2 +def _product_packages(): +Returns all product packages including the regularly defined +zope2 packages and those without the Products namespace package. + + +old_product_packages = {} +for x in dir(Products): +m = getattr(Products, x) +if isinstance(m, types.ModuleType): +old_product_packages[x] = m + +packages = {} +products = Zope2.app().Control_Panel.Products +for product_id in products.objectIds(): +product = products[product_id] +if hasattr(product, 'package_name'): +packages[product_id] = __import__(product.package_name) +elif old_product_packages.has_key(product_id): +packages[product_id] = old_product_packages[product_id] + +return packages + class ProductDispatcher(Acquisition.Implicit): # Allow access to factory dispatchers @@ -32,7 +56,7 @@ # Try to get a custom dispatcher from a Python product dispatcher_class=getattr( -getattr(Products, name, None), +_product_packages().get(name, None), '__FactoryDispatcher__', FactoryDispatcher) ___ Checkins mailing list [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/checkins -- Anything that happens, happens. --Douglas Adams ___ 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: Twisted in Zope 2.10 ..some issues
On 5/3/06, Andreas Jung [EMAIL PROTECTED] wrote: I tried to get Zope 2.10 working with Twisted however I ran into some issues: After installing Twisted 2.1.0, Zope fails to start (also with Twisted 2.2.0)...anything I am misssing? Yes, but what? Hmmm. (Oh, btw, 2.2 seems much slower that 2.1 and trunk...) raise ComponentLookupError(interface, name) zope.component.interfaces.ComponentLookupError: (InterfaceClass zope.app.twisted.interfaces.IServerType, 'Zope2-HTTP') OK, that one gets registered in Zope2/Startup/handlers.py, and it only gets registered if it can import twisted, in the beginning of the file. Could you see what doesn't get imported? I also wonder why 'type' is set to 'Zope2-HTTP' (something like Twisted-Zope would perhaps be a better name?!). 'Zope2-HTTP' reminds me of ZServer..it there a special reasons for choosing this name? Because you are telling Twisted what to do, and not the other way around. ;) We could rename the server block twisted-server. That might be clearer. -- 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 )
[Zope-dev] Re: [Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py External methods can now live outside of Products based python packages.
On Thu, 2006-04-05 at 10:43 +0200, Stefan H. Holek wrote: Note that Zope2.app() opens a new ZODB connection which you need to close at some point. I suggest something along the lines of: app = Zope2.app() try: products = app.Control_Panel.Products ... finally: app._p_jar.close() I am also wondering if this code would break if a product was removed from the file system, but still had its persistent part hanging around in Control_Panel.Products. Hmm... good points, I'll look into this. - Rocky On 2. Mai 2006, at 22:59, Rocky Burt wrote: Log message for revision 67869: External methods can now live outside of Products based python packages. Changed: U Zope/trunk/lib/python/App/FactoryDispatcher.py -=- Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py === --- Zope/trunk/lib/python/App/FactoryDispatcher.py 2006-05-02 20:57:53 UTC (rev 67868) +++ Zope/trunk/lib/python/App/FactoryDispatcher.py 2006-05-02 20:59:07 UTC (rev 67869) @@ -13,12 +13,36 @@ # Implement the manage_addProduct method of object managers +import types import Acquisition, sys, Products from Globals import InitializeClass from AccessControl import ClassSecurityInfo from AccessControl.PermissionMapping import aqwrap from AccessControl.Owned import UnownableOwner +import Zope2 +def _product_packages(): +Returns all product packages including the regularly defined +zope2 packages and those without the Products namespace package. + + +old_product_packages = {} +for x in dir(Products): +m = getattr(Products, x) +if isinstance(m, types.ModuleType): +old_product_packages[x] = m + +packages = {} +products = Zope2.app().Control_Panel.Products +for product_id in products.objectIds(): +product = products[product_id] +if hasattr(product, 'package_name'): +packages[product_id] = __import__(product.package_name) +elif old_product_packages.has_key(product_id): +packages[product_id] = old_product_packages[product_id] + +return packages + class ProductDispatcher(Acquisition.Implicit): # Allow access to factory dispatchers @@ -32,7 +56,7 @@ # Try to get a custom dispatcher from a Python product dispatcher_class=getattr( -getattr(Products, name, None), +_product_packages().get(name, None), '__FactoryDispatcher__', FactoryDispatcher) ___ Checkins mailing list [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/checkins -- Anything that happens, happens. --Douglas Adams ___ 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 ) -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server -- http://www.serverzen.net ___ 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: Re: Re: favicon.ico for 2.10?
On 5/4/06, Chris Withers [EMAIL PROTECTED] wrote: Duncan Booth wrote: What may be more significant is that simply retrieving favicon.ico into IE displays garbage. I don't know why; IE seems perfectly capable of displaying it on the address bar or favourites, but in the main browser window it displays a short curved line and nothing else. Is the method that's returning it setting the right content type? image/x-icon, is that correct? -- 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 )
[Zope-dev] Re: [Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py External methods can now live outside of Products based python packages.
On Thu, 2006-04-05 at 08:23 -0230, Rocky Burt wrote: On Thu, 2006-04-05 at 10:43 +0200, Stefan H. Holek wrote: Note that Zope2.app() opens a new ZODB connection which you need to close at some point. I suggest something along the lines of: app = Zope2.app() try: products = app.Control_Panel.Products ... finally: app._p_jar.close() I am also wondering if this code would break if a product was removed from the file system, but still had its persistent part hanging around in Control_Panel.Products. Hmm... good points, I'll look into this. Actually, this brings up something I've been wondering about. Everytime I call Zope2.app() inside a test case it gives me a new obj with a reset Control_Panel. Am I doing something wrong here? Perhaps there's a better way to go about this? - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server -- http://www.serverzen.net ___ 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: Re: Re: Re: favicon.ico for 2.10?
Chris Withers wrote: Duncan Booth wrote: What may be more significant is that simply retrieving favicon.ico into IE displays garbage. I don't know why; IE seems perfectly capable of displaying it on the address bar or favourites, but in the main browser window it displays a short curved line and nothing else. Is the method that's returning it setting the right content type? I've tried 3 mime types: application/octet_stream: The icon displays correctly in Firefox and incorrectly in IE, other favicon.ico files I've tried with this mime type display correctly in IE. image/x-icon: The same incorrect display in IE and correct display in FF. image/vnd.microsoft.icon: Still displays correctly in FF, but IE decides to dump it as characters instead of displaying a graphic at all. ___ 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 )