Commit b1740736 authored by Philip ABBET's avatar Philip ABBET

More fixes

parent aa4eff11
......@@ -30,6 +30,10 @@
import hashlib
import simplejson
import collections
import copy
import six
def _sha256(s):
......
......@@ -253,7 +253,13 @@ class CodeStorage(object):
def save(self, declaration, code=None, description=None):
"""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 self._language == 'unknown':
self.language = self.__auto_discover_language(declaration)
......@@ -261,5 +267,6 @@ class CodeStorage(object):
def remove(self):
"""Removes the object from the disk"""
super(CodeStorage, self).remove()
self.json.remove()
self.doc.remove()
self.code.remove()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment