Actually, I designed the Visit Tracking system to support plug ins: that's how Identity works. You need to create an extension (see an earlier email "TurboGears Extensions & EGGs") and in that extension register a Visit plug in. The relevant line in Identity's extension start-up function is:

    visit.enable_visit_plugin( IdentityVisitPlugin() )

A Visit Tracking plug in must expose the following methods:

    new_visit( self, visit_id )
    record_request( self, visit_id )

The `new_visit` method will be called when Visit Tracking determines that this request represents the first request in a visit (when the cookie doesn't already exist or has expired). And `record_request` is called in all other cases.

The return value of these methods is not significant.

Because Visit Tracking plug-ins are TG extensions, they are required to check a config variable to determine whether they are enabled. If they aren't enabled, obviously, they shouldn't register as a Visit Tracking plug in.


On 4 Feb, 2006, at 6:04 am, rick wrote:

I see your point.. however.. the current visit system doesnt seem very
"plugginable" and any  attempts to make it so would get rid of the
"leanness" of which you speak.

--
Jeff Watkins

"Computers are like Old Testament gods; lots of rules and no mercy."
-- Joseph Campbell


Reply via email to