From: devicerandom Date: Sun, 14 Sep 2008 17:01:49 +0000 (+0000) Subject: (flatfilts.py) setconv stub fixed X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2be265174f80b405eb253554297988116fbf2b39;p=hooke.git (flatfilts.py) setconv stub fixed --- diff --git a/flatfilts.py b/flatfilts.py index e3dd57f..734e7a9 100755 --- a/flatfilts.py +++ b/flatfilts.py @@ -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] #########################