def dummy_plugin_content():
"""Dummy pyang content that dumps the contents of a parameter"""
return dedent("""\
import optparse
from pyang import plugin
def pyang_plugin_init():
plugin.register_plugin(FakeFixturePlugin())
class FakeFixturePlugin(plugin.PyangPlugin):
def add_opts(self, optparser):
g = optparser.add_option_group("FakeFixture Plugin Options")
g.add_options([
optparse.make_option(
"--fake-fixture-option", default="Hello World!")
])
def add_output_format(self, fmts):
self.multiple_modules = True
fmts['fake-fixture'] = self
def emit(self, ctx, modules, fd):
fd.write(ctx.opts.fake_fixture_option)""")
评论列表
文章目录