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
discover-flask - Full Stack Web Development with Flask. ... 2017-01-12
spring-mvc-showcase - Demonstrates the features of the Spring MVC web fr... 2017-01-12
tushare - TuShare is a utility for crawling historical data ... 2017-01-12
raml-spec - RAML Specification http://raml.... 2017-01-12
android-stackblur - Android StackBlur is a library that can perform a ... 2017-01-12
sound-redux - A Soundcloud client built with React / Redux ... 2017-01-12
httpstat - curl statistics made simple 2017-01-12
vim - Vim configuration file and plug-ins 2017-01-12
appframework - The definitive HTML5 mobile javascript framework ... 2017-01-12
BaiduExporter - Assistant for Baidu to export download links to ar... 2017-01-11

 Back to top