Minor cleanups in the contents API.

Noticed while poking around with a linter enabled.
This commit is contained in:
Scott Sanderson 2014-12-08 19:22:03 -05:00
parent 8160308bb2
commit ccc8cb9cbf
3 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,7 @@ class ContentsHandler(IPythonHandler):
if type_ not in {None, 'directory', 'file', 'notebook'}:
raise web.HTTPError(400, u'Type %r is invalid' % type_)
format = self.get_query_argument('format', default=None)#
format = self.get_query_argument('format', default=None)
if format not in {None, 'text', 'base64'}:
raise web.HTTPError(400, u'Format %r is invalid' % format)

View File

@ -6,6 +6,7 @@ define([
'base/js/utils',
],
function($, utils) {
"use strict";
var ConfigSection = function(section_name, options) {
this.section_name = section_name;
this.base_url = options.base_url;

View File

@ -6,6 +6,7 @@ define([
'jquery',
'base/js/utils',
], function(IPython, $, utils) {
"use strict";
var Contents = function(options) {
/**
* Constructor
@ -90,7 +91,7 @@ define([
dataType : "json",
};
var url = this.api_url(path);
params = {};
var params = {};
if (options.type) { params.type = options.type; }
if (options.format) { params.format = options.format; }
return utils.promising_ajax(url + '?' + $.param(params), settings);