[Zope-dev] Refer to zope attribute or object in source
In PropertySheets.py of zope/lib/python/OFS def xml_escape(v): . return unicode(v, "latin-1").encode("utf-8") Are there anyway to substitute the "latin-1" with an attribute of the zope site's attribute say: "zope-charset" which a site maintainer can modify through the web? I raise this question because the current-cvs version of zope is turned into unicode, but all the source everywhere is assumed that the data input is "latin-1" but I am very sure that it will not always the case. Some sites simply don't work in that assumption, turning many sites using zope stop upgrade or stop using zope. This will seriously hurt the zope community. The initial act to make zope understand unicode is to help zope internationalize, but the actual effect was not. I urge the zope developer, the zope coporation as well as product developers (some products like ieDocument and worldPilot have "8859-1" specified in their source) alert on this issue, and take action before it is too late. The best solution I could come up with is to allow individual site manager to choose its default charset and allow other site-branch manager to overwrite it with acquisition, thus the attribute zope-charset will be used to determine both the "Content-type: text/plain; charset="" and the code convertion of Zope like PropertySheets.py __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com ___ 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] Extension class and __init__
Ross Boylan wrote: > class ECSpam(Base, Spam): #Base is an ExtensionClass > def __init__(self): > ECSpam.inheritedAttribute('__init__')(self) > > > What if you have more than one base class with the method defined? The normal Python inheritted attribute lookup rules: depth first, left to right through the list of base classes. > The implication of th example is that the non-extension class base > class is used If Spam defines __init__ and Base doesn't, that would be the case... > (though even that is not clear; would this work if Base > had __init__?), No, in that case Base's __init__ would be used, see python inheritence rules. > but what if there are several non-extension base > classes? See python inheritence rules... > The syntax doesn't provide a way of indicating which class you want > the method from, and so it seems incomplete. Well, if you wanted it to come from Base specifically, you could do: Base.inheritedAttribute('__init__')(self) not sure about the non-EC bases, perhaps Jim could clarify this? cheers, Chris > > ___ > 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 )
Re: [Zope-dev] Extension class and __init__
From: "Adrian Hungate" <[EMAIL PROTECTED]> > Erm... that trashes the concept of mixin's, doesn't it? No, why would it? Just make your mixins inherit Extentionclass.base! If you have third-party mixins that aren't made for Zope from the beginning and need initailization, then you probably have to Zopify them first. I don't see how this is convoluted. It's not obvious to non-Zope gurus, but that is what comments are for. :-) ___ 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 )