This module contains a simple tracker implementation which makes it easy to directly track your own objects. It also defines a mixin which defines the tracking protocol.
Bases: pytracker.tracker.TrackerMixin, dict
This is a sample tracker object which can be used directly, or as a model for implementing custom tracker objects.
Class variable to specify the class used to track types
alias of TrackedType
Dumps the object tracking table to stdout or to the given file object.
Triggered whenever a new trackable object is created.
Triggered when an object being tracked is freed.
Triggered whenver an existing trackable object is no longer being racked.
Triggered when the data bundle for a currently tracked object is changed.
Clears any tracked objects for the given class. Does nothing if object tracking is not enabled for this class.
Enables tracking of objects for the given class. If tracking is disabled, all object history is lost.
Bases: object
Internal class used to track a given object type. May be subclassed and assigned to pytracker.Tracker.type_tracker to override the default implementation.
Prints the status of all allocated objects for this type to stdout or an optional file object.
Called by the tracker to register tracking for a given live object.
Called by the tracker to indicate that an object is no longer live.
Contains the number of instances currently allocated for the type
Contains the number of instances which have been deallocated
Contains an optional dictionary for tracking objects by serial number
Contains the type of the tracked object
Set to True to track objects individually. Defaults to False.
Bases: object
This class defines the protocol which must be supported by objects which are assigned to trackable objects using Trackable._set_tracker() or pytracker.set_global_tracker().
Note that the pytracker.Trackable class does not require that all of these methods be defined. In fact, if they are not defined, there will be no error and the notification will not be sent. As a rule, however, it is best to subclass the TrackerMixin class, as additional methods may be added in the future.
Whenever a trackable object is first assigned to a tracker, this method is triggered.
Parameters: |
|
---|
Just before a trackable object is freed, this method is triggered.
Parameters: |
|
---|
Just before a trackable object is assigned an alternate tracker (or None) this method is triggered.
Parameters: |
|
---|
If the bundle associated with a trackable object is changed, this method is triggered.
Parameters: |
|
---|