BVB Source Codes

voltron Show command.py Source code

Return Download voltron: download command.py Source code - Download voltron Source code - Type:.py
  1. import logging
  2.  
  3. import voltron
  4. from voltron.api import *
  5.  
  6. from scruffy.plugin import Plugin
  7.  
  8. log = logging.getLogger('api')
  9.  
  10. class APICommandRequest(APIRequest):
  11.     """
  12.    API execute command request.
  13.  
  14.    {
  15.        "type":         "request",
  16.        "request":      "command"
  17.        "data": {
  18.            "command":  "break list"
  19.        }
  20.    }
  21.    """
  22.     _fields = {'command': True}
  23.  
  24.     @server_side
  25.     def dispatch(self):
  26.         try:
  27.             output = voltron.debugger.command(self.command)
  28.             res = APICommandResponse()
  29.             res.output = output
  30.         except NoSuchTargetException:
  31.             res = APINoSuchTargetErrorResponse()
  32.         except Exception as e:
  33.             msg = "Exception executing debugger command: {}".format(repr(e))
  34.             log.exception(msg)
  35.             res = APIGenericErrorResponse(msg)
  36.  
  37.         return res
  38.  
  39.  
  40. class APICommandResponse(APISuccessResponse):
  41.     """
  42.    API list targets response.
  43.  
  44.    {
  45.        "type":         "response",
  46.        "status":       "success",
  47.        "data": {
  48.            "output":   "stuff"
  49.        }
  50.    }
  51.    """
  52.     _fields = {'output': True}
  53.  
  54.     output = None
  55.  
  56.  
  57. class APICommandPlugin(APIPlugin):
  58.     request = "command"
  59.     request_class = APICommandRequest
  60.     response_class = APICommandResponse
  61.  
downloadcommand.py Source code - Download voltron Source code
Related Source Codes/Software:
IGListKit - A data-driven UICollectionView framework for build... 2017-01-11
androidmvp - MVP Android Example 2017-01-11
svelte - The magical disappearing UI framework ... 2017-01-11
kcptun - A Simple UDP Tunnel Based On KCP 2017-01-11
poisontap - Exploits locked/password protected computers over ... 2017-01-10
ecma262 - Status, process, and documents for ECMA262 ... 2017-01-11
react-native-elements - React Native Elements UI Toolkit 2017-01-11
tensorflow-zh - Google new open source ai system TensorFlow Chines... 2017-01-11
forum - Blue light (the Lantern) the official BBS 2017-01-11
socketcluster - Highly scalable realtime framework ... 2017-01-11
react-templates - Light weight templates for react ... 2017-04-28
afterglow-theme - A minimal dark Theme for Sublime Text 2 and 3 2017-04-28
jwt-go - Golang implementation of JSON Web Tokens (JWT) 2017-04-28
DeerResume - Tool MarkDown online resume, online preview, edit,... 2017-04-28
mailgen - A Node.js package that generates clean, responsive... 2017-04-28
desk - A lightweight workspace manager for the shell 2017-04-28
Glimpse - The open source diagnostics platform for the web ... 2017-04-28
xonsh - Python-powered, cross-platform, Unix-gazing shell ... 2017-04-28
react-monocle - A developer tool to visualize a React application'... 2017-04-28

 Back to top