Пример #1
0
 def get_options(cls):
     rv = BaseOutput.get_options()
     rv.append(DMROption("--pretty",
                         help="Output prettified JSON",
                         default=False,
                         action="store_true",
                         cf=('json', 'pretty')))
     return rv
Пример #2
0
    def get_options(cls):
        try:
            tmpl_path = resource_filename(config.name,
                                          "share/dmr/templates")
        except ImportError:
            tmpl_path = "templates"

        rv = BaseOutput.get_options()
        rv.append(DMROption("--template-path",
                            help="Path to Genshi templates",
                            default=tmpl_path,
                            type=os.path.abspath,
                            cf=('genshi', 'template_path')))
        rv.append(DMROption("--template",
                            help="Template to use, relative to template path",
                            default="%s.genshi" % cls.__name__.lower(),
                            cf=(cls.__name__.lower(), 'template')))
        return rv
Пример #3
0
 def __init__(self, document):
     BaseOutput.__init__(self, document)
     self._renderer = None
Пример #4
0
 def __init__(self, document):
     BaseOutput.__init__(self, document)
     self.renderer = WhitespaceRemovingRenderer(document.source,
                                                ReferenceTransformer)