BVB Source Codes

voltron Show plugins.py Source code

Return Download voltron: download plugins.py Source code - Download voltron Source code - Type:.py
  1. import voltron
  2. import voltron.api
  3. from voltron.api import *
  4.  
  5. from scruffy.plugin import Plugin
  6.  
  7.  
  8. class APIPluginsRequest(APIRequest):
  9.     """
  10.    API plugins request.
  11.  
  12.    {
  13.        "type":         "request",
  14.        "request":      "plugins"
  15.    }
  16.    """
  17.     @server_side
  18.     def dispatch(self):
  19.         res = APIPluginsResponse()
  20.         return res
  21.  
  22.  
  23. class APIPluginsResponse(APISuccessResponse):
  24.     """
  25.    API plugins response.
  26.  
  27.    {
  28.        "type":         "response",
  29.        "status":       "success",
  30.        "data": {
  31.            "plugins": {
  32.                "api": {
  33.                    "version": ["api_version", "host_version", "capabilities"]
  34.                    ...
  35.                },
  36.                "debugger": {
  37.                    ...
  38.                },
  39.                ...
  40.            }
  41.        }
  42.    }
  43.    """
  44.     _fields = {
  45.         'plugins': True
  46.     }
  47.  
  48.     def __init__(self, *args, **kwargs):
  49.         super(APIPluginsResponse, self).__init__(*args, **kwargs)
  50.         self.plugins = {
  51.             'api': {n: {'request': p.request_class._fields, 'response': p.response_class._fields}
  52.                     for (n, p) in voltron.plugin.pm.api_plugins.iteritems()},
  53.             'debugger': [n for n in voltron.plugin.pm.debugger_plugins],
  54.             'view': [n for n in voltron.plugin.pm.view_plugins],
  55.             'command': [n for n in voltron.plugin.pm.command_plugins],
  56.             'web': [n for n in voltron.plugin.pm.web_plugins],
  57.         }
  58.  
  59.  
  60. class APIPluginsPlugin(APIPlugin):
  61.     request = 'plugins'
  62.     request_class = APIPluginsRequest
  63.     response_class = APIPluginsResponse
  64.  
downloadplugins.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
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top