Skip to content

Commit

Permalink
"True if ..." idiom replaced with "Whether ..." in method stubs.
Browse files Browse the repository at this point in the history
  • Loading branch information
salt-die committed Aug 15, 2024
1 parent 1e43c1f commit 7a05b3d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/advanced/sandbox/sandbox/particles.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class MovingElement(Element):
"""Base for moving elements."""

def _move(self, dy, dx):
"""Try to move vertically by dy and horizontally by dx. True if successful."""
"""Try to move particle by dy, dx and return true if successful."""
world = self.world
h, w = world.shape
y, x = self.pos
Expand Down
4 changes: 2 additions & 2 deletions src/batgrl/gadgets/behaviors/grabbable.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Grabbable:
mouse_button : MouseButton
Mouse button used for grabbing.
is_grabbed : bool
True if gadget is grabbed.
Whether gadget is grabbed.
Methods
-------
Expand Down Expand Up @@ -84,7 +84,7 @@ def on_mouse(self, mouse_event):

@property
def is_grabbed(self) -> bool:
"""True if gadget is grabbed."""
"""Whether gadget is grabbed."""
return self._is_grabbed

def grab(self, mouse_event: MouseEvent):
Expand Down
2 changes: 1 addition & 1 deletion src/batgrl/gadgets/behaviors/movable.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Movable(Grabbable):
mouse_button : MouseButton
Mouse button used for grabbing.
is_grabbed : bool
True if gadget is grabbed.
Whether gadget is grabbed.
Methods
-------
Expand Down
2 changes: 1 addition & 1 deletion src/batgrl/gadgets/behaviors/movable_children.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MovableChildren(Grabbable):
mouse_button : MouseButton
Mouse button used for grabbing.
is_grabbed : bool
True if gadget is grabbed.
Whether gadget is grabbed.
Methods
-------
Expand Down
2 changes: 1 addition & 1 deletion src/batgrl/gadgets/scroll_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class ScrollView(Themable, Grabbable, Gadget):
mouse_button : MouseButton
Mouse button used for grabbing.
is_grabbed : bool
True if gadget is grabbed.
Whether gadget is grabbed.
alpha : float
Transparency of gadget.
size : Size
Expand Down
4 changes: 2 additions & 2 deletions src/batgrl/gadgets/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Slider(Grabbable, Pane):
fill_color: Color
Color of filled portion of slider.
slider_enabled : bool
True if slider value can be changed.
Whether slider value can be changed.
proportion : float
Current proportion of slider.
is_grabbable : bool
Expand All @@ -99,7 +99,7 @@ class Slider(Grabbable, Pane):
alpha : float
Transparency of gadget.
is_grabbed : bool
True if gadget is grabbed.
Whether gadget is grabbed.
size : Size
Size of gadget.
height : int
Expand Down
8 changes: 4 additions & 4 deletions src/batgrl/gadgets/split_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class HSplitLayout(Gadget):
handle_color : AColor
Color of the resize handle.
split_resizable : bool
True if split is resizable with a grabbable handle.
Whether split is resizable with a grabbable handle.
anchor_top_pane : bool
If true, :attr:`split_row` is calculated from the top.
split_row : int
Expand Down Expand Up @@ -283,7 +283,7 @@ def split_row(self, split_row: int):

@property
def split_resizable(self) -> bool:
"""True if split is resizable with a grabbable handle."""
"""Whether split is resizable with a grabbable handle."""
return self.handle.is_grabbable

@split_resizable.setter
Expand Down Expand Up @@ -349,7 +349,7 @@ class VSplitLayout(Gadget):
handle_color : AColor
Color of the resize handle.
split_resizable : bool
True if split is resizable with a grabbable handle.
Whether split is resizable with a grabbable handle.
anchor_left_pane : bool
If true, :attr:`split_col` is calculated from the left.
split_col : int
Expand Down Expand Up @@ -541,7 +541,7 @@ def split_col(self, split_col: int):

@property
def split_resizable(self) -> bool:
"""True if split is resizable with a grabbable handle."""
"""Whether split is resizable with a grabbable handle."""
return self.handle.is_grabbable

@split_resizable.setter
Expand Down
2 changes: 1 addition & 1 deletion src/batgrl/gadgets/textbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Textbox(Themable, Focusable, Grabbable, Gadget):
mouse_button : MouseButton
Mouse button used for grabbing.
is_grabbed : bool
True if gadget is grabbed.
Whether gadget is grabbed.
size : Size
Size of gadget.
height : int
Expand Down
2 changes: 1 addition & 1 deletion src/batgrl/gadgets/tree_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TreeViewNode(Themable, ButtonBehavior, Text):
Parameters
----------
is_leaf : bool, default: True
True if node is a leaf node.
Whether node is a leaf node.
always_release : bool, default: False
Whether a mouse up event outside the button will trigger it.
default_cell : NDArray[Cell] | str, default: " "
Expand Down

0 comments on commit 7a05b3d

Please sign in to comment.