Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if bp.cond is None:
cond = ""
else:
cond = str(bp.cond)
enabled_checkbox = urwid.CheckBox(
"Enabled", bp.enabled)
cond_edit = urwid.Edit([
("label", "Condition: ")
], cond)
ign_count_edit = urwid.IntEdit([
("label", "Ignore the next N times: ")
], bp.ignore)
lb = urwid.ListBox([
labelled_value("File: ", bp.file),
labelled_value("Line: ", bp.line),
labelled_value("Hits: ", bp.hits),
urwid.Text(""),
enabled_checkbox,
urwid.AttrMap(cond_edit, "value", "value"),
urwid.AttrMap(ign_count_edit, "value", "value"),
])
result = self.dialog(lb, [
("OK", True),
("Cancel", False),
None,
("Delete", "del"),
("Location", "loc"),
], title="Edit Breakpoint")
("OK", True),
("Cancel", False),
]
if var.watch_expr is not None:
watch_edit = urwid.Edit([
("label", "Watch expression: ")
], var.watch_expr.expression)
id_segment = [urwid.AttrMap(watch_edit, "value"), urwid.Text("")]
buttons.extend([None, ("Delete", "del")])
title = "Watch Expression Options"
else:
id_segment = [
labelled_value("Identifier Path: ", var.id_path),
urwid.Text(""),
]
title = "Variable Inspection Options"
rb_grp_show = []
rb_show_type = urwid.RadioButton(rb_grp_show, "Show Type",
iinfo.display_type == "type")
rb_show_repr = urwid.RadioButton(rb_grp_show, "Show repr()",
iinfo.display_type == "repr")
rb_show_str = urwid.RadioButton(rb_grp_show, "Show str()",
iinfo.display_type == "str")
rb_show_custom = urwid.RadioButton(
rb_grp_show, "Show custom (set in prefs)",
iinfo.display_type == CONFIG["custom_stringifier"])
else:
cond = str(bp.cond)
enabled_checkbox = urwid.CheckBox(
"Enabled", bp.enabled)
cond_edit = urwid.Edit([
("label", "Condition: ")
], cond)
ign_count_edit = urwid.IntEdit([
("label", "Ignore the next N times: ")
], bp.ignore)
lb = urwid.ListBox([
labelled_value("File: ", bp.file),
labelled_value("Line: ", bp.line),
labelled_value("Hits: ", bp.hits),
urwid.Text(""),
enabled_checkbox,
urwid.AttrMap(cond_edit, "value", "value"),
urwid.AttrMap(ign_count_edit, "value", "value"),
])
result = self.dialog(lb, [
("OK", True),
("Cancel", False),
None,
("Delete", "del"),
("Location", "loc"),
], title="Edit Breakpoint")
if result == True:
bp.enabled = enabled_checkbox.get_state()
def go_to_line(w, size, key):
_, line = self.source.get_focus()
lineno_edit = urwid.IntEdit([
("label", "Line number: ")
], line+1)
if self.dialog(
urwid.ListBox([
labelled_value("File :", self.shown_file),
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)
("OK", True),
("Cancel", False),
]
if var.watch_expr is not None:
watch_edit = urwid.Edit([
("label", "Watch expression: ")
], var.watch_expr.expression)
id_segment = [urwid.AttrMap(watch_edit, "value"), urwid.Text("")]
buttons.extend([None, ("Delete", "del")])
title = "Watch Expression Options"
else:
id_segment = [
labelled_value("Identifier Path: ", var.id_path),
urwid.Text(""),
]
title = "Variable Inspection Options"
rb_grp = []
rb_show_type = urwid.RadioButton(rb_grp, "Show Type",
iinfo.display_type == "type")
rb_show_repr = urwid.RadioButton(rb_grp, "Show repr()",
iinfo.display_type == "repr")
rb_show_str = urwid.RadioButton(rb_grp, "Show str()",
iinfo.display_type == "str")
rb_show_custom = urwid.RadioButton(rb_grp, "Show custom (set in prefs)",
iinfo.display_type == CONFIG["custom_stringifier"])
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)
else:
cond = str(bp.cond)
enabled_checkbox = urwid.CheckBox(
"Enabled", bp.enabled)
cond_edit = urwid.Edit([
("label", "Condition: ")
], cond)
ign_count_edit = urwid.IntEdit([
("label", "Ignore the next N times: ")
], bp.ignore)
lb = urwid.ListBox(urwid.SimpleListWalker([
labelled_value("File: ", bp.file),
labelled_value("Line: ", bp.line),
labelled_value("Hits: ", bp.hits),
urwid.Text(""),
enabled_checkbox,
urwid.AttrMap(cond_edit, "value", "value"),
urwid.AttrMap(ign_count_edit, "value", "value"),
]))
result = self.dialog(lb, [
("OK", True),
("Cancel", False),
None,
("Delete", "del"),
("Location", "loc"),
], title="Edit Breakpoint")
if result is True:
bp.enabled = enabled_checkbox.get_state()
cond = ""
else:
cond = str(bp.cond)
enabled_checkbox = urwid.CheckBox(
"Enabled", bp.enabled)
cond_edit = urwid.Edit([
("label", "Condition: ")
], cond)
ign_count_edit = urwid.IntEdit([
("label", "Ignore the next N times: ")
], bp.ignore)
lb = urwid.ListBox(urwid.SimpleListWalker([
labelled_value("File: ", bp.file),
labelled_value("Line: ", bp.line),
labelled_value("Hits: ", bp.hits),
urwid.Text(""),
enabled_checkbox,
urwid.AttrMap(cond_edit, "value", "value"),
urwid.AttrMap(ign_count_edit, "value", "value"),
]))
result = self.dialog(lb, [
("OK", True),
("Cancel", False),
None,
("Delete", "del"),
("Location", "loc"),
], title="Edit Breakpoint")
if result is True:
cond = ""
else:
cond = str(bp.cond)
enabled_checkbox = urwid.CheckBox(
"Enabled", bp.enabled)
cond_edit = urwid.Edit([
("label", "Condition: ")
], cond)
ign_count_edit = urwid.IntEdit([
("label", "Ignore the next N times: ")
], bp.ignore)
lb = urwid.ListBox([
labelled_value("File: ", bp.file),
labelled_value("Line: ", bp.line),
labelled_value("Hits: ", bp.hits),
urwid.Text(""),
enabled_checkbox,
urwid.AttrMap(cond_edit, "value", "value"),
urwid.AttrMap(ign_count_edit, "value", "value"),
])
result = self.dialog(lb, [
("OK", True),
("Cancel", False),
None,
("Delete", "del"),
("Location", "loc"),
], title="Edit Breakpoint")
if result == True: