Show More
@@ -204,7 +204,7 b' class ContentsManager(LoggingConfigurable):' | |||||
204 | for i in itertools.count(): |
|
204 | for i in itertools.count(): | |
205 | name = u'{basename}{i}{ext}'.format(basename=basename, i=i, |
|
205 | name = u'{basename}{i}{ext}'.format(basename=basename, i=i, | |
206 | ext=ext) |
|
206 | ext=ext) | |
207 | if not self.file_exists('{}/{}'.format(path, name)): |
|
207 | if not self.file_exists(u'{}/{}'.format(path, name)): | |
208 | break |
|
208 | break | |
209 | return name |
|
209 | return name | |
210 |
|
210 | |||
@@ -213,7 +213,7 b' class ContentsManager(LoggingConfigurable):' | |||||
213 | try: |
|
213 | try: | |
214 | validate(model['content']) |
|
214 | validate(model['content']) | |
215 | except ValidationError as e: |
|
215 | except ValidationError as e: | |
216 | model['message'] = 'Notebook Validation failed: {}:\n{}'.format( |
|
216 | model['message'] = u'Notebook Validation failed: {}:\n{}'.format( | |
217 | e.message, json.dumps(e.instance, indent=1, default=lambda obj: '<UNKNOWN>'), |
|
217 | e.message, json.dumps(e.instance, indent=1, default=lambda obj: '<UNKNOWN>'), | |
218 | ) |
|
218 | ) | |
219 | return model |
|
219 | return model | |
@@ -245,7 +245,7 b' class ContentsManager(LoggingConfigurable):' | |||||
245 | raise HTTPError(400, "Unexpected model type: %r" % model['type']) |
|
245 | raise HTTPError(400, "Unexpected model type: %r" % model['type']) | |
246 |
|
246 | |||
247 | name = self.increment_filename(untitled + ext, path) |
|
247 | name = self.increment_filename(untitled + ext, path) | |
248 | path = '{0}/{1}'.format(path, name) |
|
248 | path = u'{0}/{1}'.format(path, name) | |
249 | model = self.save(model, path) |
|
249 | model = self.save(model, path) | |
250 | return model |
|
250 | return model | |
251 |
|
251 | |||
@@ -276,7 +276,7 b' class ContentsManager(LoggingConfigurable):' | |||||
276 | base, ext = os.path.splitext(from_name) |
|
276 | base, ext = os.path.splitext(from_name) | |
277 | copy_name = u'{0}-Copy{1}'.format(base, ext) |
|
277 | copy_name = u'{0}-Copy{1}'.format(base, ext) | |
278 | to_name = self.increment_filename(copy_name, to_path) |
|
278 | to_name = self.increment_filename(copy_name, to_path) | |
279 | to_path = '{0}/{1}'.format(to_path, to_name) |
|
279 | to_path = u'{0}/{1}'.format(to_path, to_name) | |
280 |
|
280 | |||
281 | model = self.save(model, to_path) |
|
281 | model = self.save(model, to_path) | |
282 | return model |
|
282 | return model |
General Comments 0
You need to be logged in to leave comments.
Login now