Skip to content
Snippets Groups Projects
Commit b1740736 authored by Philip ABBET's avatar Philip ABBET
Browse files

More fixes

parent aa4eff11
Branches
No related tags found
1 merge request!8Refactoring and support of dataset providing in a container
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
import hashlib import hashlib
import simplejson
import collections
import copy
import six
def _sha256(s): def _sha256(s):
......
...@@ -253,7 +253,13 @@ class CodeStorage(object): ...@@ -253,7 +253,13 @@ class CodeStorage(object):
def save(self, declaration, code=None, description=None): def save(self, declaration, code=None, description=None):
"""Saves the JSON declaration and the code as files""" """Saves the JSON declaration and the code as files"""
super(CodeStorage, self).save(declaration, description) if description:
self.doc.save(description.encode('utf8'))
if not isinstance(declaration, six.string_types):
declaration = simplejson.dumps(declaration, indent=4)
self.json.save(declaration)
if code: if code:
if self._language == 'unknown': if self._language == 'unknown':
self.language = self.__auto_discover_language(declaration) self.language = self.__auto_discover_language(declaration)
...@@ -261,5 +267,6 @@ class CodeStorage(object): ...@@ -261,5 +267,6 @@ class CodeStorage(object):
def remove(self): def remove(self):
"""Removes the object from the disk""" """Removes the object from the disk"""
super(CodeStorage, self).remove() self.json.remove()
self.doc.remove()
self.code.remove() self.code.remove()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment