示例#1
0
def abort(max_x, max_y):
    text = _(
        'Press Ctrl+c to exit or any key to continue. After exiting the installer please reboot the system or press Ctrl+Alt+F2 to get an shell prompt.'
    )
    message = objects.warning(text, max_y, max_x)
    message.draw()
    c = stdscr.getch()
    return 0
示例#2
0
def next_screen_profile(view_warning):
    installer.obj[installer.current].put_result(installer.result)
    installer.obj[installer.current].profile_prerun()

    if installer.obj[installer.current].profile_complete():
        result = installer.obj[installer.current].run_profiled()
        if result:
            installer.result.update(result)
            installer.profile[installer.obj[
                installer.current].modheader()] = result

        i = 1
        if installer.current + i >= len(installer.modules):
            debug('>= len(self.modules)')
            installer.write_profile(1)
            return 2
        while installer.check_depends(installer.current + i):
            i = i + 1
            if installer.current + i >= len(installer.modules):
                debug('>= len(self.modules)')
                installer.write_profile(1)
                return 2
        installer.current = installer.current + i
        return 0
    else:
        installer.write_profile(1)
        if hasattr(installer.obj[installer.current], 'message'):
            debug('%s' % installer.obj[installer.current].message)
        if hasattr(installer.obj[installer.current],
                   'message') and (hasattr(installer.obj[installer.current],
                                           'view_warning') or view_warning):
            view_warning = 1
            missing = installer.obj[installer.current].message
            if missing:
                message = objects.warning(missing, installer.max_y,
                                          installer.max_x)
                message.draw()
                stdscr.getch()
                installer.obj[installer.current].layout_reset()

        debug('incomplete: %d' % installer.current)
        for i in installer.obj[installer.current].modvars():
            if not installer.obj[installer.current].all_results.has_key(i):
                installer.obj[installer.current].all_results[i] = ''
        if not view_warning:
            installer.left_menu()
            installer.obj[installer.current].startIt = 1
        installer.draw_all()
        return 1
示例#3
0
文件: main.py 项目: B-Rich/smart
def next_screen_profile(view_warning):
	installer.obj[installer.current].put_result(installer.result)
	installer.obj[installer.current].profile_prerun()

	if installer.obj[installer.current].profile_complete():
		result=installer.obj[installer.current].run_profiled()
		if result:
			installer.result.update(result)
			installer.profile[installer.obj[installer.current].modheader()]=result

		i=1
		if installer.current+i >= len(installer.modules):
			debug('>= len(self.modules)')
			installer.write_profile(1)
			return 2
		while installer.check_depends(installer.current+i):
			i=i+1
			if installer.current+i >= len(installer.modules):
				debug('>= len(self.modules)')
				installer.write_profile(1)
				return 2
		installer.current=installer.current+i
		return 0
	else:
		installer.write_profile(1)
		if hasattr(installer.obj[installer.current], 'message'):
			debug('%s' % installer.obj[installer.current].message)
		if hasattr(installer.obj[installer.current], 'message') and (hasattr(installer.obj[installer.current], 'view_warning') or view_warning):
			view_warning=1
			missing=installer.obj[installer.current].message
			if missing:
				message=objects.warning(missing,installer.max_y,installer.max_x)
				message.draw()
				stdscr.getch()
				installer.obj[installer.current].layout_reset()

		debug('incomplete: %d' % installer.current)
		for i in installer.obj[installer.current].modvars():
			if not installer.obj[installer.current].all_results.has_key(i):
				installer.obj[installer.current].all_results[i]=''
		if not view_warning:
			installer.left_menu()
			installer.obj[installer.current].startIt=1
		installer.draw_all()
		return 1
示例#4
0
文件: main.py 项目: B-Rich/smart
def next_screen():
	if hasattr(installer.obj[installer.current], 'postrun'):
		installer.obj[installer.current].postrun()
	missing=installer.obj[installer.current].incomplete()
	if missing:
		if type(missing) == type(1):
			return 0
		message=objects.warning(missing,installer.max_y,installer.max_x)
		message.draw()
		c = None
		while c != 27:
			c = stdscr.getch()
		installer.draw_all()
	else:
		installer.result_update()
		i=1
		while installer.check_depends(installer.current+i):
			i=i+1
		if installer.chg_current(i):
			return 1
		return 0
示例#5
0
def next_screen():
    if hasattr(installer.obj[installer.current], 'postrun'):
        installer.obj[installer.current].postrun()
    missing = installer.obj[installer.current].incomplete()
    if missing:
        if type(missing) == type(1):
            return 0
        message = objects.warning(missing, installer.max_y, installer.max_x)
        message.draw()
        c = None
        while c != 27:
            c = stdscr.getch()
        installer.draw_all()
    else:
        installer.result_update()
        i = 1
        while installer.check_depends(installer.current + i):
            i = i + 1
        if installer.chg_current(i):
            return 1
        return 0
示例#6
0
文件: main.py 项目: B-Rich/smart
def abort(max_x,max_y):
	text=_('Press Ctrl+c to exit or any key to continue. After exiting the installer please reboot the system or press Ctrl+Alt+F2 to get an shell prompt.')
	message=objects.warning(text, max_y, max_x)
	message.draw()
	c = stdscr.getch()
	return 0