How to use the pudb.ui_tools.SelectableText function in pudb

To help you get started, we’ve selected a few pudb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inducer / pudb / pudb / debugger.py View on Github external
def add_cmdline_content(s, attr):
            s = s.rstrip("\n")

            from pudb.ui_tools import SelectableText
            self.cmdline_contents.append(
                    urwid.AttrMap(SelectableText(s),
                        attr, "focused "+attr))

            # scroll to end of last entry
            self.cmdline_list.set_focus_valign("bottom")
            self.cmdline_list.set_focus(len(self.cmdline_contents) - 1,
                    coming_from="above")
github inducer / pudb / pudb / debugger.py View on Github external
def build_filtered_mod_list(filt_string=""):
                modules = sorted(name
                        # mod_exists may change the size of sys.modules,
                        # causing this to crash. Copy to a list.
                        for name, mod in list(sys.modules.items())
                        if mod_exists(mod))

                result = [urwid.AttrMap(SelectableText(mod),
                        None, "focused selectable")
                        for mod in modules if filt_string in mod]
                new_mod_text.set_text("<<< IMPORT MODULE '%s' >>>" % filt_string)
                result.append(new_mod_entry)
                return result
github inducer / pudb / pudb / debugger.py View on Github external
def build_filtered_mod_list(filt_string=""):
                modules = sorted(name
                        for name, mod in sys.modules.items()
                        if mod_exists(mod))

                result = [urwid.AttrMap(SelectableText(mod),
                        None, "focused selectable")
                        for mod in modules if filt_string in mod]
                new_mod_text.set_text("<<< IMPORT MODULE '%s' >>>" % filt_string)
                result.append(new_mod_entry)
                return result
github inducer / pudb / pudb / debugger.py View on Github external
return False
                if mod.__file__ is None:
                    return False
                filename = mod.__file__

                base, ext = splitext(filename)
                ext = ext.lower()

                from os.path import exists

                if ext == ".pyc":
                    return exists(base+".py")
                else:
                    return ext == ".py"

            new_mod_text = SelectableText("-- update me --")
            new_mod_entry = urwid.AttrMap(new_mod_text,
                    None, "focused selectable")

            def build_filtered_mod_list(filt_string=""):
                modules = sorted(name
                        # mod_exists may change the size of sys.modules,
                        # causing this to crash. Copy to a list.
                        for name, mod in list(sys.modules.items())
                        if mod_exists(mod))

                result = [urwid.AttrMap(SelectableText(mod),
                        None, "focused selectable")
                        for mod in modules if filt_string in mod]
                new_mod_text.set_text("<<< IMPORT MODULE '%s' >>>" % filt_string)
                result.append(new_mod_entry)
                return result