Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > e9c352c7f5646ffe82e50decd2068389 > files > 119

python-twisted-lore-13.1.0-3.mga4.x86_64.rpm

from twisted.lore import default
from myhtml import spitters

class MyProcessingFunctionFactory(default.ProcessingFunctionFactory):
    latexSpitters={None: spitters.MyLatexSpitter,
                   }

    # redefine getLintChecker to validate our classes
    def getLintChecker(self):
        # use the default checker from parent
        checker = lint.getDefaultChecker()
        checker.allowedClasses = checker.allowedClasses.copy()
        oldSpan = checker.allowedClasses['span']
        checkfunc=lambda cl: oldSpan(cl) or cl in ['marketinglie',
                                                   'productname']
        checker.allowedClasses['span'] = checkfunc
        return checker

# initialize the global variable factory with an instance of your new factory
factory=MyProcessingFunctionFactory()