Subversion Repositories HelenOS

Rev

Rev 3909 | Rev 3937 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3909 Rev 3916
Line 52... Line 52...
52
            defaults[res.group(1)] = res.group(2)
52
            defaults[res.group(1)] = res.group(2)
53
   
53
   
54
    inf.close()
54
    inf.close()
55
 
55
 
56
def check_condition(text, defaults, ask_names):
56
def check_condition(text, defaults, ask_names):
57
    "Check for condition"
57
    "Check that the condition specified on input line is True (only CNF and DNF is supported)"
58
   
58
   
59
    ctype = 'cnf'
59
    ctype = 'cnf'
60
   
60
   
61
    if ((')|' in text) or ('|(' in text)):
61
    if ((')|' in text) or ('|(' in text)):
62
        ctype = 'dnf'
62
        ctype = 'dnf'
Line 81... Line 81...
81
    if (ctype == 'cnf'):
81
    if (ctype == 'cnf'):
82
        return True
82
        return True
83
    return False
83
    return False
84
 
84
 
85
def check_inside(text, defaults, ctype):
85
def check_inside(text, defaults, ctype):
86
    "Check that the condition specified on input line is True (only CNF is supported)"
86
    "Check for condition"
87
   
87
   
88
    if (ctype == 'cnf'):
88
    if (ctype == 'cnf'):
89
        conds = text.split('|')
89
        conds = text.split('|')
90
    else:
90
    else:
91
        conds = text.split('&')
91
        conds = text.split('&')
Line 298... Line 298...
298
    screen = xtui.screen_init()
298
    screen = xtui.screen_init()
299
    try:
299
    try:
300
        selname = None
300
        selname = None
301
        while True:
301
        while True:
302
           
302
           
-
 
303
            # Cancel out all defaults which have to be deduced
-
 
304
            for varname, vartype, name, choices, cond in ask_names:
-
 
305
                if (vartype == 'y'):
-
 
306
                    defaults[varname] = None
-
 
307
           
303
            options = []
308
            options = []
304
            opt2row = {}
309
            opt2row = {}
305
            position = None
310
            position = None
306
            cnt = 0
311
            cnt = 0
307
            for varname, vartype, name, choices, cond in ask_names:
312
            for varname, vartype, name, choices, cond in ask_names: