only strip whitespace from input
[sfa.git] / config / sfa-config-tty
index 26f4892..5ec73d8 100755 (executable)
@@ -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):
@@ -335,7 +335,7 @@ def mainloop (cdef, cread, cwrite, default_config, site_config, consolidated_con
     global service
     while True:
         try:
-            answer = raw_input("Enter command (u for usual changes, w to save, ? for help) ").strip()
+            answer = raw_input("Enter command (u for usual changes, w to save, ? for help) ").strip(" ")
         except EOFError:
             answer =""
         except KeyboardInterrupt: