transform_template_fromTransform.py
A template for a transform that uses the abstract class Transform as its only base class
Size 1.1 kB - File type text/python-sourceFile contents
from transform import Transform
#Import anything else you want, just remember to import Transform (or your
#custom library)
class myTransform(Transform):
"""
:Author: Karl Norby <knorby@uchicago.edu>
:Date: Wed, 30 Aug 2006
:Description: A template for developers to help with the constuction of transform functions
"""
#============================================================
# The next two lines MUST remain unchanged in your transform class
def __init__(self, root):
self.root = root
#============================================================
#Just define the call method and specify arguments, and the program
#will do your transform
def __call__(self, arg1, arg2, arg3):
#More could be in the call, including your entire function.
#Usually, it is cleaner looking to use another method.
return self.yourMethod(arg1, arg2, arg3)
#============================================================
#
def yourMethod(self, arg1, arg2, arg3):
#your transform code
return #something