Changes in tools/config.py [28f4adb:4e9aaf5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/config.py
r28f4adb r4e9aaf5 48 48 "Read saved values from last configuration run" 49 49 50 inf = open(fname, 'r')50 inf = file(fname, 'r') 51 51 52 52 for line in inf: … … 103 103 condval = res.group(3) 104 104 105 if (not condname in defaults):105 if (not defaults.has_key(condname)): 106 106 varval = '' 107 107 else: … … 131 131 "Parse configuration file" 132 132 133 inf = open(fname, 'r')133 inf = file(fname, 'r') 134 134 135 135 name = '' … … 219 219 continue 220 220 221 if (not varname in defaults):221 if (not defaults.has_key(varname)): 222 222 return False 223 223 … … 232 232 233 233 try: 234 version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0]. decode().split(':')234 version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].split(':') 235 235 sys.stderr.write("ok\n") 236 236 except: … … 246 246 revision = None 247 247 248 outmk = open(mkname, 'w')249 outmc = open(mcname, 'w')248 outmk = file(mkname, 'w') 249 outmc = file(mcname, 'w') 250 250 251 251 outmk.write('#########################################\n') … … 263 263 continue 264 264 265 if (not varname in defaults):265 if (not defaults.has_key(varname)): 266 266 default = '' 267 267 else: … … 368 368 # Cancel out all defaults which have to be deduced 369 369 for varname, vartype, name, choices, cond in ask_names: 370 if ((vartype == 'y') and ( varname in defaults) and (defaults[varname] == '*')):370 if ((vartype == 'y') and (defaults.has_key(varname)) and (defaults[varname] == '*')): 371 371 defaults[varname] = None 372 372 … … 385 385 position = cnt 386 386 387 if (not varname in defaults):387 if (not defaults.has_key(varname)): 388 388 default = None 389 389 else: … … 428 428 cnt += 1 429 429 430 if (position != None) and (position >= len(options)):430 if (position >= options): 431 431 position = None 432 432 … … 449 449 450 450 position = None 451 if (not value in opt2row):451 if (not opt2row.has_key(value)): 452 452 raise RuntimeError("Error selecting value: %s" % value) 453 453 454 454 (selname, seltype, name, choices) = opt2row[value] 455 455 456 if (not selname in defaults):456 if (not defaults.has_key(selname)): 457 457 default = None 458 458 else:
Note:
See TracChangeset
for help on using the changeset viewer.