
import imp, ihooks

class PTLHooks(ihooks.Hooks):
    def get_suffixes(self):
        L = imp.get_suffixes()
        return [('.ptl', 'r', imp.PY_SOURCE)]

class PTLLoader(ihooks.ModuleLoader):
    pass

class PTLImporter(ihooks.ModuleImporter):
    pass

loader = ihooks.ModuleLoader()
i = PTLImporter( loader = loader )

ihooks.install( PTLImporter() )
import foo
