Rev 4342 | Rev 4344 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4342 | Rev 4343 | ||
---|---|---|---|
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 255... | Line 255... | ||
255 | if ((vartype == "y") or (vartype == "y/n") or (vartype == "n/y")): |
255 | if ((vartype == "y") or (vartype == "y/n") or (vartype == "n/y")): |
256 | if (default == "y"): |
256 | if (default == "y"): |
257 | outmc.write('/* %s */\n#define %s\n\n' % (name, varname)) |
257 | outmc.write('/* %s */\n#define %s\n\n' % (name, varname)) |
258 | outdf.write(' -D%s' % varname) |
258 | outdf.write(' -D%s' % varname) |
259 | else: |
259 | else: |
260 | outmc.write('/* %s */\n#define %s %s\n\n' % (name, varname, default)) |
260 | outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, default, varname, default)) |
261 | outdf.write(' -D%s=%s' % (varname, default)) |
261 | outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default)) |
262 | 262 | ||
263 | outmk.write('REVISION = %s\n' % revision) |
263 | outmk.write('REVISION = %s\n' % revision) |
264 | outmk.write('TIMESTAMP = %s\n' % timestamp) |
264 | outmk.write('TIMESTAMP = %s\n' % timestamp) |
265 | 265 | ||
266 | outmc.write('#define REVISION %s\n' % revision) |
266 | outmc.write('#define REVISION %s\n' % revision) |
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: |