<s> import interfacer . base_module as base_module <EOL> import sys <EOL> def register ( ) : <EOL> return TribblesModule ( ) <EOL> class ListCommand ( base_module . SubCommand ) : <EOL> '''<STR_LIT>''' <EOL> def name ( self ) : <EOL> return '<STR_LIT:list>' <EOL> def description ( self ) : <EOL> return '<STR_LIT>' <EOL> def options ( self ) : <EOL> return [ <EOL> [ "<STR_LIT>" , "<STR_LIT>" , <EOL> dict ( dest = "<STR_LIT:name>" , help = "<STR_LIT>" ) ] <EOL> ] <EOL> def run ( self , options , args ) : <EOL> tribbles = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> found = False <EOL> for x in tribbles : <EOL> if options . name is not None : <EOL> if options . name . lower ( ) in x : <EOL> found = True <EOL> print x <EOL> else : <EOL> print x <EOL> if not found and options . name is not None : <EOL> sys . stderr . write ( "<STR_LIT>" % options [ '<STR_LIT:name>' ] ) <EOL> return <NUM_LIT:1> <EOL> return <NUM_LIT:0> <EOL> class TribblesModule ( base_module . BaseModule ) : <EOL> '''<STR_LIT>''' <EOL> def name ( self ) : <EOL> return '<STR_LIT>' <EOL> def description ( self ) : <EOL> return '<STR_LIT>' <EOL> def sub_commands ( self ) : <EOL> return [ <EOL> ListCommand ( self ) <EOL> ] </s>
