Current Path : /usr/lib/python2.7/dist-packages/landscape/sysinfo/ |
Current File : //usr/lib/python2.7/dist-packages/landscape/sysinfo/sysinfo.pyc |
ó ÍÿŠTc @ s¬ d d l Z d d l m Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d e f d „ ƒ YZ d d d d d d d d „ Z d S( iÿÿÿÿN( t getLogger( t Failure( t gather_results( t log_failure( t PluginRegistryt SysInfoPluginRegistryc B sh e Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( sG When the sysinfo plugin registry is run, it will run each of the registered plugins so that they get a chance to feed information into the registry. There are three kinds of details collected: headers, notes, and footnotes. They are presented to the user in a way similar to the following: Header1: Value1 Header3: Value3 Header2: Value2 Header4: Value4 => This is first note => This is the second note The first footnote. The second footnote. Headers are supposed to display information which is regularly available, such as the load and temperature of the system. Notes contain eventual information, such as warnings of high temperatures, and low disk space. Finally, footnotes contain pointers to further information such as URLs. c C sD t t | ƒ j ƒ i | _ g | _ g | _ g | _ t | _ d S( N( t superR t __init__t _header_indext _headerst _notest _footnotest Falset _plugin_error( t self( ( s= /usr/lib/python2.7/dist-packages/landscape/sysinfo/sysinfo.pyR ' s c C sd | j j | ƒ } | d k rM t | j ƒ | j | <| j j | | f ƒ n | | f | j | <d S( sê Add a new information header to be displayed to the user. Each header name is only present once. If a header is added multiple times, the last value added will be returned in the get_headers() call. Headers with value None are not returned by get_headers(), but they still allocate a position in the list. This fact may be explored to create a deterministic ordering even when dealing with values obtained asynchornously. N( R t gett Nonet lenR t append( R t namet valuet index( ( s= /usr/lib/python2.7/dist-packages/landscape/sysinfo/sysinfo.pyt add_header/ s c C s* g | j D] } | d d k r | ^ q S( s› Get all information headers to be displayed to the user. Headers which were added with value None are not included in the result. i N( R R ( R t pair( ( s= /usr/lib/python2.7/dist-packages/landscape/sysinfo/sysinfo.pyt get_headersB s c C s | j j | ƒ d S( s<