#NEWLINE# def list( self , cmd , args , options ) : #NEWLINE# #INDENT# 'List models for a vendor.\n\nUsage:\n    exo [options] model list [<glob>] [--long]\n\nCommand options:\n    -l --long  Show model RID, noaliases, nocomment, nohistorical\n    -h --help  Show this screen' #NEWLINE# pop = options [ 'pop' ] #NEWLINE# exoconfig = options [ 'config' ] #NEWLINE# key = exoconfig . config [ 'vendortoken' ] #NEWLINE# mlist = pop . model_list ( key ) #NEWLINE# models = mlist . body . splitlines ( ) #NEWLINE# if ( args [ '<glob>' ] is not None ) : #NEWLINE# #INDENT# models = fnmatch . filter ( models , args [ '<glob>' ] ) #NEWLINE# #UNINDENT# for model in models : #NEWLINE# #INDENT# if ( not args [ '--long' ] ) : #NEWLINE# #INDENT# print ( model . strip ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mlist = pop . model_info ( key , model ) #NEWLINE# res = urlparse . parse_qs ( mlist . body ) #NEWLINE# out = [ model ] #NEWLINE# if ( 'code' in res ) : #NEWLINE# #INDENT# out . append ( 'code.{0}' . format ( res [ 'code' ] [ 0 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'rid' in res ) : #NEWLINE# #INDENT# out . append ( 'rid.{0}' . format ( res [ 'rid' ] [ 0 ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( 'options[]' in res ) : #NEWLINE# #INDENT# out . extend ( res [ 'options[]' ] ) #NEWLINE# #UNINDENT# print ( ',' . join ( out ) )