On May 12, 4:45 am, samwyse <samw...@gmail.com> wrote:
> Unfortunately, 'boilerplate()' uses the handlers that I provide when
> MetaBlog is instantiated.

In that case, the handler functions should be attributes of the
instance, not of the class.  Do something like this:

class MetaBlog(object):
    def __init__(self):
        self.blog = blogHander()
        for name in self.blog.get_methods():
            setattr(self,name,self.boilerplate(name))

    def boilerplate(self,name):
        method = getattr(self.blog,name)
        def template(*args):
            self.do_verification_here()
            method(*args)
        return template


Carl Banks
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to