#NEWLINE# def _GetSerialNumber( ) : #NEWLINE# #INDENT# "Returns the str serial number from system_profiler, or '' if not found." #NEWLINE# ( return_code , stdout , unused_stderr ) = Exec ( 'system_profiler SPHardwareDataType' ) #NEWLINE# if ( ( return_code == 0 ) and stdout ) : #NEWLINE# #INDENT# match = re . search ( '^\\s+Serial Number[^:]+: (.*)$' , stdout , re . MULTILINE ) #NEWLINE# if match : #NEWLINE# #INDENT# return match . group ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# return ''