after_merge stringlengths 28 79.6k | before_merge stringlengths 20 79.6k | url stringlengths 38 71 | full_traceback stringlengths 43 922k | traceback_type stringclasses 555
values |
|---|---|---|---|---|
def console(self, console):
self._console = console
self.dockConsole.widget = console
self._update_palette()
| def console(self, console):
self._console = console
self.dockConsole.widget = console
self._update_palette(None)
| https://github.com/napari/napari/issues/1079 | Traceback (most recent call last):
File "/Users/gbokota/Documents/projekty/napari/napari/components/viewer_model.py", line 418, in _toggle_theme
self.theme = theme_names[(cur_theme + 1) % len(theme_names)]
File "/Users/gbokota/Documents/projekty/napari/napari/components/viewer_model.py", line 130, in theme
self.palette... | AttributeError |
def _update_palette(self, event=None):
"""Update the napari GUI theme."""
# template and apply the primary stylesheet
themed_stylesheet = template(self.raw_stylesheet, **self.viewer.palette)
if self._console is not None:
self.console._update_palette(self.viewer.palette, themed_stylesheet)
se... | def _update_palette(self, event):
"""Update the napari GUI theme."""
# template and apply the primary stylesheet
themed_stylesheet = template(self.raw_stylesheet, **self.viewer.palette)
if self._console is not None:
self.console._update_palette(self.viewer.palette, themed_stylesheet)
self.se... | https://github.com/napari/napari/issues/1079 | Traceback (most recent call last):
File "/Users/gbokota/Documents/projekty/napari/napari/components/viewer_model.py", line 418, in _toggle_theme
self.theme = theme_names[(cur_theme + 1) % len(theme_names)]
File "/Users/gbokota/Documents/projekty/napari/napari/components/viewer_model.py", line 130, in theme
self.palette... | AttributeError |
def toggle_console_visibility(self, event=None):
"""Toggle console visible and not visible.
Imports the console the first time it is requested.
"""
# force instantiation of console if not already instantiated
_ = self.console
viz = not self.dockConsole.isVisible()
# modulate visibility at ... | def toggle_console_visibility(self, event):
"""Toggle console visible and not visible.
Imports the console the first time it is requested.
"""
# force instantiation of console if not already instantiated
_ = self.console
viz = not self.dockConsole.isVisible()
# modulate visibility at the d... | https://github.com/napari/napari/issues/1079 | Traceback (most recent call last):
File "/Users/gbokota/Documents/projekty/napari/napari/components/viewer_model.py", line 418, in _toggle_theme
self.theme = theme_names[(cur_theme + 1) % len(theme_names)]
File "/Users/gbokota/Documents/projekty/napari/napari/components/viewer_model.py", line 130, in theme
self.palette... | AttributeError |
def __init__(self, layer):
super().__init__(layer)
self.layer.events.mode.connect(self.set_mode)
self.layer.events.n_dimensional.connect(self._on_n_dim_change)
self.layer.events.symbol.connect(self._on_symbol_change)
self.layer.events.size.connect(self._on_size_change)
self.layer.events.current... | def __init__(self, layer):
super().__init__(layer)
self.layer.events.mode.connect(self.set_mode)
self.layer.events.n_dimensional.connect(self._on_n_dim_change)
self.layer.events.symbol.connect(self._on_symbol_change)
self.layer.events.size.connect(self._on_size_change)
self.layer.events.edge_co... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def _on_display_change(self):
parent = self.node.parent
self.node.transforms = ChainTransform()
self.node.parent = None
if self.layer.dims.ndisplay == 2:
self.node = Compound([Markers(), Markers(), Line()])
else:
self.node = Compound([Markers(), Markers()])
self.node.parent = pa... | def _on_display_change(self):
parent = self.node.parent
self.node.transforms = ChainTransform()
self.node.parent = None
if self.layer.dims.ndisplay == 2:
self.node = Compound([Markers(), Markers(), Line()])
else:
self.node = Markers()
self.node.parent = parent
self._reset_ba... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def _on_data_change(self, event=None):
# Check if ndisplay has changed current node type needs updating
if (self.layer.dims.ndisplay == 3 and len(self.node._subvisuals) != 2) or (
self.layer.dims.ndisplay == 2 and len(self.node._subvisuals) != 3
):
self._on_display_change()
self._on_... | def _on_data_change(self, event=None):
# Check if ndisplay has changed current node type needs updating
if (self.layer.dims.ndisplay == 3 and not isinstance(self.node, Markers)) or (
self.layer.dims.ndisplay == 2 and not isinstance(self.node, Compound)
):
self._on_display_change()
se... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def _on_highlight_change(self, event=None):
if len(self.layer._highlight_index) > 0:
# Color the hovered or selected points
data = self.layer._data_view[self.layer._highlight_index]
if data.ndim == 1:
data = np.expand_dims(data, axis=0)
size = self.layer._size_view[self.l... | def _on_highlight_change(self, event=None):
if self.layer.dims.ndisplay == 3:
return
if len(self.layer._highlight_index) > 0:
# Color the hovered or selected points
data = self.layer._data_view[self.layer._highlight_index]
if data.ndim == 1:
data = np.expand_dims(dat... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def __init__(
self,
data=None,
*,
properties=None,
symbol="o",
size=10,
edge_width=1,
edge_color="black",
edge_color_cycle=None,
edge_colormap="viridis",
edge_contrast_limits=None,
face_color="white",
face_color_cycle=None,
face_colormap="viridis",
face_contra... | def __init__(
self,
data=None,
*,
properties=None,
symbol="o",
size=10,
edge_width=1,
edge_color="black",
edge_color_cycle=None,
edge_colormap="viridis",
edge_contrast_limits=None,
face_color="white",
face_color_cycle=None,
face_colormap="viridis",
face_contra... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def data(self, data: np.ndarray):
cur_npoints = len(self._data)
self._data = data
# Adjust the size array when the number of points has changed
if len(data) < cur_npoints:
# If there are now fewer points, remove the size and colors of the
# extra ones
with self.events.set_data.b... | def data(self, data: np.ndarray):
cur_npoints = len(self._data)
self._data = data
# Adjust the size array when the number of points has changed
if len(data) < cur_npoints:
# If there are now fewer points, remove the size and colors of the
# extra ones
with self.events.set_data.b... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def current_size(self, size: Union[None, float]) -> None:
self._current_size = size
if (
self._update_properties
and len(self.selected_data) > 0
and self._mode != Mode.ADD
):
for i in self.selected_data:
self.size[i, :] = (self.size[i, :] > 0) * size
self.... | def current_size(self, size: Union[None, float]) -> None:
self._current_size = size
if self._update_properties and len(self.selected_data) > 0:
for i in self.selected_data:
self.size[i, :] = (self.size[i, :] > 0) * size
self.refresh()
self.status = format_float(self.current_size)... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def edge_width(self, edge_width: Union[None, float]) -> None:
self._edge_width = edge_width
self.status = format_float(self.edge_width)
self.events.edge_width()
| def edge_width(self, edge_width: Union[None, float]) -> None:
self._edge_width = edge_width
self.status = format_float(self.edge_width)
self.events.edge_width()
self.events.highlight()
| https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def edge_color(self, edge_color):
# if the provided face color is a string, first check if it is a key in the properties.
# otherwise, assume it is the name of a color
if self._is_color_mapped(edge_color):
if guess_continuous(self.properties[edge_color]):
self._edge_color_mode = ColorMod... | def edge_color(self, edge_color):
# if the provided face color is a string, first check if it is a key in the properties.
# otherwise, assume it is the name of a color
if self._is_color_mapped(edge_color):
if guess_continuous(self.properties[edge_color]):
self._edge_color_mode = ColorMod... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def current_edge_color(self, edge_color: ColorType) -> None:
self._current_edge_color = transform_color(edge_color)
if (
self._update_properties
and len(self.selected_data) > 0
and self._mode != Mode.ADD
):
cur_colors: np.ndarray = self.edge_color
cur_colors[self.sele... | def current_edge_color(self, edge_color: ColorType) -> None:
self._current_edge_color = transform_color(edge_color)
if self._update_properties and len(self.selected_data) > 0:
cur_colors: np.ndarray = self.edge_color
cur_colors[self.selected_data] = self._current_edge_color
self.edge_col... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def face_color(self, face_color):
# if the provided face color is a string, first check if it is a key in the properties.
# otherwise, assume it is the name of a color
if self._is_color_mapped(face_color):
if guess_continuous(self.properties[face_color]):
self._face_color_mode = ColorMod... | def face_color(self, face_color):
# if the provided face color is a string, first check if it is a key in the properties.
# otherwise, assume it is the name of a color
if self._is_color_mapped(face_color):
if guess_continuous(self.properties[face_color]):
self._face_color_mode = ColorMod... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def current_face_color(self, face_color: ColorType) -> None:
self._current_face_color = transform_color(face_color)
if (
self._update_properties
and len(self.selected_data) > 0
and self._mode != Mode.ADD
):
cur_colors: np.ndarray = self.face_color
cur_colors[self.sele... | def current_face_color(self, face_color: ColorType) -> None:
self._current_face_color = transform_color(face_color)
if self._update_properties and len(self.selected_data) > 0:
cur_colors: np.ndarray = self.face_color
cur_colors[self.selected_data] = self._current_face_color
self.face_col... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def refresh_colors(self, update_color_mapping: bool = True):
"""Calculate and update face and edge colors if using a cycle or color map
Parameters
----------
update_color_mapping : bool
If set to True, the function will recalculate the color cycle map
or colormap (whichever is being use... | def refresh_colors(self, update_color_mapping: bool = True):
"""Calculate and update face and edge colors if using a cycle or color map
Parameters
----------
update_color_mapping : bool
If set to True, the function will recalculate the color cycle map
or colormap (whichever is being use... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def selected_data(self, selected_data):
self._selected_data = list(selected_data)
selected = []
for c in self._selected_data:
if c in self._indices_view:
ind = list(self._indices_view).index(c)
selected.append(ind)
self._selected_view = selected
# Update properties b... | def selected_data(self, selected_data):
self._selected_data = list(selected_data)
selected = []
for c in self._selected_data:
if c in self._indices_view:
ind = list(self._indices_view).index(c)
selected.append(ind)
self._selected_view = selected
self._selected_box = s... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def mode(self, mode):
if isinstance(mode, str):
mode = Mode(mode)
if not self.editable:
mode = Mode.PAN_ZOOM
if mode == self._mode:
return
old_mode = self._mode
if mode == Mode.ADD:
self.cursor = "pointing"
self.interactive = False
self.help = "hold... | def mode(self, mode):
if isinstance(mode, str):
mode = Mode(mode)
if not self.editable:
mode = Mode.PAN_ZOOM
if mode == self._mode:
return
old_mode = self._mode
if mode == Mode.ADD:
self.cursor = "pointing"
self.interactive = False
self.help = "hold... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def _set_view_slice(self):
"""Sets the view given the indices to slice with."""
in_slice_data, indices, scale = self._slice_data(self.dims.indices)
# Display points if there are any in this slice
if len(in_slice_data) > 0:
# Get the point sizes
sizes = self.size[np.ix_(indices, self.di... | def _set_view_slice(self):
"""Sets the view given the indices to slice with."""
in_slice_data, indices, scale = self._slice_data(self.dims.indices)
# Display points if there are any in this slice
if len(in_slice_data) > 0:
# Get the point sizes
sizes = self.size[np.ix_(indices, self.di... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def _set_highlight(self, force=False):
"""Render highlights of shapes including boundaries, vertices,
interaction boxes, and the drag selection box when appropriate.
Highlighting only occurs in Mode.SELECT.
Parameters
----------
force : bool
Bool that forces a redraw to occur when `True... | def _set_highlight(self, force=False):
"""Render highlights of shapes including boundaries, vertices,
interaction boxes, and the drag selection box when appropriate
Parameters
----------
force : bool
Bool that forces a redraw to occur when `True`
"""
# Check if any point ids have ch... | https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def add(self, coord):
"""Adds point at coordinate.
Parameters
----------
coord : sequence of indices to add point at
"""
self.data = np.append(self.data, np.atleast_2d(coord), axis=0)
| def add(self, coord):
"""Adds point at coordinate.
Parameters
----------
coord : sequence of indices to add point at
"""
self.data = np.append(self.data, [coord], axis=0)
| https://github.com/napari/napari/issues/901 | WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in ch... | ValueError |
def on_mouse_press(self, event):
"""Called whenever mouse pressed in canvas.
Parameters
----------
event : Event
Vispy event
"""
if self._mode == Mode.PAN_ZOOM:
# If in pan/zoom mode do nothing
pass
elif self._mode == Mode.PICKER:
self.selected_label = self._... | def on_mouse_press(self, event):
"""Called whenever mouse pressed in canvas.
Parameters
----------
event : Event
Vispy event
"""
if self._mode == Mode.PAN_ZOOM:
# If in pan/zoom mode do nothing
pass
elif self._mode == Mode.PICKER:
self.selected_label = self._... | https://github.com/napari/napari/issues/857 | Traceback (most recent call last):
File "~/miniconda3/envs/napdev/lib/python3.7/site-packages/vispy/app/backends/_qt.py", line 447, in mousePressEvent
modifiers=self._modifiers(ev),
File "~/miniconda3/envs/napdev/lib/python3.7/site-packages/vispy/app/base.py", line 181, in _vispy_mouse_press
ev = self._vispy_canvas.eve... | TypeError |
def hold_to_lock_aspect_ratio(layer):
"""Hold to lock aspect ratio when resizing a shape."""
# on key press
layer._fixed_aspect = True
box = layer._selected_box
if box is not None:
size = box[Box.BOTTOM_RIGHT] - box[Box.TOP_LEFT]
if not np.any(size == np.zeros(2)):
layer.... | def hold_to_lock_aspect_ratio(layer):
"""Hold to lock aspect ratio when resizing a shape."""
# on key press
layer._fixed_aspect = True
box = layer._selected_box
if box is not None:
size = box[Box.BOTTOM_RIGHT] - box[Box.TOP_LEFT]
if not np.any(size == np.zeros(2)):
layer.... | https://github.com/napari/napari/issues/870 | Traceback (most recent call last):
File "napdev/lib/python3.7/site-packages/vispy/app/backends/_qt.py", line 502, in keyPressEvent
self._keyEvent(self._vispy_canvas.events.key_press, ev)
File "napdev/lib/python3.7/site-packages/vispy/app/backends/_qt.py", line 551, in _keyEvent
func(native=ev, key=key, text=text_type(e... | TypeError |
def show_at(self, position="top", *, width_ratio=0.9):
if not self.parent():
raise NotImplementedError("cannot show_at without parent")
main_window = self.parent().window()
xy = main_window.pos()
if position == "top":
width = main_window.width() * width_ratio
height = self.sizeHi... | def show_at(self, position="top", *, width_ratio=0.9):
if not self.parent():
raise NotImplementedError("cannot show_at without parent")
main_window = self.parent().window()
xy = main_window.pos()
if position == "top":
width = main_window.width() * width_ratio
height = self.sizeHi... | https://github.com/napari/napari/issues/865 | WARNING: Traceback (most recent call last):
File "c:\users\nico\anaconda3\lib\site-packages\napari\_qt\layers\qt_image_base_layer.py", line 78, in _clim_mousepress
self.clim_pop.show_at('top')
File "c:\users\nico\anaconda3\lib\site-packages\napari\_qt\qt_modal.py", line 72, in show_at
self.setGeometry(*xy.toTuple(), ma... | AttributeError |
def __init__(
self,
ndim,
*,
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending="translucent",
visible=True,
):
super().__init__()
self.metadata = metadata or {}
self._opacity = opacity
self._blending = Blending(blending)
self._visible ... | def __init__(
self,
ndim,
*,
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending="translucent",
visible=True,
):
super().__init__()
self.metadata = metadata or {}
self._opacity = opacity
self._blending = Blending(blending)
self._visible ... | https://github.com/napari/napari/issues/751 | Traceback (most recent call last):
File "test_array_spacing.py", line 9, in <module>
napari.view_image(camera, scale=np.array([1, 1]))
File "/home/jni/projects/napari/napari/view_layers.py", line 130, in view_image
path=path,
File "/home/jni/projects/napari/napari/components/viewer_model.py", line 512, in add_image
vis... | ValueError |
def __init__(self, qt_viewer, *, show=True):
self.qt_viewer = qt_viewer
self._qt_window = QMainWindow()
self._qt_window.setUnifiedTitleAndToolBarOnMac(True)
self._qt_center = QWidget()
self._qt_window.setCentralWidget(self._qt_center)
self._qt_window.setWindowTitle(self.qt_viewer.viewer.title)
... | def __init__(self, qt_viewer, *, show=True):
self.qt_viewer = qt_viewer
self._qt_window = QMainWindow()
self._qt_window.setUnifiedTitleAndToolBarOnMac(True)
self._qt_center = QWidget(self._qt_window)
self._qt_window.setCentralWidget(self._qt_center)
self._qt_window.setWindowTitle(self.qt_viewe... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def show(self):
"""Resize, show, and bring forward the window."""
self._qt_window.resize(self._qt_window.layout().sizeHint())
self._qt_window.show()
| def show(self):
"""Resize, show, and bring forward the window."""
self._qt_window.resize(self._qt_window.layout().sizeHint())
self._qt_window.show()
# make sure window is not hidden, e.g. by browser window in Jupyter
self._qt_window.raise_()
| https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def _update_palette(self, palette):
# set window styles which don't use the primary stylesheet
# FIXME: this is a problem with the stylesheet not using properties
self._status_bar.setStyleSheet(
template(
"QStatusBar { background: {{ background }}; color: {{ text }}; }",
**pa... | def _update_palette(self, palette):
# set window styles which don't use the primary stylesheet
# FIXME: this is a problem with the stylesheet not using properties
self._status_bar.setStyleSheet(
template(
"QStatusBar { background: {{ background }}; color: {{ text }}; }",
**pa... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def __init__(self, viewer):
super().__init__()
self.pool = QThreadPool()
QCoreApplication.setAttribute(Qt.AA_UseStyleSheetPropagationInWidgetStyles, True)
self.viewer = viewer
self.dims = QtDims(self.viewer.dims)
self.controls = QtControls(self.viewer)
self.layers = QtLayerList(self.viewe... | def __init__(self, viewer):
super().__init__()
self.pool = QThreadPool()
QCoreApplication.setAttribute(Qt.AA_UseStyleSheetPropagationInWidgetStyles, True)
self.viewer = viewer
self.dims = QtDims(self.viewer.dims)
self.controls = QtControls(self.viewer)
self.layers = QtLayerList(self.viewe... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def _update_camera(self):
if self.viewer.dims.ndisplay == 3:
# Set a 3D camera
if not isinstance(self.view.camera, ArcballCamera):
self.view.camera = ArcballCamera(name="ArcballCamera")
# flip y-axis to have correct alignment
# self.view.camera.flip = (0, 1, 0)
... | def _update_camera(self):
if self.viewer.dims.ndisplay == 3:
# Set a 3D camera
if not isinstance(self.view.camera, ArcballCamera):
self.view.camera = ArcballCamera(name="ArcballCamera", fov=0)
# flip y-axis to have correct alignment
# self.view.camera.flip = (0, 1... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def screenshot(self):
"""Take currently displayed screen and convert to an image array.
Returns
-------
image : array
Numpy array of type ubyte and shape (h, w, 4). Index [0, 0] is the
upper-left corner of the rendered region.
"""
img = self.canvas.native.grabFramebuffer()
b... | def screenshot(self):
"""Take currently displayed screen and convert to an image array.
Returns
-------
image : array
Numpy array of type ubyte and shape (h, w, 4). Index [0, 0] is the
upper-left corner of the rendered region.
"""
img = self.canvas.native.grabFramebuffer()
r... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def _open_images(self):
"""Add image files from the menubar."""
filenames, _ = QFileDialog.getOpenFileNames(
parent=self,
caption="Select image(s)...",
directory=self._last_visited_dir, # home dir by default
)
if filenames is not None:
self._add_files(filenames)
| def _open_images(self):
"""Add image files from the menubar."""
filenames, _ = QFileDialog.getOpenFileNames(
parent=self,
caption="Select image(s)...",
directory=self._last_visited_dir, # home dir by default
)
if (filenames != []) and (filenames is not None):
self._add_f... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def _open_folder(self):
"""Add a folder of files from the menubar."""
folder = QFileDialog.getExistingDirectory(
parent=self,
caption="Select folder...",
directory=self._last_visited_dir, # home dir by default
)
if folder is not None:
self._add_files([folder])
| def _open_folder(self):
"""Add a folder of files from the menubar."""
folder = QFileDialog.getExistingDirectory(
parent=self,
caption="Select folder...",
directory=self._last_visited_dir, # home dir by default
)
if folder not in {"", None}:
self._add_files([folder])
| https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def add_image(
self,
data=None,
*,
channel_axis=None,
rgb=None,
is_pyramid=None,
colormap=None,
contrast_limits=None,
gamma=1,
interpolation="nearest",
rendering="mip",
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending=None,
... | def add_image(
self,
data=None,
*,
channel_axis=None,
rgb=None,
is_pyramid=None,
colormap=None,
contrast_limits=None,
gamma=1,
interpolation="nearest",
rendering="mip",
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending=None,
... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def magic_imread(filenames, *, use_dask=None, stack=True):
"""Dispatch the appropriate reader given some files.
The files are assumed to all have the same shape.
Parameters
-------
filenames : list
List of filenames or directories to be opened
use_dask : bool
Whether to use das... | def magic_imread(filenames, *, use_dask=None, stack=True):
"""Dispatch the appropriate reader given some files.
The files are assumed to all have the same shape.
Parameters
-------
filenames : list
List of filenames or directories to be opened.
A list of `pathlib.Path` objects and ... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def is_pyramid(data):
"""If shape of arrays along first axis is strictly decreasing."""
size = np.array([np.prod(d.shape, dtype=np.uint64) for d in data])
if len(size) > 1:
return np.all(size[:-1] > size[1:])
else:
return False
| def is_pyramid(data):
"""If shape of arrays along first axis is strictly decreasing."""
size = np.array([np.prod(d.shape) for d in data])
if len(size) > 1:
return np.all(size[:-1] > size[1:])
else:
return False
| https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def calc_data_range(data):
"""Calculate range of data values. If all values are equal return [0, 1].
Parameters
-------
data : array
Data to calculate range of values over.
Returns
-------
values : list of float
Range of values.
"""
if np.prod(data.shape) > 1e6:
... | def calc_data_range(data):
"""Calculate range of data values. If all values are equal return [0, 1].
Parameters
-------
data : array
Data to calculate range of values over.
Returns
-------
values : list of float
Range of values.
Notes
-----
If the data type is ... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def view_image(
data=None,
*,
channel_axis=None,
rgb=None,
is_pyramid=None,
colormap=None,
contrast_limits=None,
gamma=1,
interpolation="nearest",
rendering="mip",
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending=None,
visible=... | def view_image(
data=None,
*,
channel_axis=None,
rgb=None,
is_pyramid=None,
colormap=None,
contrast_limits=None,
gamma=1,
interpolation="nearest",
rendering="mip",
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending=None,
visible=... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def __init__(self, title="napari", ndisplay=2, order=None, axis_labels=None):
# instance() returns the singleton instance if it exists, or None
app = QApplication.instance()
# if None, raise a RuntimeError with the appropriate message
if app is None:
message = (
"napari requires a Qt... | def __init__(self, title="napari", ndisplay=2, order=None, axis_labels=None):
# instance() returns the singleton instance if it exists, or None
app = QApplication.instance()
# if None, raise a RuntimeError with the appropriate message
if app is None:
message = (
"napari requires a Qt... | https://github.com/napari/napari/issues/691 | Traceback (most recent call last):
File "<ipython-input-48-ce4a0e063e17>", line 3, in <module>
napari.view_image(pyramid, is_pyramid=True)
File "C:\anaconda3\envs\nap\lib\site-packages\napari\view_layers.py", line 120, in view_image
path=path,
File "C:\anaconda3\envs\nap\lib\site-packages\napari\components\viewer_mo... | AttributeError |
def _open_images(self):
"""Add image files from the menubar."""
filenames, _ = QFileDialog.getOpenFileNames(
parent=self,
caption="Select image(s)...",
directory=self._last_visited_dir, # home dir by default
)
if (filenames != []) and (filenames is not None):
self._add_f... | def _open_images(self):
"""Add image files from the menubar."""
filenames, _ = QFileDialog.getOpenFileNames(
parent=self,
caption="Select image(s)...",
directory=self._last_visited_dir, # home dir by default
)
if filenames is not None:
self._add_files(filenames)
| https://github.com/napari/napari/issues/706 | WARNING: Traceback (most recent call last):
File "/home/jni/projects/napari/napari/_qt/qt_viewer.py", line 233, in _open_folder
self._add_files([folder])
File "/home/jni/projects/napari/napari/_qt/qt_viewer.py", line 247, in _add_files
self.viewer.add_image(path=filenames)
File "/home/jni/projects/napari/napari/compone... | ValueError |
def _open_folder(self):
"""Add a folder of files from the menubar."""
folder = QFileDialog.getExistingDirectory(
parent=self,
caption="Select folder...",
directory=self._last_visited_dir, # home dir by default
)
if folder not in {"", None}:
self._add_files([folder])
| def _open_folder(self):
"""Add a folder of files from the menubar."""
folder = QFileDialog.getExistingDirectory(
parent=self,
caption="Select folder...",
directory=self._last_visited_dir, # home dir by default
)
if folder is not None:
self._add_files([folder])
| https://github.com/napari/napari/issues/706 | WARNING: Traceback (most recent call last):
File "/home/jni/projects/napari/napari/_qt/qt_viewer.py", line 233, in _open_folder
self._add_files([folder])
File "/home/jni/projects/napari/napari/_qt/qt_viewer.py", line 247, in _add_files
self.viewer.add_image(path=filenames)
File "/home/jni/projects/napari/napari/compone... | ValueError |
def __init__(self, layer, node):
super().__init__()
self.layer = layer
self.node = node
self._position = (0,) * self.layer.dims.ndisplay
self.camera = None
self.layer.events.refresh.connect(lambda e: self.node.update())
self.layer.events.set_data.connect(lambda e: self._on_data_change())
... | def __init__(self, layer, node):
super().__init__()
self.layer = layer
self.node = node
self._position = (0,) * self.layer.ndim
self.camera = None
self.layer.events.refresh.connect(lambda e: self.node.update())
self.layer.events.set_data.connect(lambda e: self._on_data_change())
self.... | https://github.com/napari/napari/issues/678 | (1, 10, 2, 15, 256, 256, 1)
BTCZYX0
(1, 10, 2, 15, 256, 256)
Dim PosT : 1
Dim PosZ : 3
Dim PosC : 2
Scale Factors XYZ: [1, 1, 1, 3.516, 1, 1]
(1, 10, 15, 256, 256)
Adding Channel: AF555
(1, 10, 15, 256, 256)
Adding Channel: AF488
WARNING: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\imag... | TypeError |
def _update_thumbnail(self):
"""Update thumbnail with current image data and colormap."""
if self.dims.ndisplay == 3 and self.dims.ndim > 2:
image = np.max(self._data_thumbnail, axis=0)
else:
image = self._data_thumbnail
# float16 not supported by ndi.zoom
dtype = np.dtype(image.dty... | def _update_thumbnail(self):
"""Update thumbnail with current image data and colormap."""
if self.dims.ndisplay == 3 and self.dims.ndim > 2:
image = np.max(self._data_thumbnail, axis=0)
else:
image = self._data_thumbnail
# float16 not supported by ndi.zoom
dtype = np.dtype(image.dty... | https://github.com/napari/napari/issues/641 | WARNING: Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 121, in <lambda>
self.clicked.connect(lambda: self.viewer.dims._roll())
File "/usr/lib/python3.7/site-packages/napari/components/dims.py", line 340, in _roll
self.order = np.roll(self.order, 1)
File... | ValueError |
def __init__(
self,
data,
*,
rgb=None,
is_pyramid=None,
colormap="gray",
contrast_limits=None,
interpolation="nearest",
rendering="mip",
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending="translucent",
visible=True,
):
if isinst... | def __init__(
self,
data,
*,
rgb=None,
is_pyramid=None,
colormap="gray",
contrast_limits=None,
interpolation="nearest",
rendering="mip",
name=None,
metadata=None,
scale=None,
translate=None,
opacity=1,
blending="translucent",
visible=True,
):
ndim, rgb... | https://github.com/napari/napari/issues/563 | regions
<xarray.Regions 'array-baa123768d7ef2a6d2cdfa885e8f3eaa' (x_region: 31725, y_region: 51669)>
array([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
...,
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=int16)
Dimensions without coordinates: x_region, y... | ValueError |
def is_pyramid(data):
"""If shape of arrays along first axis is strictly decreasing."""
size = np.array([np.prod(d.shape) for d in data])
if len(size) > 1:
return np.all(size[:-1] > size[1:])
else:
return False
| def is_pyramid(data):
"""If data is a list of arrays of decreasing size."""
if isinstance(data, list):
size = [np.prod(d.shape) for d in data]
return np.all(size[:-1] > size[1:])
else:
return False
| https://github.com/napari/napari/issues/563 | regions
<xarray.Regions 'array-baa123768d7ef2a6d2cdfa885e8f3eaa' (x_region: 31725, y_region: 51669)>
array([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
...,
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=int16)
Dimensions without coordinates: x_region, y... | ValueError |
def get_pyramid_and_rgb(data, pyramid=None, rgb=None):
"""Check if data is or needs to be a pyramid and make one if needed.
Parameters
----------
data : array, list, or tuple
Data to be checked if pyramid or if needs to be turned into a pyramid.
pyramid : bool, optional
Value that c... | def get_pyramid_and_rgb(data, pyramid=None, rgb=None):
"""Check if data is or needs to be a pyramid and make one if needed.
Parameters
----------
data : array or list
Data to be checked if pyramid or if needs to be turned into a pyramid.
pyramid : bool, optional
Value that can force... | https://github.com/napari/napari/issues/563 | regions
<xarray.Regions 'array-baa123768d7ef2a6d2cdfa885e8f3eaa' (x_region: 31725, y_region: 51669)>
array([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
...,
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=int16)
Dimensions without coordinates: x_region, y... | ValueError |
def _set_view_slice(self):
"""Set the view given the indices to slice with."""
if self.multichannel:
# if multichannel need to keep the final axis fixed during the
# transpose. The index of the final axis depends on how many
# axes are displayed.
order = self.dims.displayed_order... | def _set_view_slice(self):
"""Set the view given the indices to slice with."""
if self.multichannel:
# if multichannel need to keep the final axis fixed during the
# transpose. The index of the final axis depends on how many
# axes are displayed.
order = self.dims.displayed_order... | https://github.com/napari/napari/issues/523 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-42-5ae500208e78> in <module>
----> 1 napari.view(array)
/Applications/anaconda3/envs/chloe/lib/python3.7/site-packages/napari/view_function.py in view(t... | ValueError |
def _set_view_slice(self):
"""Set the view given the indices to slice with."""
nd = self.dims.not_displayed
if self.multichannel:
# if multichannel need to keep the final axis fixed during the
# transpose. The index of the final axis depends on how many
# axes are displayed.
... | def _set_view_slice(self):
"""Set the view given the indices to slice with."""
nd = self.dims.not_displayed
if self.multichannel:
# if multichannel need to keep the final axis fixed during the
# transpose. The index of the final axis depends on how many
# axes are displayed.
... | https://github.com/napari/napari/issues/523 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-42-5ae500208e78> in <module>
----> 1 napari.view(array)
/Applications/anaconda3/envs/chloe/lib/python3.7/site-packages/napari/view_function.py in view(t... | ValueError |
def _on_data_change(self):
data = self.layer._data_view
dtype = np.dtype(data.dtype)
if dtype not in texture_dtypes:
try:
dtype = dict(i=np.int16, f=np.float32)[dtype.kind]
except KeyError: # not an int or float
raise TypeError(
f"type {dtype} not all... | def _on_data_change(self):
if self.layer.dims.ndisplay == 3:
self.node.set_data(
self.layer._data_view,
contrast_limits=self.layer.contrast_limits,
)
else:
self.node._need_colortransform_update = True
self.node.set_data(self.layer._data_view)
self.node... | https://github.com/napari/napari/issues/447 | WARNING: Traceback (most recent call last):
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 76, in <module>
demo(astronaut())
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 31, in demo
rescale_intensity(noisy, in_range='image', out_range=(0,... | ValueError |
def _on_contrast_limits_change(self):
if self.layer.dims.ndisplay == 3:
self._on_data_change()
else:
self.node.clim = self.layer.contrast_limits
| def _on_contrast_limits_change(self):
if self.layer.dims.ndisplay == 3:
self.node.set_data(
self.layer._data_view,
contrast_limits=self.layer.contrast_limits,
)
else:
self.node.clim = self.layer.contrast_limits
| https://github.com/napari/napari/issues/447 | WARNING: Traceback (most recent call last):
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 76, in <module>
demo(astronaut())
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 31, in demo
rescale_intensity(noisy, in_range='image', out_range=(0,... | ValueError |
def _on_data_change(self):
data = self.layer._data_view
dtype = np.dtype(data.dtype)
if dtype not in texture_dtypes:
try:
dtype = dict(i=np.int16, f=np.float64)[dtype.kind]
except KeyError: # not an int or float
raise TypeError(
f"type {dtype} not all... | def _on_data_change(self):
self.node._need_colortransform_update = True
self.node.set_data(self.layer._data_view)
self.node.update()
| https://github.com/napari/napari/issues/447 | WARNING: Traceback (most recent call last):
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 76, in <module>
demo(astronaut())
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 31, in demo
rescale_intensity(noisy, in_range='image', out_range=(0,... | ValueError |
def _update_thumbnail(self):
"""Update thumbnail with current image data and colormap."""
if self.dims.ndisplay == 3:
image = np.max(self._data_thumbnail, axis=0)
else:
image = self._data_thumbnail
# float16 not supported by ndi.zoom
dtype = np.dtype(image.dtype)
if dtype in [np... | def _update_thumbnail(self):
"""Update thumbnail with current image data and colormap."""
if self.dims.ndisplay == 3:
image = np.max(self._data_thumbnail, axis=0)
else:
image = self._data_thumbnail
zoom_factor = np.divide(self._thumbnail_shape[:2], image.shape[:2]).min()
if self.mult... | https://github.com/napari/napari/issues/447 | WARNING: Traceback (most recent call last):
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 76, in <module>
demo(astronaut())
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 31, in demo
rescale_intensity(noisy, in_range='image', out_range=(0,... | ValueError |
def view(
*images,
title="napari",
metadata=None,
multichannel=None,
contrast_limits=None,
**named_images,
):
"""View one or more input images.
Parameters
----------
*images : ndarray
Arrays to render as image layers.
title : string, optional
The title of the ... | def view(
*images,
title="napari",
metadata=None,
multichannel=None,
contrast_limits_range=None,
**named_images,
):
"""View one or more input images.
Parameters
----------
*images : ndarray
Arrays to render as image layers.
title : string, optional
The title ... | https://github.com/napari/napari/issues/447 | WARNING: Traceback (most recent call last):
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 76, in <module>
demo(astronaut())
File "/Users/royer/workspace/python/pitl/pitl/it/demo/demo_it_n2s_gbm_2D_rgb.py", line 31, in demo
rescale_intensity(noisy, in_range='image', out_range=(0,... | ValueError |
def on_key_press(self, event):
"""Called whenever key pressed in canvas."""
if event.native.isAutoRepeat():
return
else:
if event.key == " ":
if self._mode != Mode.PAN_ZOOM:
self._mode_history = self.mode
self._selected_data_history = copy(self.sel... | def on_key_press(self, event):
"""Called whenever key pressed in canvas."""
if event.native.isAutoRepeat():
return
else:
if event.key == " ":
if self._mode != Mode.PAN_ZOOM:
self._mode_history = self.mode
self._selected_data_history = copy(self.sel... | https://github.com/napari/napari/issues/417 | $ python examples/add_image.py
/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/visuals/markers.py:564: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
('a_edgewidth', np.float32, 1)])
/home/j... | TypeError |
def _remove(event):
"""When a layer is removed, remove its viewer."""
layers = event.source
layer = event.item
layer._order = 0
layer._node.transforms = ChainTransform()
layer._node.parent = None
| def _remove(event):
"""When a layer is removed, remove its viewer."""
layers = event.source
layer = event.item
layer._order = 0
layer._node.parent = None
| https://github.com/napari/napari/issues/170 | In [15]: WARNING: Traceback (most recent call last):
File "/Users/jni/conda/envs/36/bin/ipython", line 11, in <module>
sys.exit(start_ipython())
File "/Users/jni/conda/envs/36/lib/python3.6/site-packages/IPython/__init__.py", line 125, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/Users/jni/co... | IndexError |
def __init__(self, layers):
super().__init__()
self.layers = layers
self.setWidgetResizable(True)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scrollWidget = QWidget()
self.setWidget(scrollWidget)
self.vbox_layout = QVBoxLayout(scrollWidget)
self.vbox_layout.addWidget(QtDivi... | def __init__(self, layers):
super().__init__()
self.layers = layers
self.setWidgetResizable(True)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scrollWidget = QWidget()
self.setWidget(scrollWidget)
self.vbox_layout = QVBoxLayout(scrollWidget)
self.vbox_layout.addWidget(QtDivi... | https://github.com/napari/napari/issues/304 | WARNING: Traceback (most recent call last):
File "/Users/kiraevans/Projects/napari/napari/components/_layers_list/view/main.py", line 115, in mouseMoveEvent
distance = (event.pos() - self.drag_start_position).manhattanLength()
TypeError: unsupported operand type(s) for -: 'QPoint' and 'tuple' | TypeError |
def mousePressEvent(self, event):
# Check if mouse press happens on a layer properties widget or
# a child of such a widget. If not, the press has happended on the
# Layers Widget itself and should be ignored.
widget = self.childAt(event.pos())
layer = (
getattr(widget, "layer", None)
... | def mousePressEvent(self, event):
# Check if mouse press happens on a layer properties widget or
# a child of such a widget. If not, the press has happended on the
# Layers Widget itself and should be ignored.
widget = self.childAt(event.pos())
layer = (
getattr(widget, "layer", None)
... | https://github.com/napari/napari/issues/304 | WARNING: Traceback (most recent call last):
File "/Users/kiraevans/Projects/napari/napari/components/_layers_list/view/main.py", line 115, in mouseMoveEvent
distance = (event.pos() - self.drag_start_position).manhattanLength()
TypeError: unsupported operand type(s) for -: 'QPoint' and 'tuple' | TypeError |
def mouseMoveEvent(self, event):
position = np.array([event.pos().x(), event.pos().y()])
distance = np.linalg.norm(position - self.drag_start_position)
if distance < QApplication.startDragDistance() or self.drag_name is None:
return
mimeData = QMimeData()
mimeData.setText(self.drag_name)
... | def mouseMoveEvent(self, event):
distance = (event.pos() - self.drag_start_position).manhattanLength()
if distance < QApplication.startDragDistance():
return
mimeData = QMimeData()
mimeData.setText(self.drag_name)
drag = QDrag(self)
drag.setMimeData(mimeData)
drag.setHotSpot(event.po... | https://github.com/napari/napari/issues/304 | WARNING: Traceback (most recent call last):
File "/Users/kiraevans/Projects/napari/napari/components/_layers_list/view/main.py", line 115, in mouseMoveEvent
distance = (event.pos() - self.drag_start_position).manhattanLength()
TypeError: unsupported operand type(s) for -: 'QPoint' and 'tuple' | TypeError |
def dragEnterEvent(self, event):
if event.source() == self:
event.accept()
divs = []
for i in range(0, self.vbox_layout.count(), 2):
widget = self.vbox_layout.itemAt(i).widget()
divs.append(widget.y() + widget.frameGeometry().height() / 2)
self.centers = [(div... | def dragEnterEvent(self, event):
divs = []
for i in range(0, self.vbox_layout.count(), 2):
widget = self.vbox_layout.itemAt(i).widget()
divs.append(widget.y() + widget.frameGeometry().height() / 2)
self.centers = [(divs[i + 1] + divs[i]) / 2 for i in range(len(divs) - 1)]
event.accept()
| https://github.com/napari/napari/issues/304 | WARNING: Traceback (most recent call last):
File "/Users/kiraevans/Projects/napari/napari/components/_layers_list/view/main.py", line 115, in mouseMoveEvent
distance = (event.pos() - self.drag_start_position).manhattanLength()
TypeError: unsupported operand type(s) for -: 'QPoint' and 'tuple' | TypeError |
def clim(self, clim):
self._clim_msg = f"{float(clim[0]): 0.3}, {float(clim[1]): 0.3}"
self.status = self._clim_msg
self._node.clim = clim
self.events.clim()
| def clim(self, clim):
self._clim_msg = f"{clim[0]: 0.3}, {clim[1]: 0.3}"
self.status = self._clim_msg
self._node.clim = clim
self.events.clim()
| https://github.com/napari/napari/issues/154 | from napari import Window, Viewer
viewer = Viewer()
window = Window(viewer)
viewer.add_image(data.camera())
viewer.layers[0].clim = [0, 255]
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-4d36bc0c2... | ValueError |
def screenshot(self, region=None, size=None, bgcolor=None):
"""Render the scene to an offscreen buffer and return the image array.
Parameters
----------
region : tuple | None
Specifies the region of the canvas to render. Format is
(x, y, w, h). By default, the entire canvas is rendered.... | def screenshot(self, region=None, size=None, bgcolor=None, crop=None):
"""Render the scene to an offscreen buffer and return the image array.
Parameters
----------
region : tuple | None
Specifies the region of the canvas to render. Format is
(x, y, w, h). By default, the entire canvas i... | https://github.com/napari/napari/issues/159 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-1db5616997f4> in <module>()
----> 1 viewer.screenshot()
~/Github/napari/napari/components/_viewer/model.py in screenshot(self, region, size, bgcolor,... | TypeError |
def use_info_auxv():
lines = pwndbg.info.auxv().splitlines()
if not lines:
return None
auxv = AUXV()
for line in lines:
match = re.match("([0-9]+) .*? (0x[0-9a-f]+|[0-9]+)", line)
if not match:
print("Warning: Skipping auxv entry '{}'".format(line))
cont... | def use_info_auxv():
lines = pwndbg.info.auxv().splitlines()
if not lines:
return None
auxv = AUXV()
for line in lines:
match = re.match("([0-9]+) .* (0x[0-9a-f]+|[0-9]+)", line)
if not match:
print("Warning: Skipping auxv entry '{}'".format(line))
conti... | https://github.com/pwndbg/pwndbg/issues/858 | $ pwd
/home/user/test/x 01
$ cat test.c
#include <stdio.h>
#include <stdlib.h>
void main()
{
printf("Hello world\n");
getchar();
}
$ gcc -o test test.c
$ gdb test
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/license... | ValueError |
def malloc_chunk(addr, fake=False, verbose=False, simple=False):
"""Print a malloc_chunk struct's contents."""
# points to the real start of the chunk
cursor = int(addr)
allocator = pwndbg.heap.current
ptr_size = allocator.size_sz
size_field = pwndbg.memory.u(cursor + allocator.chunk_key_offse... | def malloc_chunk(addr, fake=False, verbose=False, simple=False):
"""Print a malloc_chunk struct's contents."""
# points to the real start of the chunk
cursor = int(addr)
allocator = pwndbg.heap.current
ptr_size = allocator.size_sz
size_field = pwndbg.memory.u(cursor + allocator.chunk_key_offse... | https://github.com/pwndbg/pwndbg/issues/781 | pwndbg> find_fake_fast &__malloc_hook
FAKE CHUNKS
Traceback (most recent call last):
File "/home/ubuntu/pwndbg/pwndbg/commands/__init__.py", line 136, in __call__
return self.function(*args, **kwargs)
File "/home/ubuntu/pwndbg/pwndbg/commands/__init__.py", line 227, in _OnlyWhenRunning
return function(*a, **kw)
Fil... | gdb.MemoryError |
def find_fake_fast(addr, size=None):
"""Find candidate fake fast chunks overlapping the specified address."""
psize = pwndbg.arch.ptrsize
allocator = pwndbg.heap.current
align = allocator.malloc_alignment
min_fast = allocator.min_chunk_size
max_fast = allocator.global_max_fast
max_fastbin = ... | def find_fake_fast(addr, size=None):
"""Find candidate fake fast chunks overlapping the specified address."""
psize = pwndbg.arch.ptrsize
allocator = pwndbg.heap.current
align = allocator.malloc_alignment
min_fast = allocator.min_chunk_size
max_fast = allocator.global_max_fast
max_fastbin = ... | https://github.com/pwndbg/pwndbg/issues/781 | pwndbg> find_fake_fast &__malloc_hook
FAKE CHUNKS
Traceback (most recent call last):
File "/home/ubuntu/pwndbg/pwndbg/commands/__init__.py", line 136, in __call__
return self.function(*args, **kwargs)
File "/home/ubuntu/pwndbg/pwndbg/commands/__init__.py", line 227, in _OnlyWhenRunning
return function(*a, **kw)
Fil... | gdb.MemoryError |
def get_arena(self, arena_addr=None):
"""Read a malloc_state struct from the specified address, default to
reading the current thread's arena. Return the main arena if the
current thread is not attached to an arena.
"""
if arena_addr is None:
if self.multithreaded:
arena_addr = p... | def get_arena(self, arena_addr=None):
"""Read a malloc_state struct from the specified address, default to
reading the current thread's arena. Return the main arena if the
current thread is not attached to an arena.
"""
if arena_addr is None:
if self.multithreaded:
arena_addr = p... | https://github.com/pwndbg/pwndbg/issues/781 | pwndbg> find_fake_fast &__malloc_hook
FAKE CHUNKS
Traceback (most recent call last):
File "/home/ubuntu/pwndbg/pwndbg/commands/__init__.py", line 136, in __call__
return self.function(*args, **kwargs)
File "/home/ubuntu/pwndbg/pwndbg/commands/__init__.py", line 227, in _OnlyWhenRunning
return function(*a, **kw)
Fil... | gdb.MemoryError |
def get_containing_segments(elf_filepath, elf_loadaddr, vaddr):
elf = get_elf_info_rebased(elf_filepath, elf_loadaddr)
segments = []
for seg in elf.segments:
# disregard segments which were unable to be named by pyelftools (see #777)
# and non-LOAD segments that are not file-backed (typicall... | def get_containing_segments(elf_filepath, elf_loadaddr, vaddr):
elf = get_elf_info_rebased(elf_filepath, elf_loadaddr)
segments = []
for seg in elf.segments:
# disregard non-LOAD segments that are not file-backed (typically STACK)
if "LOAD" not in seg["p_type"] and seg["p_filesz"] == 0:
... | https://github.com/pwndbg/pwndbg/issues/777 | pwndbg> set exception-verbose on
Set whether to print a full stacktracefor exceptions raised in Pwndbg commands to True
pwndbg> xinfo 0x7ffff7e33e10
Extended information for virtual address 0x7ffff7e33e10:
Containing mapping:
0x7ffff7df4000 0x7ffff7f6c000 r-xp 178000 25000 /usr/lib/x86_64-linux-gnu/libc-2.31.so... | TypeError |
def __getattr__(self, attr):
attr = attr.lstrip("$")
try:
# Seriously, gdb? Only accepts uint32.
if "eflags" in attr or "cpsr" in attr:
value = gdb77_get_register(attr)
value = value.cast(pwndbg.typeinfo.uint32)
else:
if attr.lower() == "xpsr":
... | def __getattr__(self, attr):
attr = attr.lstrip("$")
try:
# Seriously, gdb? Only accepts uint32.
if "eflags" in attr:
value = gdb77_get_register(attr)
value = value.cast(pwndbg.typeinfo.uint32)
else:
if attr.lower() == "xpsr":
attr = "x... | https://github.com/pwndbg/pwndbg/issues/660 | 0x0000005578b133a4 in memcmp@plt ()
'context': Print out the current register, instruction, and stack context.
Traceback (most recent call last):
File "/root/Pwn/Tools/pwndbg/pwndbg/commands/__init__.py", line 136, in __call__
return self.function(*args, **kwargs)
File "/root/Pwn/Tools/pwndbg/pwndbg/commands/__init__.p... | TypeError |
def get_raw_out():
local_path = pwndbg.file.get_file(pwndbg.proc.exe)
try:
version_output = subprocess.check_output(
[get_raw_out.cmd_path, "--version"], stderr=STDOUT
).decode("utf-8")
match = search("checksec v([\\w.]+),", version_output)
if match:
versi... | def get_raw_out():
local_path = pwndbg.file.get_file(pwndbg.proc.exe)
cmd = [get_raw_out.cmd_path, "--file", local_path]
return pwndbg.wrappers.call_cmd(cmd)
| https://github.com/pwndbg/pwndbg/issues/662 | pwndbg> checksec
Traceback (most recent call last):
File "/root/pwndbg/pwndbg/commands/__init__.py", line 109, in __call__
return self.function(*args, **kwargs)
File "/root/pwndbg/pwndbg/commands/__init__.py", line 189, in _OnlyWithFile
return function(*a, **kw)
File "/root/pwndbg/pwndbg/commands/checksec.py", line 16,... | subprocess.CalledProcessError |
def exe(self):
return gdb.current_progspace().filename
| def exe(self):
for obj in gdb.objfiles():
if obj.filename:
return obj.filename
break
if self.alive:
auxv = pwndbg.auxv.get()
return auxv["AT_EXECFN"]
| https://github.com/pwndbg/pwndbg/issues/623 | pwndbg> got
Traceback (most recent call last):
File "/home/mzr/sources/pwndbg/pwndbg/commands/__init__.py", line 135,
in __call__
return self.function(*args, **kwargs)
File "/home/mzr/sources/pwndbg/pwndbg/commands/__init__.py", line 226,
in _OnlyWhenRunning
return function(*a, **kw)
File "/home/mzr/sources/pwndbg/pwnd... | OSError |
def iter_phdrs(ehdr):
if not ehdr:
return
phnum, phentsize, phdr = get_phdrs(ehdr.address)
if not phdr:
return
first_phdr = phdr.address
PhdrType = phdr.type
for i in range(0, phnum):
p_phdr = int(first_phdr + (i * phentsize))
p_phdr = read(PhdrType, p_phdr)
... | def iter_phdrs(ehdr):
if not ehdr:
raise StopIteration
phnum, phentsize, phdr = get_phdrs(ehdr.address)
if not phdr:
raise StopIteration
first_phdr = phdr.address
PhdrType = phdr.type
for i in range(0, phnum):
p_phdr = int(first_phdr + (i * phentsize))
p_phdr ... | https://github.com/pwndbg/pwndbg/issues/570 | pwndbg> target remote localhost:1234
Remote debugging using localhost:1234
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x0000000000000000 in ?? ()
Traceback (most recent call last):
File "/usr/share/pwndbg/pwndbg/elf.py", lin... | RuntimeError |
def next(self, instruction, call=False):
"""
Architecture-specific hook point for enhance_next.
"""
if CS_GRP_CALL in instruction.groups:
if not call:
return None
elif CS_GRP_JUMP not in instruction.groups:
return None
# At this point, all operands have been resolve... | def next(self, instruction, call=False):
"""
Architecture-specific hook point for enhance_next.
"""
if CS_GRP_CALL in instruction.groups:
if not call:
return None
elif CS_GRP_JUMP not in instruction.groups:
return None
# At this point, all operands have been resolve... | https://github.com/pwndbg/pwndbg/issues/587 | Traceback (most recent call last):
File "/home/dc/pwndbg/pwndbg/commands/__init__.py", line 135, in __call__
return self.function(*args, **kwargs)
File "/home/dc/pwndbg/pwndbg/commands/__init__.py", line 226, in _OnlyWhenRunning
return function(*a, **kw)
File "/home/dc/pwndbg/pwndbg/commands/context.py", line 88, in co... | gdb.MemoryError |
def dump(self, instruction):
"""
Debug-only method.
"""
ins = instruction
rv = []
rv.append("%s %s" % (ins.mnemonic, ins.op_str))
for i, group in enumerate(ins.groups):
rv.append(" groups[%i] = %s" % (i, groups.get(group, group)))
rv.append(" next = %#x" % (ins.ne... | def dump(self, instruction):
ins = instruction
rv = []
rv.append("%s %s" % (ins.mnemonic, ins.op_str))
for i, group in enumerate(ins.groups):
rv.append(" groups[%i] = %s" % (i, groups.get(group, group)))
rv.append(" next = %#x" % (ins.next))
rv.append(" condition = %... | https://github.com/pwndbg/pwndbg/issues/587 | Traceback (most recent call last):
File "/home/dc/pwndbg/pwndbg/commands/__init__.py", line 135, in __call__
return self.function(*args, **kwargs)
File "/home/dc/pwndbg/pwndbg/commands/__init__.py", line 226, in _OnlyWhenRunning
return function(*a, **kw)
File "/home/dc/pwndbg/pwndbg/commands/context.py", line 88, in co... | gdb.MemoryError |
def get_set_string(self):
value = self.raw_value
# For string value, convert utf8 byte string to unicode.
if isinstance(value, six.binary_type):
value = codecs.decode(value, "utf-8")
# Remove surrounded ' and " characters
if isinstance(value, six.string_types):
# The first characte... | def get_set_string(self):
value = self.raw_value
# For string value, convert utf8 byte string to unicode.
if isinstance(value, six.binary_type):
value = codecs.decode(value, "utf-8")
# Remove surrounded ' and " characters
if isinstance(value, six.string_types):
# The first characte... | https://github.com/pwndbg/pwndbg/issues/440 | [!] Ida Pro xmlrpc error
Traceback (most recent call last):
File "/mnt/d/Uni/SS18/exploits/pwndbg/pwndbg/pwndbg/ida.py", line 64, in init_ida_rpc_client
_ida.here()
File "/usr/lib/python3.4/xmlrpc/client.py", line 1098, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.4/xmlrpc/client.py", line 1... | InterruptedError |
def init_ida_rpc_client():
global _ida, _ida_last_exception, _ida_last_connection_check
if not ida_enabled:
return
now = time.time()
if _ida is None and (now - _ida_last_connection_check) < int(ida_timeout) + 5:
return
addr = "http://{host}:{port}".format(host=ida_rpc_host, port=i... | def init_ida_rpc_client():
global _ida, _ida_last_exception
addr = "http://{host}:{port}".format(host=ida_rpc_host, port=ida_rpc_port)
_ida = xmlrpclib.ServerProxy(addr)
socket.setdefaulttimeout(3)
exception = None # (type, value, traceback)
try:
_ida.here()
print(
... | https://github.com/pwndbg/pwndbg/issues/440 | [!] Ida Pro xmlrpc error
Traceback (most recent call last):
File "/mnt/d/Uni/SS18/exploits/pwndbg/pwndbg/pwndbg/ida.py", line 64, in init_ida_rpc_client
_ida.here()
File "/usr/lib/python3.4/xmlrpc/client.py", line 1098, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.4/xmlrpc/client.py", line 1... | InterruptedError |
def __call__(self, *args, **kwargs):
if _ida is None:
init_ida_rpc_client()
if _ida is not None:
return self.fn(*args, **kwargs)
return None
| def __call__(self, *args, **kwargs):
if not ida_enabled:
return None
if _ida is None:
init_ida_rpc_client()
if _ida is not None:
return self.fn(*args, **kwargs)
return None
| https://github.com/pwndbg/pwndbg/issues/440 | [!] Ida Pro xmlrpc error
Traceback (most recent call last):
File "/mnt/d/Uni/SS18/exploits/pwndbg/pwndbg/pwndbg/ida.py", line 64, in init_ida_rpc_client
_ida.here()
File "/usr/lib/python3.4/xmlrpc/client.py", line 1098, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.4/xmlrpc/client.py", line 1... | InterruptedError |
def prompt_hook(*a):
global cur
pwndbg.decorators.first_prompt = True
new = (gdb.selected_inferior(), gdb.selected_thread())
if cur != new:
pwndbg.events.after_reload(start=False)
cur = new
if pwndbg.proc.alive and pwndbg.proc.thread_is_stopped:
prompt_hook_on_stop(*a)
| def prompt_hook(*a):
global cur
new = (gdb.selected_inferior(), gdb.selected_thread())
if cur != new:
pwndbg.events.after_reload(start=False)
cur = new
if pwndbg.proc.alive and pwndbg.proc.thread_is_stopped:
prompt_hook_on_stop(*a)
| https://github.com/pwndbg/pwndbg/issues/440 | [!] Ida Pro xmlrpc error
Traceback (most recent call last):
File "/mnt/d/Uni/SS18/exploits/pwndbg/pwndbg/pwndbg/ida.py", line 64, in init_ida_rpc_client
_ida.here()
File "/usr/lib/python3.4/xmlrpc/client.py", line 1098, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.4/xmlrpc/client.py", line 1... | InterruptedError |
def entry(*a):
"""
Set a breakpoint at the first instruction executed in
the target binary.
"""
global break_on_first_instruction
break_on_first_instruction = True
run = "run " + " ".join(map(shlex.quote, a))
gdb.execute(run, from_tty=False)
| def entry(*a):
"""
Set a breakpoint at the first instruction executed in
the target binary.
"""
global break_on_first_instruction
break_on_first_instruction = True
run = "run " + " ".join(a)
gdb.execute(run, from_tty=False)
| https://github.com/pwndbg/pwndbg/issues/362 | [dc@dc:pwndbg|dev *$%]$ gdb python
Loaded 113 commands. Type pwndbg [filter] for a list.
Reading symbols from python...(no debugging symbols found)...done.
pwndbg> set exception-verbose on
Set whether to print a full stacktracefor exceptions raised in Pwndbg commands to True
pwndbg> run -c "print(1); print(2)"
Starting... | gdb.error |
def dt(name="", addr=None, obj=None):
"""
Dump out a structure type Windbg style.
"""
# Return value is a list of strings.of
# We concatenate at the end.
rv = []
if obj and not name:
t = obj.type
while t.code == (gdb.TYPE_CODE_PTR):
t = t.target()
obj... | def dt(name="", addr=None, obj=None):
"""
Dump out a structure type Windbg style.
"""
# Return value is a list of strings.of
# We concatenate at the end.
rv = []
if obj and not name:
t = obj.type
while t.code == (gdb.TYPE_CODE_PTR):
t = t.target()
obj... | https://github.com/pwndbg/pwndbg/issues/362 | [dc@dc:pwndbg|dev *$%]$ gdb python
Loaded 113 commands. Type pwndbg [filter] for a list.
Reading symbols from python...(no debugging symbols found)...done.
pwndbg> set exception-verbose on
Set whether to print a full stacktracefor exceptions raised in Pwndbg commands to True
pwndbg> run -c "print(1); print(2)"
Starting... | gdb.error |
def search(type, hex, string, executable, writable, value, mapping, save, next):
# Adjust pointer sizes to the local architecture
if type == "pointer":
type = {4: "dword", 8: "qword"}[pwndbg.arch.ptrsize]
if save is None:
save = bool(pwndbg.config.auto_save_search)
if hex:
valu... | def search(type, hex, string, executable, writable, value, mapping, save, next):
# Adjust pointer sizes to the local architecture
if type == "pointer":
type = {4: "dword", 8: "qword"}[pwndbg.arch.ptrsize]
if save is None:
save = bool(pwndbg.config.auto_save_search)
if hex:
valu... | https://github.com/pwndbg/pwndbg/issues/123 | pwndbg> search -4 0xf7eebf83
Traceback (most recent call last):
File "/home/bruce30262/pwndbg/pwndbg/commands/__init__.py", line 57, in __call__
return self.function(*args, **kwargs)
File "/home/bruce30262/pwndbg/pwndbg/commands/__init__.py", line 162, in _ArgparsedCommand
return function(**vars(args))
File "/home/bruc... | struct.error |
def _same_modules(source_module, target_module):
"""Compare the filenames associated with the given modules names.
This tries to not actually load the modules.
"""
if not (source_module or target_module):
return False
if target_module == source_module:
return True
def _get_fil... | def _same_modules(source_module, target_module):
"""Compare the filenames associated with the given modules names.
This tries to not actually load the modules.
"""
if not (source_module or target_module):
return False
if target_module == source_module:
return True
def _get_fil... | https://github.com/hylang/hy/issues/1911 | $ python
Python 3.7.5 (default, Jun 8 2020, 17:36:22)
[Clang 11.0.3 (clang-1103.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import hy
hy.eval(hy.read_str("(require [hy.contrib.walk [let]])"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/U... | AttributeError |
def _get_filename(module):
filename = None
try:
if not inspect.ismodule(module):
loader = pkgutil.get_loader(module)
if isinstance(loader, importlib.machinery.SourceFileLoader):
filename = loader.get_filename()
else:
filename = inspect.getfile(... | def _get_filename(module):
filename = None
try:
if not inspect.ismodule(module):
loader = pkgutil.get_loader(module)
if loader:
filename = loader.get_filename()
else:
filename = inspect.getfile(module)
except (TypeError, ImportError):
... | https://github.com/hylang/hy/issues/1911 | $ python
Python 3.7.5 (default, Jun 8 2020, 17:36:22)
[Clang 11.0.3 (clang-1103.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import hy
hy.eval(hy.read_str("(require [hy.contrib.walk [let]])"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/U... | AttributeError |
def run_command(source, filename=None):
__main__ = importlib.import_module("__main__")
require("hy.cmdline", __main__, assignments="ALL")
try:
tree = hy_parse(source, filename=filename)
except HyLanguageError:
hy_exc_handler(*sys.exc_info())
return 1
with filtered_hy_excepti... | def run_command(source, filename=None):
__main__ = importlib.import_module("__main__")
require("hy.cmdline", __main__, assignments="ALL")
try:
tree = hy_parse(source, filename=filename)
except HyLanguageError:
hy_exc_handler(*sys.exc_info())
return 1
with filtered_hy_excepti... | https://github.com/hylang/hy/issues/1879 | $ CODE='(import math) (print (lfor j [1] (math.sqrt 5)))'
$ hy -c "$CODE"
Traceback (most recent call last):
File "/usr/local/bin/hy", line 8, in <module>
sys.exit(hy_main())
File "<string>", line 1, in <module>
File "<string>", line 1, in <listcomp>
NameError: name 'math' is not defined
$ echo "$CODE" | hy
hy 0.18.0 u... | NameError |
def macroexpand(tree, module, compiler=None, once=False):
"""Expand the toplevel macros for the given Hy AST tree.
Load the macros from the given `module`, then expand the (top-level) macros
in `tree` until we no longer can.
`HyExpression` resulting from macro expansions are assigned the module in
... | def macroexpand(tree, module, compiler=None, once=False):
"""Expand the toplevel macros for the given Hy AST tree.
Load the macros from the given `module`, then expand the (top-level) macros
in `tree` until we no longer can.
`HyExpression` resulting from macro expansions are assigned the module in
... | https://github.com/hylang/hy/issues/1885 | felix@alienware:~$ hy --version
hy 0.18.0
felix@alienware:~$ echo "()" > foo.hy && hy foo.hy
Traceback (most recent call last):
File "/home/felix/.pyenv/versions/3.8.0/bin/hy", line 8, in <module>
sys.exit(hy_main())
File "/home/felix/.pyenv/versions/3.8.0/lib/python3.8/runpy.py", line 261, in run_path
code, fn... | hy.errors.HyCompileError |
def _format_string(self, string, rest, allow_recursion=True):
values = []
ret = Result()
while True:
# Look for the next replacement field, and get the
# plain text before it.
match = re.search(r"\{\{?|\}\}?", rest)
if match:
literal_chars = rest[: match.start()]... | def _format_string(self, string, rest, allow_recursion=True):
values = []
ret = Result()
while True:
# Look for the next replacement field, and get the
# plain text before it.
match = re.search(r"\{\{?|\}\}?", rest)
if match:
literal_chars = rest[: match.start()]... | https://github.com/hylang/hy/issues/1802 | (hylearn) # hy2py minor.hy
Traceback (most recent call last):
File "/home/diego/hylearn/bin/hy2py", line 12, in <module>
sys.exit(hy2py_main())
File "/home/diego/hylearn/lib/python3.7/site-packages/hy/cmdline.py", line 690, in hy2py_main
print(astor.code_gen.to_source(_ast))
File "/home/diego/hylearn/lib/python3.7/site... | AttributeError |
def __init__(self, spy=False, output_fn=None, locals=None, filename="<stdin>"):
# Create a proper module for this REPL so that we can obtain it easily
# (e.g. using `importlib.import_module`).
# We let `InteractiveConsole` initialize `self.locals` when it's
# `None`.
super(HyREPL, self).__init__(loc... | def __init__(self, spy=False, output_fn=None, locals=None, filename="<input>"):
super(HyREPL, self).__init__(locals=locals, filename=filename)
# Create a proper module for this REPL so that we can obtain it easily
# (e.g. using `importlib.import_module`).
# Also, make sure it's properly introduced to `... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def ast_callback(self, exec_ast, eval_ast):
if self.spy:
try:
# Mush the two AST chunks into a single module for
# conversion into Python.
new_ast = ast.Module(exec_ast.body + [ast.Expr(eval_ast.body)])
print(astor.to_source(new_ast))
except Exception:... | def ast_callback(self, main_ast, expr_ast):
if self.spy:
# Mush the two AST chunks into a single module for
# conversion into Python.
new_ast = ast.Module(main_ast.body + [ast.Expr(expr_ast.body)])
print(astor.to_source(new_ast))
| https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def runsource(self, source, filename="<stdin>", symbol="exec"):
try:
res = super(HyREPL, self).runsource(source, filename, symbol)
except (HyMacroExpansionError, HyRequireError):
# We need to handle these exceptions ourselves, because the base
# method only handles `OverflowError`, `Synt... | def runsource(self, source, filename="<input>", symbol="single"):
try:
do = hy_parse(source, filename=filename)
except PrematureEndOfInput:
return True
except HySyntaxError as e:
self.showsyntaxerror(filename=filename)
return False
try:
# Our compiler doesn't cor... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def run_command(source, filename=None):
__main__ = importlib.import_module("__main__")
require("hy.cmdline", __main__, assignments="ALL")
try:
tree = hy_parse(source, filename=filename)
except HyLanguageError:
hy_exc_handler(*sys.exc_info())
return 1
with filtered_hy_excepti... | def run_command(source, filename=None):
tree = hy_parse(source, filename=filename)
__main__ = importlib.import_module("__main__")
require("hy.cmdline", __main__, assignments="ALL")
with filtered_hy_exceptions():
hy_eval(tree, None, __main__, filename=filename, source=source)
return 0
| https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def run_icommand(source, **kwargs):
if os.path.exists(source):
# Emulate Python cmdline behavior by setting `sys.path` relative
# to the executed file's location.
if sys.path[0] == "":
sys.path[0] = os.path.realpath(os.path.split(source)[0])
else:
sys.path.ins... | def run_icommand(source, **kwargs):
if os.path.exists(source):
# Emulate Python cmdline behavior by setting `sys.path` relative
# to the executed file's location.
if sys.path[0] == "":
sys.path[0] = os.path.realpath(os.path.split(source)[0])
else:
sys.path.ins... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def cmdline_handler(scriptname, argv):
parser = argparse.ArgumentParser(
prog="hy",
usage=USAGE,
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=EPILOG,
)
parser.add_argument("-c", dest="command", help="program passed in as a string")
parser.add_argument("-m"... | def cmdline_handler(scriptname, argv):
parser = argparse.ArgumentParser(
prog="hy",
usage=USAGE,
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=EPILOG,
)
parser.add_argument("-c", dest="command", help="program passed in as a string")
parser.add_argument("-m"... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def hy2py_main():
import platform
options = dict(
prog="hy2py",
usage="%(prog)s [options] [FILE]",
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser = argparse.ArgumentParser(**options)
parser.add_argument(
"FILE",
type=str,
nargs="?",
... | def hy2py_main():
import platform
options = dict(
prog="hy2py",
usage="%(prog)s [options] [FILE]",
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser = argparse.ArgumentParser(**options)
parser.add_argument(
"FILE",
type=str,
nargs="?",
... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def __call__(self, source, filename="<input>", symbol="single"):
try:
hy_ast = hy_parse(source, filename=filename)
root_ast = ast.Interactive if symbol == "single" else ast.Module
# Our compiler doesn't correspond to a real, fixed source file, so
# we need to [re]set these.
... | def __call__(self, code=None):
try:
sys.stdin.close()
except:
pass
raise SystemExit(code)
| https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def compile(self, tree):
if tree is None:
return Result()
try:
ret = self.compile_atom(tree)
self.update_imports(ret)
return ret
except HyCompileError:
# compile calls compile, so we're going to have multiple raise
# nested; so let's re-raise this exception, l... | def compile(self, tree):
if tree is None:
return Result()
try:
ret = self.compile_atom(tree)
self.update_imports(ret)
return ret
except HyCompileError:
# compile calls compile, so we're going to have multiple raise
# nested; so let's re-raise this exception, l... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def _syntax_error(self, expr, message):
return HySyntaxError(message, expr, self.filename, self.source)
| def _syntax_error(self, expr, message):
return HyTypeError(message, self.filename, expr, self.source)
| https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def __init__(
self, message, expression=None, filename=None, source=None, lineno=1, colno=1
):
"""
Parameters
----------
message: str
The message to display for this error.
expression: HyObject, optional
The Hy expression generating this error.
filename: str, optional
... | def __init__(self, message, *args):
super(HyLanguageError, self).__init__(message, *args)
| https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def hy_exc_handler(exc_type, exc_value, exc_traceback):
"""A `sys.excepthook` handler that uses `hy_exc_filter` to
remove internal Hy frames from a traceback print-out.
"""
if os.environ.get("HY_DEBUG", False):
return sys.__excepthook__(exc_type, exc_value, exc_traceback)
try:
outpu... | def hy_exc_handler(exc_type, exc_value, exc_traceback):
"""Produce exceptions print-outs with all frames originating from the
modules in `_tb_hidden_modules` filtered out.
The frames are actually filtered by each module's filename and only when a
subclass of `HyLanguageError` is emitted.
This does... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def __init__(
self, message, expression=None, filename=None, source=None, lineno=1, colno=1
):
"""
Parameters
----------
message: str
The message to display for this error.
expression: HyObject, optional
The Hy expression generating this error.
filename: str, optional
... | def __init__(self, message, filename=None, lineno=-1, colno=-1, source=None):
"""
Parameters
----------
message: str
The exception's message.
filename: str, optional
The filename for the source code generating this error.
lineno: int, optional
The line number of the error... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def __str__(self):
"""Provide an exception message that includes SyntaxError-like source
line information when available.
"""
global _hy_colored_errors
# Syntax errors are special and annotate the traceback (instead of what
# we would do in the message that follows the traceback).
if isinst... | def __str__(self):
global _hy_colored_errors
output = traceback.format_exception_only(SyntaxError, SyntaxError(*self.args))
if _hy_colored_errors:
from hy.errors import colored
output[-1] = colored.yellow(output[-1])
if len(self.source) > 0:
output[-2] = colored.green(... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def hy_parse(source, filename="<string>"):
"""Parse a Hy source string.
Parameters
----------
source: string
Source code to parse.
filename: string, optional
File name corresponding to source. Defaults to "<string>".
Returns
-------
out : HyExpression
"""
_sou... | def hy_parse(source, filename="<string>"):
"""Parse a Hy source string.
Parameters
----------
source: string
Source code to parse.
filename: string, optional
File name corresponding to source. Defaults to "<string>".
Returns
-------
out : HyExpression
"""
_sou... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def tokenize(source, filename=None):
"""Tokenize a Lisp file or string buffer into internal Hy objects.
Parameters
----------
source: str
The source to tokenize.
filename: str, optional
The filename corresponding to `source`.
"""
from hy.lex.lexer import lexer
from hy.le... | def tokenize(source, filename=None):
"""Tokenize a Lisp file or string buffer into internal Hy objects.
Parameters
----------
source: str
The source to tokenize.
filename: str, optional
The filename corresponding to `source`.
"""
from hy.lex.lexer import lexer
from hy.le... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.