(flatfilts.py) setconv stub fixed
authordevicerandom <devnull@localhost>
Sun, 14 Sep 2008 17:01:49 +0000 (17:01 +0000)
committerdevicerandom <devnull@localhost>
Sun, 14 Sep 2008 17:01:49 +0000 (17:01 +0000)
flatfilts.py

index e3dd57f278432d2e70a908962299a16d0854d0e0..734e7a9c88d11ae3c079785bfa1959d0c647a9bd 100755 (executable)
@@ -353,10 +353,22 @@ class flatfiltsCommands:
         Syntax: setconv variable value
         '''
         args=args.split()
-        try:
-            self.convfilt_config[args[0]]=eval(args[1])
-        except NameError:
-            self.convfilt_config[args[0]]=args[1]
+        #FIXME: a general "set dictionary" function has to be built
+        if len(args)==0:
+            print self.convfilt_config
+        else:
+            if not (args[0] in self.convfilt_config.keys()):
+                print 'This is not an internal convfilt variable!'
+                print 'Run "setconv" without arguments to see a list of defined variables.'
+                return
+            
+            if len(args)==1:
+                print self.convfilt_config[args[0]]
+            elif len(args)>1:
+                try:
+                    self.convfilt_config[args[0]]=eval(args[1])
+                except NameError: #we have a string argument
+                    self.convfilt_config[args[0]]=args[1]
 
 
 #########################