mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Minor cleanups in the contents API.
Noticed while poking around with a linter enabled.
This commit is contained in:
parent
8160308bb2
commit
ccc8cb9cbf
@ -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)
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user