From afe8da7a02c0650f0f6be8ab16b2494652d69d0d Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 16 Jul 2012 11:38:16 -0400 Subject: [PATCH] fixed list_categories --- config/sfa-config-tty | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/sfa-config-tty b/config/sfa-config-tty index 26f48926..0e97d460 100755 --- a/config/sfa-config-tty +++ b/config/sfa-config-tty @@ -155,8 +155,8 @@ def print_name_comments (config, cid, vid): #################### def list_categories (config): result=[] - for (category_id, (category, variables)) in config.variables().iteritems(): - result += [category_id] + for section in config.sections(): + result += [section] return result def print_categories (config): @@ -167,10 +167,10 @@ def print_categories (config): #################### def list_category (config, cid): result=[] - for (category_id, (category, variables)) in config.variables().iteritems(): - if (cid == category_id): - for variable in variables.values(): - result += ["%s_%s" %(cid,variable['id'])] + for section in config.sections(): + if section == cid.lower(): + for (name,value) in config.items(section): + result += ["%s_%s" %(cid,name)] return result def print_category (config, cid, show_comments=True): -- 2.43.0