Personal tools
You are here: Home Documentation Transforms Manual Examples transform_template_fromLibrary.py
Document Actions

transform_template_fromLibrary.py

A template for a transform class that uses a custom library as a base class, instead of just using Transform

Click here to get the file

Size 1 kB - File type text/python-source

File contents

from yourTransformLibrary import YourTransformLibrary
#Import anything else you want, just remember to import Transform (or your
#custom library)

class myTransform(YourTransformLibrary):

    #============================================================
    # 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
        #some function from your mix-in class
        return #something
Related content
by Karl Norby last modified 2006-08-31 09:28

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: