<s> import logging <EOL> import voltron <EOL> from voltron . api import * <EOL> from scruffy . plugin import Plugin <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> class APITargetsRequest ( APIRequest ) : <EOL> """<STR_LIT>""" <EOL> _fields = { } <EOL> @ server_side <EOL> def dispatch ( self ) : <EOL> try : <EOL> res = APITargetsResponse ( ) <EOL> res . targets = voltron . debugger . targets ( ) <EOL> except NoSuchTargetException : <EOL> res = APINoSuchTargetErrorResponse ( ) <EOL> except Exception as e : <EOL> msg = "<STR_LIT>" . format ( repr ( e ) ) <EOL> log . exception ( msg ) <EOL> res = APIGenericErrorResponse ( msg ) <EOL> return res <EOL> class APITargetsResponse ( APISuccessResponse ) : <EOL> """<STR_LIT>""" <EOL> _fields = { '<STR_LIT>' : True } <EOL> targets = [ ] <EOL> class APITargetsPlugin ( APIPlugin ) : <EOL> request = '<STR_LIT>' <EOL> request_class = APITargetsRequest <EOL> response_class = APITargetsResponse </s>
