Skip to content

Commit

Permalink
Store serialized cube and return absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
pmdartus committed Dec 22, 2014
1 parent 9038231 commit 8472ac1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion libs/client/commandparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def do_serialize(self, args):
if len(args) == 2:
ret = self.connector.serialize(args[0], args[1])
else:
ret = self.connector.serialize(args[0])
current_path = os.path.join(os.getcwd(), args[0] + ".nano")
ret = self.connector.serialize(args[0], current_path)

path = ret.get('file')
print(path)
Expand Down
10 changes: 4 additions & 6 deletions libs/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,13 @@ def do_serialize(self, data):
if self.cubes.get(cube_name) is None:
error = "Cube '{}' not found".format(cube_name)
return self._send_error(error)
if data.get('path') is None:
return self._send_error("No path provided to store the cube")
else:
cube = self.cubes.get(cube_name)
if data.get('path') is not None:
path = data.get('path')
else:
path = "data/{}.nano".format(cube.name)
dump(cube, path)
dump(cube, data.get('path'))
return self._send_success({
'file': path
'file': data.get('path')
})

def do_drop(self, data):
Expand Down

0 comments on commit 8472ac1

Please sign in to comment.