[Zope-dev] Yenilenen noseks iuijf
FULL 2002 YAPIMI PORNO VIDEOLAR Sitemize yeni filmler eklendi. Tam metraj, full kalite Yenilenen Kategoriler: AMATEUR ANAL ASIAN LESBIAN Ýyi eðlenceler, http://www.noseks.com id: zope-dev - kinygaqhvkxbyfmvnxbekjaovpekaphnxuofwf- h¥àÞ¾f¢X¬µ)x7¯Î^¢¸!¶ÚþX¬¶Ìè¥ê+ùYùb²Ø§~ó¢zóhrº,²,¶Ê+3zw(v)àEéZµçeËlÛiÿùb²Û3¢¨®æj)fjåËbú?Î^jyèºwÛiÿùb²Û3¢¨®æj)fjåËbú?Î^
[Zope-dev] KeywordIndex and PersistentList (Bug?)
Hi! In KeywordIndex the newKeywords get called if they are callable: def _get_object_keywords(self,obj): newKeywords = getattr(obj, self.id, ()) if callable(newKeywords): # (*) newKeywords = newKeywords() if hasattr(newKeywords,'capitalize'): # is it string-like ? newKeywords = (newKeywords, ) return newKeywords This fails if the newKeywords are stored in a PersistentList. Callable is true, but there is no __call__ attribute. I changed the line marked with (*) to if hasattr(newKeyword, __call__): and this seems to work I think this does not break anything and could be included in the original. Am I the first how uses PersistentList for an indexed attribute? Is there a reason not to do so? thomas Please CC to me I am not on the list yet -- Thomas Guettler [EMAIL PROTECTED] http://www.thomas-guettler.de ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] RDB connections and cursors
On Tue, 2002-11-19 at 20:10, Dieter Maurer wrote: Leonardo Rochael Almeida writes: ... Assuming my reasoning above is correct we should be able to create a single connection and a single cursor on __setstate__ of the DA connector instance of the ZODB. The transaction boundaries would be handled normally, but since a worker thread only handles one request at a time, there's no need to close the cursor nor the connection at the transaction end. Isn't this precisely how most existing DA's work? erm... indeed yes. I Should've researched a bit more... -- Ideas don't stay in some minds very long because they don't like solitary confinement. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] KeywordIndex and PersistentList (Bug?)
Thomas Guettler wrote: Hi! In KeywordIndex the newKeywords get called if they are callable: def _get_object_keywords(self,obj): newKeywords = getattr(obj, self.id, ()) if callable(newKeywords): # (*) newKeywords = newKeywords() if hasattr(newKeywords,'capitalize'): # is it string-like ? newKeywords = (newKeywords, ) return newKeywords This fails if the newKeywords are stored in a PersistentList. Callable is true, but there is no __call__ attribute. I changed the line marked with (*) to if hasattr(newKeyword, __call__): and this seems to work I think this does not break anything and could be included in the original. Am I the first how uses PersistentList for an indexed attribute? Is there a reason not to do so? The KeywordIndex should be changed to check for the __call__ attribute, rather than relying on 'callable'. You cannot reliably use 'callable' when you're also using acquisition wrappers. See my comment to this Collector report. http://collector.zope.org/Zope/578 I suggest you report the bug you have found in the Collector. -- Steve Alexander ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] KeywordIndex and PersistentList (Bug?)
Just a note that this can't be put in Zope 2.6 since functions and methods don't have a __call__ in Python 2.1. -Casey On Wednesday 20 November 2002 02:33 pm, Steve Alexander wrote: Thomas Guettler wrote: Hi! In KeywordIndex the newKeywords get called if they are callable: def _get_object_keywords(self,obj): newKeywords = getattr(obj, self.id, ()) if callable(newKeywords): # (*) newKeywords = newKeywords() if hasattr(newKeywords,'capitalize'): # is it string-like ? newKeywords = (newKeywords, ) return newKeywords This fails if the newKeywords are stored in a PersistentList. Callable is true, but there is no __call__ attribute. I changed the line marked with (*) to if hasattr(newKeyword, __call__): and this seems to work I think this does not break anything and could be included in the original. Am I the first how uses PersistentList for an indexed attribute? Is there a reason not to do so? The KeywordIndex should be changed to check for the __call__ attribute, rather than relying on 'callable'. You cannot reliably use 'callable' when you're also using acquisition wrappers. See my comment to this Collector report. http://collector.zope.org/Zope/578 I suggest you report the bug you have found in the Collector. -- Steve Alexander ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Dynamically altering Product methods
Hello, I've been playing a bit with the current implementation of WebService that is availalble from Zope.org. I have tried to adapt the ServiceProxy to a Zope Product, so that a user can simply drop such a WebServiceProxy in a Folder, type-in the URL of a WSDL file and then call the methods described in the WSDL on the WebServiceProxy. A first prototype incorporated a ServiceProxy instance and offered hard-coded methods: def __init__(self, id): self.id = id self.gsp = ServiceProxy(http://api.google.com/GoogleSearch.wsdl;) security.declarePublic('doSpellingSuggestion') def doSpellingSuggestion(self, key, phrase): Checks the phrase for correct spelling return self.gsp.doSpellingSuggestion(key, phrase) It works well, except for a persistence problem that got me stuck for a while. The WebService package makes use of weakrefs, and I guess this caused problems. However, removing the usage of weakrefs in ServiceProxy alone seemed to solve the problem. (If someone can explain that to me, I'm listening!) While this small test worked well, I wanted to do better: notably, I want the user to be able to change the WSDL on the fly, without needing to destroy the object and to add a new one, and also, I want the user to be able to alter the permission settings for each method in the Web Service. Well, it seems my wishes have made me enter quite a strange realm of low-level Zope mechanisms, which I don't always fully grasp! My current implementation suffers from heavy persistence problems, and contains the following significant code: def setWSDL(self, wsdl, service=None, port=None): Sets the Web Service this object proxies. This resets all the Web Service methods information, notably the security settings. # Remove old WSDL data if hasattr(self, '_serializer'): binding = self._port.getBinding() portType = binding.getPortType() for item in portType.operations: delattr(self, item.name) delattr(self, item.name+'__roles__') del self._wsdl del self._name del self._port del self._service del self._transport del self._serializer # Add new WSDL data self._security = ClassSecurityInfo() declareStaticPermissions(self._security) # This code mostly comes from WebService.ServiceProxy if not hasattr(wsdl, 'targetNamespace'): wsdl = WSDLReader().loadFromURL(wsdl) self._serializer = Serializer() self._transport = HTTPTransport() for item in wsdl.types.items(): self._serializer.loadSchema(item) self._service = wsdl.services[service or 0] self._port = self._service.ports[port or 0] self._name = self._service.name self._wsdl = wsdl binding = self._port.getBinding() portType = binding.getPortType() for item in portType.operations: callinfo = callInfoFromWSDL(self._port, item.name) method = MethodProxy(self, callinfo) setattr(self, item.name, method) # Default security for the Web Service methods self._security.declareProtected('Use Web Service', item.name) self._security.apply(self) InitializeClass(self) declareStaticPermissions() is a module-level function that declares the security settings for my so-called static methods, such as setWSDL, which are intended to always be present in the WebServiceProxy. Now, when I use this product, it works well the first time. I can set the WSDL to the Google Web Service, and then call its spellchecking method successfully. However, as soon as persistence comes into play, I'm toast. Simply switching directories a few times is enough for that. I then get the following error: 2002-11-20T12:20:45 ERROR(200) ZODB Couldn't load state for '\x00\x00\x00\x00\x00\x00\n\xa5' Traceback (innermost last): Module ZODB.Connection, line 533, in setstate TypeError: ('expected 1 arguments, got 0', extension class AccessControl.cAccessControl.PermissionRole at 00E35258, ()) I have spent quite some time debugging this last night. Line 533 in ZODB.Connection is state = unpickler.load() and the message means (it took some time to understand!) that unpickler.load() did not return anything. Also, once this happens, I find myself with two copies of my WebServiceProxy. From the extreme details of the cache: 1 '\x00\x00\x00\x00\x00\x00\n\xa5'0 G Products.WebServiceProxy.WebServiceProxy.WebServiceProxy 3 '\x00\x00\x00\x00\x00\x00\n\xa5'4 L Products.WebServiceProxy.WebServiceProxy.WebServiceProxy (google) which I guess is very bad from a consistency point-of-view. Well, I hope you're still reading me. Here are my questions: * Am doing something obviously wrong or stupid? * Is delattr(self, item.name+'__roles__') enough to
Re: [Zope-dev] KeywordIndex and PersistentList (Bug?)
What about ``if callable(aq_base(newKeywords)):`` to remove potential acquisition wrappers? On Wednesday, November 20, 2002, at 12:41 PM, Casey Duncan wrote: Just a note that this can't be put in Zope 2.6 since functions and methods don't have a __call__ in Python 2.1. -Casey On Wednesday 20 November 2002 02:33 pm, Steve Alexander wrote: Thomas Guettler wrote: Hi! In KeywordIndex the newKeywords get called if they are callable: def _get_object_keywords(self,obj): newKeywords = getattr(obj, self.id, ()) if callable(newKeywords): # (*) newKeywords = newKeywords() if hasattr(newKeywords,'capitalize'): # is it string-like ? newKeywords = (newKeywords, ) return newKeywords This fails if the newKeywords are stored in a PersistentList. Callable is true, but there is no __call__ attribute. I changed the line marked with (*) to if hasattr(newKeyword, __call__): and this seems to work I think this does not break anything and could be included in the original. Am I the first how uses PersistentList for an indexed attribute? Is there a reason not to do so? The KeywordIndex should be changed to check for the __call__ attribute, rather than relying on 'callable'. You cannot reliably use 'callable' when you're also using acquisition wrappers. See my comment to this Collector report. http://collector.zope.org/Zope/578 I suggest you report the bug you have found in the Collector. -- Steve Alexander ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )