#NEWLINE# def device_serial( self ) : #NEWLINE# #INDENT# if ( not self . default_serial ) : #NEWLINE# #INDENT# devices = self . devices ( ) #NEWLINE# if devices : #NEWLINE# #INDENT# if ( len ( self ) is 1 ) : #NEWLINE# #INDENT# self . default_serial = list ( devices . keys ( ) ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise EnvironmentError ( 'Multiple devices attached but default android serial not set.' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise EnvironmentError ( 'Device not attached.' ) #NEWLINE# #UNINDENT# #UNINDENT# return self . default_serial