Submit
Path:
~
/
/
lib
/
python2.7
/
site-packages
/
redhat_support_tool
/
plugins
/
File Content:
analyze.pyo
� ��Tc @ s� d d l m Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d d l Z d d l Z d d l j j Z d d l j j Z d d l j Z d Z e j d � Z d e f d � � YZ d S( i����( t deque( t _( t LaunchHelper( t InteractivePlugint ObjectDisplayOption( t SymptomNs Dan Varga <dvarga@redhat.com>s# redhat_support_tool.plugins.analyzet Analyzec B s� e Z d Z e d � Z e d � Z e d � Z d Z d Z d Z d Z d � Z e d � � Z e d � � Z e d � � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d d � Z d � Z RS( t analyzes Analyze a file for symptomss2 %s of %s symptoms displayed. Type 'm' to see more.s No more symptoms to displayc C s t j | � d S( N( R t __init__( t self( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyR , s c C s t d � S( s� The usage statement that will be printed by OptionParser. Example: - %prog -c CASENUMBER [options] <comment text here> Important: %prog is a OptionParser built-in. Use it! s %prog <file for analysis>( R ( t cls( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt get_usage/ s c C s t d � | j S( s� The description statement that will be printed by OptionParser. Example: - 'Use the '%s' command to add a comment to a case.' % cls.plugin_name s3 Use the '%s' command to analyze a file for symptoms( R t plugin_name( R ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt get_desc: s c C s t d � | j | j | j f S( s The epilog string that will be printed by OptionParser. Usually used to print an example of how to use the program. Example: Examples: - %s -c 12345678 Lorem ipsum dolor sit amet, consectetur adipisicing - %s -c 12345678 s� Examples: - %s /var/log/jbossas/rhevm-slimmed/boot.log - %s /var/spool/abrt/ccpp-2012-09-28-09:53:26-4080 - %s /var/log/messages ( R R ( R ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt get_epilogF s c C s t d � S( NsO Type the number of the symptom to view, or 'e' to return to the previous menu.( R ( R ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt get_intro_textX s c C s t d � S( Ns Select a Symptom: ( R ( R ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt get_prompt_text\ s c C s | j S( N( t _submenu_opts( R ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt get_sub_menu_options_ s c C s� t d � | j } | j s� t j � r� g } y, t d � GHx t rX | j t � � q? WWq� t k r� t d j | � � j d � j � | _ q� Xq� | GHt | � � n d S( Ns ERROR: %s requires a file.sS Please provide the file, or text to be analyzed: Ctrl-d on an empty line to submit:s s utf-8( R R t _linet commont is_interactivet Truet appendt raw_inputt EOFErrort strt joint decodet stript Exception( R t msgt userinput( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt _check_inputb s c C s | j � d S( N( R! ( R ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt validate_argsw s c C s5 t � | _ i | _ g t j _ | j | j � d S( sT This is where the work goes down, call do_analysis to do that work N( R R t _sectionst Symptomst AnalyzerPlugint symptomst do_analysisR ( R ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt postinit{ s c C s� x� | j D]� } d | j | j d | j f } y | j d d � GHWq t k r� } t j t j | � d d l } | j | j � d � GHq Xq Wd S( sO Running in non-interactive mode, just dump the text to screen s At Line: %d Symptom: %ss s UTF-8t replacei����N( t resultst line_numt before_linet token_stringt encodeR t loggert logt loggingt WARNINGt syst getdefaultencoding( R t rest linet eR3 ( ( sG /usr/lib/python2.7/site-packages/redhat_support_tool/plugins/analyze.pyt non_interactive_action� s c C s� | j | j k rt d } x7 | j D], } | j | j k r"