1. 02 4月, 2014 3 次提交
  2. 28 3月, 2014 2 次提交
  3. 26 3月, 2014 10 次提交
  4. 25 3月, 2014 2 次提交
    • R
      Add support for loading external plugins from directory. · d38323d3
      Rudá Moura 提交于
      Create new option --plugins to pass a directory for loading external plugins.
      Also, add some plugins examples in examples/avocado_example_plugins.py.
      
      The external plugins are loaded from avocado_*.py modules and the plugins are
      subclasses of Plugin().
      Signed-off-by: NRuda Moura <rmoura@redhat.com>
      d38323d3
    • R
      Add support for loading external plugins. · 98122ea9
      Rudá Moura 提交于
      Also, app.run() now returns an exit code -- requires further
      udpates to pass the exit code back from plugins.
      
      To load external plugins:
      
      p = MyPlugin()
      app = avocado.cli.app.AvocadoApp(external_plugins=[p])
      app.run()
      
      and here's a MyPlugin example:
      
      import sys
      import avocado
      from avocado.plugins import plugin
      
      class MyPlugin(plugin.Plugin):
          def configure(self, parser):
              myparser = parser.add_parser('hello',
                                           help='Hello World!')
              myparser.set_defaults(func=self.hello)
      	self.enabled = True
      
          def hello(self, args):
              print 'Hello World!', args
      
      And how to execute:
      
      python myplugin.py hello
      Hello World! Namespace(func=<bound method MyPlugin.hello of <__main__.MyPlugin object at 0x1574f90>>, log_level='', logdir='', verbose=False)
      Signed-off-by: NRuda Moura <rmoura@redhat.com>
      98122ea9
  5. 21 3月, 2014 2 次提交
  6. 15 3月, 2014 2 次提交
  7. 14 3月, 2014 7 次提交
  8. 13 3月, 2014 10 次提交
  9. 12 3月, 2014 2 次提交