Changeset f951077 in mainline


Ignore:
Timestamp:
2006-06-07T17:46:32Z (18 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b2951e2
Parents:
ce5bcb4
Message:

Fixed config with bad dialog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config.py

    rce5bcb4 rf951077  
    11#!/usr/bin/env python
    22"""
    3 user space configuration script
     3Kernel configuration script
    44"""
    55import sys
     
    88import commands
    99
    10 INPUT = 'uspace.config'
     10INPUT = 'kernel.config'
    1111OUTPUT = 'Makefile.config'
    1212TMPOUTPUT = 'Makefile.config.tmp'
     
    109109
    110110
     111def eof_checker(fnc):
     112    def wrapper(self, *args, **kw):
     113        try:
     114            return fnc(self, *args, **kw)
     115        except EOFError:
     116            return getattr(self.bckdialog,fnc.func_name)(*args, **kw)
     117    return wrapper
     118
    111119class Dialog(NoDialog):
    112120    def __init__(self):
     
    114122        self.dlgcmd = os.environ.get('DIALOG','dialog')
    115123        self.title = ''
    116         self.backtitle = 'HelenOS User Space Configuration'
     124        self.backtitle = 'HelenOS Kernel Configuration'
    117125       
    118126        if os.system('%s --print-maxsize >/dev/null 2>&1' % self.dlgcmd) != 0:
    119127            raise NotImplementedError
     128       
     129        self.bckdialog = NoDialog()
    120130
    121131    def set_title(self,text):
    122132        self.title = text
     133        self.bckdialog.set_title(text)
    123134       
    124135    def calldlg(self,*args,**kw):
     
    177188            return 'y'
    178189        return 'n'
     190    yesno = eof_checker(yesno)
    179191
    180192    def menu(self, text, choices, button, defopt=None):
     
    204216            raise EOFError
    205217        return data
     218    menu = eof_checker(menu)
    206219   
    207220    def choice(self, text, choices, defopt=None):
     
    223236            raise EOFError
    224237        return data
     238    choice = eof_checker(choice)
    225239   
    226240def read_defaults(fname,defaults):
     
    474488    os.rename(TMPOUTPUT, OUTPUT)
    475489   
    476     if not defmode and dlg.yesno('Rebuild user space?') == 'y':
     490    if not defmode and dlg.yesno('Rebuild kernel?') == 'y':
    477491        os.execlp('make','make','clean','build')
    478492
Note: See TracChangeset for help on using the changeset viewer.