def handle(self, man, match): try: block = self.make() block.parse_args(match.group(1)) tparser.BlockParser(man, block, self.close) except ExternalException, exn: man.error(exn)
def handleCode(man, match): lang = "" line = None opts = match.group(2) if opts: for opt in opts.split(','): if opt == "line": line = 1 elif opt.startswith("line="): try: line = int(opt[5:]) except ValueError: raise common.ParseException("bad line number: %s" % opt) else: lang = opt tparser.BlockParser(man, highlight.CodeBlock(man, lang, line), END_CODE)
def handleGnuPlot(man, match): tparser.BlockParser(man, GnuPlotBlock(match.group(2), match.group(4)), GNUPLOT_CLOSE)
def handleNoWiki(man, match): tparser.BlockParser(man, NonParsedBlock(), END_NOWIKI)
def handleFile(man, match): tparser.BlockParser(man, FileBlock(), END_FILE)
def handleDotOld(man, match): common.onDeprecated("@<dot> form is now deprecated. Use <dot> instead.") tparser.BlockParser(man, DotBlock(match.group(2)), DOT_CLOSE_OLD)
def handleDot(man, match): tparser.BlockParser(man, DotBlock(match.group(2)), DOT_CLOSE)
def new_multi_code(man, match): block = highlight.CodeBlock(man, "") block.add(match.group(1)) tparser.BlockParser(man, block, END_CODE)