def go_to_line(w, size, key):
    (_, line) = self.source.get_focus()
    lineno_edit = urwid.IntEdit([('label', 'Go to Line   :')], None)
    if self.dialog(urwid.ListBox(urwid.SimpleListWalker([labelled_value('File :', self.source_code_provider.identifier()), labelled_value('Current Line :', (line + 1)), urwid.AttrMap(lineno_edit, 'value')])), [('OK', True), ('Cancel', False)], title='Go to Line Number'):
        lineno = min(max(0, (int(lineno_edit.value()) - 1)), (len(self.source) - 1))
        self.source.set_focus(lineno)
def go_to_line(w, size, key):
    (_, line) = self.source.get_focus()
    lineno_edit = urwid.IntEdit([('label', 'Go to Line   :')], None)
    if self.dialog(urwid.ListBox(urwid.SimpleListWalker([labelled_value('File :', self.source_code_provider.identifier()), labelled_value('Current Line :', (line + 1)), urwid.AttrMap(lineno_edit, 'value')])), [('OK', True), ('Cancel', False)], title='Go to Line Number'):
        lineno = min(max(0, (int(lineno_edit.value()) - 1)), (len(self.source) - 1))
        self.source.set_focus(lineno)