BVB Source Codes

voltron Show state.py Source code

Return Download voltron: download state.py Source code - Download voltron Source code - Type:.py
  1. import voltron
  2. import logging
  3.  
  4. from voltron.api import *
  5.  
  6. log = logging.getLogger('api')
  7.  
  8. class APIStateRequest(APIRequest):
  9.     """
  10.    API state request.
  11.  
  12.    {
  13.        "type":         "request",
  14.        "request":      "state",
  15.        "data": {
  16.            "target_id": 0
  17.        }
  18.    }
  19.    """
  20.     _fields = {'target_id': False}
  21.  
  22.     target_id = 0
  23.  
  24.     @server_side
  25.     def dispatch(self):
  26.         try:
  27.             state = voltron.debugger.state(target_id=self.target_id)
  28.             log.debug("Got state from debugger: {}".format(state))
  29.             res = APIStateResponse()
  30.             res.state = state
  31.         except TargetBusyException:
  32.             res = APITargetBusyErrorResponse()
  33.         except NoSuchTargetException:
  34.             res = APINoSuchTargetErrorResponse()
  35.  
  36.         return res
  37.  
  38.  
  39. class APIStateResponse(APISuccessResponse):
  40.     """
  41.    API status response.
  42.  
  43.    {
  44.        "type":         "response",
  45.        "data": {
  46.            "state":    "stopped"
  47.        }
  48.    }
  49.    """
  50.     _fields = {'state': True}
  51.  
  52.     state = None
  53.  
  54.  
  55. class APIStatePlugin(APIPlugin):
  56.     request = 'state'
  57.     request_class = APIStateRequest
  58.     response_class = APIStateResponse
  59.  
downloadstate.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
pfff - Tools for code analysis, visualizations, or style-... 2017-04-27
facebook-sdk - Python SDK for Facebook's Graph API ... 2017-04-27
EventEmitter - Evented JavaScript for the browser 2017-04-26
elasticsearch-rails - Elasticsearch integrations for ActiveModel/Record ... 2017-04-26
CircularReveal - Lollipop ViewAnimationUtils.createCircularReveal f... 2017-04-26
psdash - A linux system information web dashboard using psu... 2017-04-26
grunt-contrib-watch - Run tasks whenever watched files change. ... 2017-04-26
UltimateAndroid - UltimateAndroid is a rapid development framework f... 2017-04-26
parallax.js - Simple parallax scrolling effect inspired by Spoti... 2017-04-26
poco - POCO C++ Libraries - Cross-platform C++ libraries ... 2017-04-26

 Back to top