~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/lore/howto/listings/lore/factory.py-3

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.lore import default
 
2
from myhtml import spitters
 
3
 
 
4
class MyProcessingFunctionFactory(default.ProcessingFunctionFactory):
 
5
    # 1. add the keys "chapter" and "section" to latexSpitters to handle the
 
6
    # --config chapter and --config section options
 
7
    latexSpitters={None: spitters.MyLatexSpitter,
 
8
                   "section": spitters.MySectionLatexSpitter,
 
9
                   "chapter": spitters.MyChapterLatexSpitter,
 
10
                   }
 
11
 
 
12
    def getLintChecker(self):
 
13
        checker = lint.getDefaultChecker()
 
14
        checker.allowedClasses = checker.allowedClasses.copy()
 
15
        oldSpan = checker.allowedClasses['span']
 
16
        checkfunc=lambda cl: oldSpan(cl) or cl in ['marketinglie',
 
17
                                                   'productname']
 
18
        checker.allowedClasses['span'] = checkfunc
 
19
        return checker
 
20
 
 
21
factory=MyProcessingFunctionFactory()