From bc7d69f0956d1a66ffc9d3f4b645f6419e847331 Mon Sep 17 00:00:00 2001 From: "nitromaster101@gmail.com" Date: Wed, 22 Jul 2009 18:45:54 +0000 Subject: cleanup, incorporate changes from code review, and move merge and split stuff into freebase.experimental git-svn-id: http://freebase-python.googlecode.com/svn/trunk@201 5914aa95-5b3a-0410-a3b5-7b719e7fe9b2 --- freebase/fcl/commands.py | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'freebase/fcl/commands.py') diff --git a/freebase/fcl/commands.py b/freebase/fcl/commands.py index 4b517ec..4de2496 100755 --- a/freebase/fcl/commands.py +++ b/freebase/fcl/commands.py @@ -34,6 +34,7 @@ import simplejson import freebase.rison as rison from freebase.api import attrdict +from freebase.schema import connect_object, disconnect_object def cmd_help(fb, command=None): """get help on commands @@ -187,17 +188,8 @@ def cmd_ln(fb, src, dst): """ src = fb.absid(src) dst = fb.absid(dst) - dir,file = dirsplit(dst) - wq = { 'id': src, - 'key':{ - 'connect': 'insert', - 'namespace': dir, - 'value': file - } - } - - r = fb.mss.mqlwrite(wq) - + + return connect_object(fb.mss, src, dst) def cmd_rm(fb, path): """unlink a namespace key @@ -213,17 +205,8 @@ def cmd_rm(fb, path): disturb anything other than the one directory entry. """ path = fb.absid(path) - dir,file = dirsplit(path) - - wq = { 'id': path, - 'key':{ - 'connect': 'delete', - 'namespace': dir, - 'value': file - } - } - - r = fb.mss.mqlwrite(wq) + + return disconnect_object(fb.mss, path) def cmd_mv(fb, src, dst): """rename srcid to dstid. -- cgit v1.3.1