From c23002cd6993716dc2cdb7721cea8d9121877fba Mon Sep 17 00:00:00 2001 From: devicerandom Date: Sun, 14 Sep 2008 17:01:49 +0000 Subject: [PATCH] (flatfilts.py) setconv stub fixed --- flatfilts.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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] ######################### -- 2.26.2