def plugin_list(): '''Plugin Listing Returns the plugin listing. Can optionally be limited to a specific server binary compatability type. ''' data = c.list_plugins('bukkit', ['slug',], 'slug') return c.jsonify([a['slug'] for a in data])
def plugin_list(server=None): '''Plugin Listing Returns the plugin listing. Can optionally be limited to a specific server binary compatability type. ''' fields = bleach.clean(request.query.fields or 'slug,plugin_name,description').split(',') start = c.sint(bleach.clean(request.query.start or None)) size = c.sint(bleach.clean(request.query.size or None)) sort = bleach.clean(request.query.sort or 'slug') data = c.list_plugins(server, fields, sort) if size is not None and start is not None: return c.jsonify(data[start:start+size]) return c.jsonify(data)