Rev 604 | Rev 707 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 604 | Rev 626 | ||
---|---|---|---|
Line 274... | Line 274... | ||
274 | raise RuntimeError("Invalid condition: %s" % cond) |
274 | raise RuntimeError("Invalid condition: %s" % cond) |
275 | condname = res.group(1) |
275 | condname = res.group(1) |
276 | oper = res.group(2) |
276 | oper = res.group(2) |
277 | condval = res.group(3) |
277 | condval = res.group(3) |
278 | if condname not in seen_vars: |
278 | if condname not in seen_vars: |
- | 279 | varval = '' |
|
279 | raise RuntimeError("Variable %s not defined before being asked." %\ |
280 | ## raise RuntimeError("Variable %s not defined before being asked." %\ |
280 | condname) |
281 | ## condname) |
281 | if not defaults.has_key(condname): |
282 | elif not defaults.has_key(condname): |
282 | raise RuntimeError("Condition var %s does not exist: %s" % \ |
283 | raise RuntimeError("Condition var %s does not exist: %s" % \ |
283 | (condname,text)) |
284 | (condname,text)) |
284 | 285 | else: |
|
- | 286 | varval = defaults[condname] |
|
285 | if ctype == 'cnf': |
287 | if ctype == 'cnf': |
286 | if oper == '=' and condval == defaults[condname]: |
288 | if oper == '=' and condval == varval: |
287 | return True |
289 | return True |
288 | if oper == '!=' and condval != defaults[condname]: |
290 | if oper == '!=' and condval != varval: |
289 | return True |
291 | return True |
290 | else: |
292 | else: |
291 | if oper== '=' and condval != defaults[condname]: |
293 | if oper== '=' and condval != varval: |
292 | return False |
294 | return False |
293 | if oper== '!=' and condval == defaults[condname]: |
295 | if oper== '!=' and condval == varval: |
294 | return False |
296 | return False |
295 | if ctype=='cnf': |
297 | if ctype=='cnf': |
296 | return False |
298 | return False |
297 | return True |
299 | return True |
298 | 300 |