On Wed, 2004-02-25 at 04:22, Max Ischenko wrote:
Aaron Held wrote:
in context/__init__.py
from MiscUtils.MixIn import MixIn
from WebKit.Session import Session
from MaxUtils import NotifyCode
class SessionMixIn:
def expiring(self):
NotifyCode('Session is ending')
Jason Hildebrand wrote:
storytime
Several years ago I wrote a framework in PHP which provided a lot of
callbacks for customization. On problem I ran into is that depending on
how you need to customize, you might want to execute some code before,
instead of, or after an event:
preCommit()
On Wed, 2004-02-25 at 13:37, Aaron Held wrote:
Personally I would be against subclassing a 'core' class such as
sessions,
I would rather see some hooks for calling implementation specific
code.
Hi Aaron,
I'm curious as to your rationale for preferring hooks over using subclasses
to do
Aaron Held wrote:
in context/__init__.py
from MiscUtils.MixIn import MixIn
from WebKit.Session import Session
from MaxUtils import NotifyCode
class SessionMixIn:
def expiring(self):
NotifyCode('Session is ending')
# Now inject the methods from SessionMixIn into Session
I'm not sure if the Mixin is the way to go with what you are thinking.
Personally I would be against subclassing a 'core' class such as sessions,
I would rather see some hooks for calling implementation specific code.
This could even give contexts a reason to exists!
Something like
def
Aaron Held wrote:
I'm not sure if the Mixin is the way to go with what you are thinking.
Personally I would be against subclassing a 'core' class such as sessions,
I would rather see some hooks for calling implementation specific code.
Completely agree here. By having found no such hooks, the
Hi.
Is it possible to register a callback in WebKit so that my code would be
notified when the session ends?
thanks.
---
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps Web services for Linux with
a free DVD
in context/__init__.py
from MiscUtils.MixIn import MixIn
from WebKit.Session import Session
from MaxUtils import NotifyCode
class SessionMixIn:
def expiring(self):
NotifyCode('Session is ending')
# Now inject the methods from SessionMixIn into Session
MixIn(Session, SessionMixIn)