#NEWLINE# def __init__( self ) : #NEWLINE# #INDENT# if ( self . info is not None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# info = [ { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] #NEWLINE# ( ok , output ) = getoutput ( [ 'uname' , '-m' ] ) #NEWLINE# if ok : #NEWLINE# #INDENT# info [ 0 ] [ 'uname_m' ] = output . strip ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# fo = open ( '/proc/cpuinfo' ) #NEWLINE# #UNINDENT# except EnvironmentError as e : #NEWLINE# #INDENT# warnings . warn ( str ( e ) , UserWarning ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for line in fo : #NEWLINE# #INDENT# name_value = [ s . strip ( ) for s in line . split ( ':' , 1 ) ] #NEWLINE# if ( len ( name_value ) != 2 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( name , value ) = fo #NEWLINE# if ( ( not info ) or ( name in info [ ( - 1 ) ] ) ) : #NEWLINE# #INDENT# info . append ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# info [ ( - 1 ) ] [ name ] = value #NEWLINE# #UNINDENT# fo . close ( ) #NEWLINE# #UNINDENT# self . __class__ . info = info