Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
redhat_support_tool
/
helpers
/
File Content:
launchhelper.pyo
� ��Tc @ sY d d l Z d d l j j Z d d l Z d Z e j d � Z d e f d � � YZ d S( i����Ns% Keith Robertson <kroberts@redhat.com>s( redhat_support_tool.helpers.launchhelpert LaunchHelperc B s2 e Z d Z d � Z d e d d � Z d � Z RS( c C s | | _ d S( sM Arguments: The plug-in class which will be called. N( t plugin_class_ref( t selfR ( ( sL /usr/lib/python2.7/site-packages/redhat_support_tool/helpers/launchhelper.pyt __init__ s c C s� t j t j | � t j t j | � t j t j | � t j t j | � t | � j � d k s| t | � j � d k r� | j � Sy� | j � } | j | � t | t j j � r� | j } | j | � n | j � | j � } | d k r| d k r| St j � rlt | j t j j � rl| r8| | _ n t | d � sR| j rv| j � | j d � Sn | j � SWn, t k r�} t j | � | r�� q�n Xd S( st Creates an initializes the given plug-in in the following order. 1) Create plug-in 2) Call plug-in's parse_args method. This will parse STDIN from user in plug-in's OptionParser. 3) Call validate_args. This is a hook that the plug-in should implement to check that the user supplied the requisite number of args to actually do something. 4) Call postinit. This is a hook that the plug-in can use to do something. At this point the plug-in should know that it has enough information to actually do something and can do that something. 5) Depending on the run mode (ie. interactive vs. non-interactive) and the type of plug-in the following things will happen: Running Mode | Subclass of InteractivePlugin | Methods called ----------------------------------------------------------------------- Interactive | True | do_help() <- Print menu | | cmdloop() <- Start submenu ----------------------------------------------------------------------- Non-Interactive | True | non_interactive_action() ----------------------------------------------------------------------- Interactive | False | non_interactive_action() ----------------------------------------------------------------------- Non-Interactive | False | non_interactive_action() Arguments: line - The STDIN from the user that will be supplied to the plug-in. :param pt_exception: Option to passthrough exceptions to the LaunchHelper.run() caller. This allows modules to track exceptions from downstream plugins. :type pt_exception: boolean s -hs --helpi t no_submenuN( t loggert logt loggingt DEBUGt strt lowert helpR t parse_argst isinstancet redhat_support_toolt pluginst ObjectDisplayOptiont stored_objt insert_objt validate_argst postinitt Nonet commont is_interactivet issubclasst InteractivePlugint promptt hasattrR t _print_submenut cmdloopt non_interactive_actiont Exceptiont exception( R t linet dispoptt pt_exceptionR t clsR t rett e( ( sL /usr/lib/python2.7/site-packages/redhat_support_tool/helpers/launchhelper.pyt run% s<