Changeset 9d5e23c in mainline for tools/config.py
- Timestamp:
- 2005-12-07T23:52:25Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ac0cb2a
- Parents:
- f62355a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/config.py
rf62355a r9d5e23c 266 266 def parse_config(input, output, dlg, defaults={}, askonly=None): 267 267 "Parse configuration file and create Makefile.config on the fly" 268 def ask_the_question( ):268 def ask_the_question(dialog): 269 269 "Ask question based on the type of variables to ask" 270 270 # This is quite a hack, this thingy is written just to 271 271 # have access to local variables.. 272 272 if vartype == 'y/n': 273 return d lg.yesno(comment, default)273 return dialog.yesno(comment, default) 274 274 elif vartype == 'n/y': 275 return d lg.noyes(comment, default)275 return dialog.noyes(comment, default) 276 276 elif vartype == 'choice': 277 277 defopt = None … … 281 281 defopt = i 282 282 break 283 return d lg.choice(comment, choices, defopt)283 return dialog.choice(comment, choices, defopt) 284 284 else: 285 285 raise RuntimeError("Bad method: %s" % vartype) … … 317 317 if arg.startswith('$'): 318 318 args[i] = defaults[arg[1:]] 319 320 subc = os.popen(' '.join(args),'r') 321 data = subc.read().strip() 322 if subc.close(): 319 data,status = commands.getstatusoutput(' '.join(args)) 320 if status: 323 321 raise RuntimeError('Error running: %s' % ' '.join(args)) 324 outf.write('%s = %s\n' % (varname,data ))322 outf.write('%s = %s\n' % (varname,data.strip())) 325 323 continue 326 324 … … 348 346 349 347 if default is None or not askonly or askonly == varname: 350 default = ask_the_question() 348 default = ask_the_question(dlg) 349 else: 350 default = ask_the_question(DefaultDialog(dlg)) 351 351 352 352 outf.write('%s = %s\n' % (varname, default))
Note:
See TracChangeset
for help on using the changeset viewer.