removed imports on sfa.util.rspec that is gone
[sfa.git] / sfa / client / setRecord.py
index 0d7dd16..4cd22a4 100755 (executable)
@@ -7,18 +7,14 @@ Updates record objects
 faiyaza at cs dot princeton dot edu
 Copyright (c) 2009 Board of Trustees, Princeton University
 
-$Id$
-$HeadURL$
 """
 
 import sys
+sys.path.append('.')
 import os
 from optparse import OptionParser
 from pprint import pprint
 
-from sfa.util.rspec import RecordSpec
-
-
 def create_parser():
     command = sys.argv[0]
     argv = sys.argv[1:]
@@ -44,10 +40,13 @@ def editDict(args, recordDict, options):
  
         elif vect.count("="):
             # reassign value
-            replaceDict({vect.split("=")[0]: returnVal(vect.split("=")[1])},
+            replaceDict({vect.split("=")[0]: returnVal("=".join(vect.split("=")[1:]))},
                          recordDict, options) 
         else:
-            raise TypeError, "Argument error: Records are updated with \n" \
+            if vect in recordDict:
+                del recordDict[vect]
+            else:
+                raise TypeError, "Argument error: Records are updated with \n" \
                             "key=val1,val2,valN or\n" \
                             "key+=val1,val2,valN \n%s Unknown key/val" % vect