Re: [Zope-dev] more __call__ ...
Jim Fulton wrote: http://a.site/folder/object/myobject myobject contains dtml-var standard_html_header standard_html_header contains dtml-var mynavigator Is myobject a DTMLMethod? Some kind of container? Sorry... a good example for myobject would be a DTML Document. I don't see how it can contain a var tag if it's not DTML. If it is DTML, I don't see where mynavigator fits in. It is DTML, containing the line dtml-var standard_html_header standard_html_header is a DTML Method containing dtml-var mynavigator mynavigator is an object of meta_type 'Navigator' and it's the __call__ method of the Navigator product that I'm having trouble writing :-S So, if I give my product a class attribute of isDocTemp=1, what signature should I give my product's __call__ method so it picks up the DTML namespace? def __call__(self, ignored, md): ... This, of coruse, begs the question as to what 'ignored' is, but I probably don't want to know ;-) No: self.nav_header(None, md) ok.. In any case, what is self in __call__(self, ...) and what should it be in nav_header(self, ...)? Python method signatures always begin with an argument that is the instance to which they are bound. Okay, so in the __call__ case, self will be the mynavigator object? Anyway, the isDocTemp thing seems to be getting somewhere. md is a TemplateDict, and that's a stack of InstanceDict's, right? Now, from what I've seen from playing, the object I've been looking for all along is the one whose InstanceDict is on the top of the md stack. So, two questions: 1. How can I get the top most InstanceDict out of md? is _pop the only way? If so, I would guess I do: x = md._pop(1) md._push(x) to get the InstanceDict without disturting the namespace stack? 2. How would I turn the InstanceDict, x, back into an object? From reading pDocumentTemplate.py, I would guess: obj = x.self Is that right? well, thanks for all the help, I _think_ the end is in sight now ;-) cheers, Chris PS: Once I've got that object, can I still use aq_chain(obj,1) to get the list of obj and its containing parents? (In essence, the PARENTS'y type thing I've been looking for all along ;-) ___ 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] bouncing e-mail
Hi, Has somebody noticed some problems with my e-mail? It looks like my account was turned of at zope-dev. Since I didn't do it, it must be an automatic thing. So my q'n had someone of you problems with my e-mail? Tom. ___ 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] Soft links again
On Wed, 27 Sep 2000 09:06:18 -0400, Shane Hathaway [EMAIL PROTECTED] wrote: Also, there's currently a buglet in acquisition that makes it so that you can only perform the actions on the symlink which "anonymous" is allowed to do. Woooh! Someone else that agrees this is a bug in Acquisition. Full report and patch at http://classic.zope.org:8080/Collector/1066/view Toby Dickenson [EMAIL PROTECTED] ___ 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] Soft links again
Toby Dickenson wrote: On Wed, 27 Sep 2000 09:06:18 -0400, Shane Hathaway [EMAIL PROTECTED] wrote: Also, there's currently a buglet in acquisition that makes it so that you can only perform the actions on the symlink which "anonymous" is allowed to do. Woooh! Someone else that agrees this is a bug in Acquisition. Full report and patch at http://classic.zope.org:8080/Collector/1066/view Not only are you 100% correct, but we were planning to do the same thing! You were several steps ahead of us. The patch works perfectly, although I added a couple of comments. Sorry the patch didn't get applied sooner. Shane ___ 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] structure text
I asked, some time ago, why the StructuredText.py did not work with the example provided in the triple quotes but my email has been patchy. Did anybody reply as to why the :: does not work all the time? Nigel --== Sent via Deja.com http://www.deja.com/ ==-- Before you buy. ___ 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] ZCatalog with UTF-8 Chinese
Dear Developer: Trying to short-cut UNTEXTINDEX to handle UTF-8 Chinese, I need some help. After reading some code of query, I think the regular expression operations which in parse, quotes and parse2 were not safe for utf8 string. So, I decide to emulate what they do. However, I do not understand what getlexicon is doing and I would like to learn what q should looks like before it is passed to evaluate. I do not understand that vocabulary seems to store like integer, is getlexicon a step to look up the string to convert them to integer? I am getting lost. Could some experienced developer help me out of these? Rgs, Kent Sin - kentsin.weblogs.com kentsin.imeme.net def query(self, s, default_operator = Or, ws = (string.whitespace,)): """ This is called by TextIndexes. A 'query term' which is a string 's' is passed in, along with an index object. s is parsed, then the wildcards are parsed, then something is parsed again, then the whole thing is 'evaluated' """ # First replace any occurences of " and not " with " andnot " s = ts_regex.gsub('[%s]+and[%s]*not[%s]+' % (ws * 3), ' andnot ', s) # do some parsing q = parse(s) ## here, we give lexicons a chance to transform the query. ## For example, substitute wildcards, or translate words into ## various languages. q = self.getLexicon(self._lexicon).query_hook(q) # do some more parsing q = parse2(q, default_operator) ## evalute the final 'expression' return self.evaluate(q) ___ 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 )