Roundup Tracker - Issues

Issue 2550677

classification
Title: Interception of Class/FileClass methods
Type: behavior Severity: normal
Components: Database Versions: 1.4
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bnordgren
Priority: Keywords:

Created on 2010-10-25 16:58 by bnordgren, last changed 2010-10-25 16:58 by bnordgren.

Files
File name Uploaded Description Edit Remove
interceptor.py bnordgren, 2010-10-25 16:58
Messages
msg4182 Author: [hidden] (bnordgren) Date: 2010-10-25 16:58
I made a generic ClassInterceptor designed to be mixed in with Class or
FileClass at runtime as directed by schema.py (hence supporting all
backends). The two initial uses of this class are: 1] compression of
"content" (for messages primarily composed of text); and 2] suppression
of duplicate file entries (handy for people who have "image signatures"
setup in their email client.) It could also be used for encryption of
file content on disk.

The attached file contains the code. Feel free to post on the wiki, as
the wiki's permissions are still setup to prohibit postings by this
registered user. Also feel free to include in the standard distribution.
Use of the file in schema.py is as follows: 

from interceptor import interceptor_factory, GzipFileClass, UniqueFileClass

# Make a message file class which compresses the content before storage.
MessageFileClass =
interceptor_factory('MessageFileClass',GzipFileClass,FileClass)

# Make a file class which only stores unique files.
DataFileClass =
interceptor_factory('DataFileClass',UniqueFileClass,FileClass)
History
Date User Action Args
2010-10-25 16:58:28bnordgrencreate