def set_frame_index(self, index):
    self.curindex = index
    if ((index < 0) or (index >= len(self.stack))):
        return
    (self.curframe, lineno) = self.stack[index]
    filename = self.curframe.f_code.co_filename
    import linecache
    if (not linecache.getlines(filename)):
        code = self.curframe.f_globals.get('_MODULE_SOURCE_CODE')
        if (code is not None):
            self.ui.set_current_line(lineno, DirectSourceCodeProvider(self.curframe.f_code.co_name, code))
        else:
            self.ui.set_current_line(lineno, NullSourceCodeProvider())
    else:
        self.ui.set_current_line(lineno, FileSourceCodeProvider(self, filename))
    self.ui.update_var_view()
    self.ui.update_stack()
    self.ui.stack_list._w.set_focus(self.ui.translate_ui_stack_index(index))
def set_frame_index(self, index):
    self.curindex = index
    if ((index < 0) or (index >= len(self.stack))):
        return
    (self.curframe, lineno) = self.stack[index]
    filename = self.curframe.f_code.co_filename
    import linecache
    if (not linecache.getlines(filename)):
        code = self.curframe.f_globals.get('_MODULE_SOURCE_CODE')
        if (code is not None):
            self.ui.set_current_line(lineno, DirectSourceCodeProvider(self.curframe.f_code.co_name, code))
        else:
            self.ui.set_current_line(lineno, NullSourceCodeProvider())
    else:
        self.ui.set_current_line(lineno, FileSourceCodeProvider(self, filename))
    self.ui.update_var_view()
    self.ui.update_stack()
    self.ui.stack_list._w.set_focus(self.ui.translate_ui_stack_index(index))