[Zope] - can't __call__ objects?

Andreas Kostyrka andreas@ag.or.at
Fri, 18 Dec 1998 20:24:49 +0100 (CET)


On Fri, 18 Dec 1998 skip@calendar.com wrote:

From DT_String.py:
    class func_code_class: pass
    func_code=func_code_class()
    func_code.co_varnames='self','REQUEST'
    func_code.co_argcount=2
    func_defaults=()

Or from one of my projects:
class HTMLFile:
    """A HTML File to go trough HTML Templates"""
    classDescriptor="DocumentTemplate"

    def __init__(self,fs,path,suffix=""):
        self.fs=fs
        self.path=path

    class func_code_class: pass
    func_code=func_code_class()
    func_code.co_varnames='self','REQUEST'
    func_code.co_argcount=2
    func_defaults=()

    def __call__(self,client=None,mapping={},**kw):
        return apply(HTML(self.fs.readFile(self.path)),(client,mapping,),kw)

Andreas