/usr/share/doc/python-twisted-lore/howto/listings/lore/factory.py-2 is in python-twisted-lore 11.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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()
|