Gc @ sx d d k Z d d k Z d d k l Z d d k l Z d d k l Z d e f d YZ d e f d YZ d S( iN( t OptionConflictError( t warn( t tolistt Pluginc B s} e Z d Z e Z e Z d Z d Z d Z d Z e i d Z e i d Z e i d Z d Z d Z d Z RS( s Base class for nose plugins. It's not *necessary* to subclass this class to create a plugin; however, all plugins must implement `options(self, parser, env)` and `configure(self, options, conf)`, and must have the attributes `enabled`, `name` and `score`. The `name` attribute may contain hyphens ('-'). Plugins should not be enabled by default. Subclassing Plugin (and calling the superclass methods in __init__, configure, and options, if you override them) will give your plugin some friendly default behavior: * A --with-$name option will be added to the command line interface to enable the plugin, and a corresponding environment variable will be used as the default value. The plugin class's docstring will be used as the help for this option. * The plugin will not be enabled unless this option is selected by the user. id c C s] | i d j o | i i i | _ n | i d j o d | i i d d | _ n d S( Ns enable_plugin_%st -t _( t namet Nonet __class__t __name__t lowert enableOptt replace( t self( ( s5 /usr/lib/python2.6/site-packages/nose/plugins/base.pyt __init__! s c C s | i | | d S( s Add command-line options for this plugin. The base plugin class adds --with-$name by default, used to enable the plugin. N( t add_options( R t parsert env( ( s5 /usr/lib/python2.6/site-packages/nose/plugins/base.pyt addOptions' s c C sb y | i | | t | _ Wn> t j o2 } t d | | f t t | _ t | _ n Xd S( sI Non-camel-case version of func name for backwards compatibility. s@ Plugin %s has conflicting option string: %s and will be disabledN( t optionst Truet can_configureR R t RuntimeWarningt Falset enabled( R R R t e( ( s5 /usr/lib/python2.6/site-packages/nose/plugins/base.pyR / s c C sz d | i i } | i d d } | i d | i d d d | i d | i | d d | i i | i | f d S( s New plugin API: override to just set options. Implement this method instead of addOptions or add_options for normal options behavior with protection from OptionConflictErrors. s NOSE_WITH_%sR R s --with-%st actiont store_truet destt defaultt helps Enable plugin %s: %s [%s]N( R t upperR t add_optionR t getR R R ( R R R t env_opt( ( s5 /usr/lib/python2.6/site-packages/nose/plugins/base.pyR <