X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc-config-tty;h=b31e022e9b35e58bdbd298cc946688611348171c;hb=392955e7388889dc644569d06dbed5558cb1d530;hp=9bb8abecdf80f179c1a0dec869ea5898e5d8dc0e;hpb=a7939989156577d179d5439aac9467e3438dbc98;p=myplc.git diff --git a/plc-config-tty b/plc-config-tty index 9bb8abe..b31e022 100755 --- a/plc-config-tty +++ b/plc-config-tty @@ -6,6 +6,11 @@ # # -d is for the myplc-devel package +# we use 3 instances of PLCConfiguration throughout: +# cdef : models the defaults, from plc_default.xml +# cread : merged from plc_default & configs/site.xml +# cwrite : site.xml + pending changes + import sys import os import re @@ -15,8 +20,8 @@ import getopt from plc_config import PLCConfiguration #################### -release_id = "$Id: plc-config-tty,v 1.5 2006/08/08 16:59:23 thierry Exp $" -release_rev = "$Revision$" +release_id = "$Id: plc-config-tty,v 1.7 2006/08/18 09:31:55 thierry Exp $" +release_rev = "$Revision: 1.7 $" def init_flavour (flavour): global service @@ -376,8 +381,12 @@ def mainloop (cdef, cread, cwrite, default_config, site_config, consolidated_con elif mode == 'CATEGORY': prompt_variables_category(cdef,cread,cwrite,category_id,show_comments) elif mode == 'VARIABLE': - prompt_variable (cdef,cread,cwrite,category,variable, - show_comments,False) + try: + prompt_variable (cdef,cread,cwrite,category,variable, + show_comments,False) + except Exception, inst: + if (str(inst) != 'BailOut'): + raise elif (command in "vVsSlL"): show_value=(command in "sSlL") (c1,c2,c3) = (cdef, cread, cwrite) @@ -425,7 +434,7 @@ def main (): if opt[0] == "-h": usage() if opt[0] == "-v": - print ("This is %s - %s" %(command,release_id)) + print ("This is %s - %s" %(command,release_rev)) sys.exit(1) if opt[0] == "-d": init_flavour("devel")