Changeset 994cf4b in mainline


Ignore:
Timestamp:
2005-12-07T00:35:47Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
253f8590
Parents:
beb39ee3
Message:

Correct menu even for non-'dialog' based systems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config.py

    rbeb39ee3 r994cf4b  
    8080
    8181    def menu(self, text, choices, button, defopt=None):
    82         return self.choice(text, [button] + choices)
     82        menu = []
     83        for key, descr in choices:
     84            txt = key + (45-len(key))*' ' + ': ' + descr
     85            menu.append((key, txt))
     86           
     87        return self.choice(text, [button] + menu)
    8388       
    8489    def choice(self, text, choices, defopt=None):
     
    366371    if os.path.exists(OUTPUT):
    367372        read_defaults(OUTPUT, defaults)
    368    
     373
     374    # Dry run only with defaults
    369375    varnames = parse_config(INPUT, TMPOUTPUT, DefaultDialog(dlg), defaults)
    370376    # If not in default mode, present selection of all possibilities
     
    372378        defopt = 0
    373379        while 1:
     380            # varnames contains variable names that were in the
     381            # last question set
    374382            choices = [ (x[1],defaults[x[0]]) for x in varnames ]
    375383            res = dlg.menu('Configuration',choices,('save','Save'),defopt)
     
    382390                    defopt = i
    383391                    break
     392            # Ask the user a simple question, produce output
     393            # as if the user answered all the other questions
     394            # with default answer
    384395            varnames = parse_config(INPUT, TMPOUTPUT, dlg, defaults,
    385396                                    askonly=varnames[i][0])
Note: See TracChangeset for help on using the changeset viewer.