#NEWLINE# def list_devices( self , number ) : #NEWLINE# #INDENT# if number : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# number = number . strip ( ) #NEWLINE# number = int ( text ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# text = '{} is not a number, now is it. You see, it needs to be.' . format ( number ) #NEWLINE# return text #NEWLINE# #UNINDENT# #UNINDENT# devices = self . device . list ( ) #NEWLINE# if number : #NEWLINE# #INDENT# devices_trunc = devices [ : number ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# devices_trunc = devices [ : 5 ] #NEWLINE# #UNINDENT# return self . _format_devices ( devices_trunc )