Skip to content

Commit

Permalink
Colons after method signatures in method stubs removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
salt-die committed Feb 16, 2024
1 parent 43e8bda commit d787332
Show file tree
Hide file tree
Showing 53 changed files with 1,301 additions and 1,289 deletions.
10 changes: 5 additions & 5 deletions batgrl/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ class App(ABC):
Methods
-------
on_start():
on_start()
Coroutine scheduled when app is run.
run():
run()
Run the app.
exit():
exit()
Exit the app.
add_gadget(gadget):
add_gadget(gadget)
Alias for :attr:`root.add_gadget`.
add_gadgets(\*gadgets):
add_gadgets(\*gadgets)
Alias for :attr:`root.add_gadgets`.
"""

Expand Down
64 changes: 34 additions & 30 deletions batgrl/colors/color_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class Color(NamedTuple):
Methods
-------
from_hex(hexcode):
from_hex(hexcode)
Create a :class:`Color` from a hex code.
count(value):
count(value)
Return number of occurrences of value.
index(value, start=0, stop=9223372036854775807):
index(value, start=0, stop=9223372036854775807)
Return first index of value.
"""

Expand Down Expand Up @@ -103,11 +103,11 @@ class AColor(NamedTuple):
Methods
-------
from_hex(hexcode):
from_hex(hexcode)
Create an :class:`AColor` from a hex code.
count(value):
count(value)
Return number of occurrences of value.
index(value, start=0, stop=9223372036854775807):
index(value, start=0, stop=9223372036854775807)
Return first index of value.
"""

Expand Down Expand Up @@ -149,35 +149,37 @@ class ColorPair(TypedDict):
Methods
-------
clear():
clear()
Remove all items from the dictionary.
copy():
copy()
Return a shallow copy of the dictionary.
fromkeys(iterable, value):
fromkeys(iterable, value=None)
Create a new dictionary with keys from iterable and values set to value.
get(key, default):
get(key, default=None)
Return the value for key if key is in the dictionary, else default. If default
is not given, it defaults to None, so that this method never raises a KeyError.
items():
items()
Return a new view of the dictionary’s items ((key, value) pairs). See the
documentation of view objects.
keys():
keys()
Return a new view of the dictionary’s keys. See the documentation of view
objects.
pop(key, default):
pop(...)
If key is in the dictionary, remove it and return its value, else return
default. If default is not given and key is not in the dictionary, a KeyError is
raised.
popitem():
popitem()
Remove and return a (key, value) pair from the dictionary. Pairs are returned in
LIFO order.
setdefault(key, default):
LIFO order. popitem() is useful to destructively iterate over a dictionary, as
often used in set algorithms. If the dictionary is empty, calling popitem()
raises a KeyError.
setdefault(key, default=None)
If key is in the dictionary, return its value. If not, insert key with a value
of default and return default. default defaults to None.
update(other):
update(...)
Update the dictionary with the key/value pairs from other, overwriting existing
keys. Return None.
values():
values()
Return a new view of the dictionary’s values. See the documentation of view
objects.
"""
Expand All @@ -192,35 +194,37 @@ class ColorTheme(TypedDict, total=False):
Methods
-------
clear():
clear()
Remove all items from the dictionary.
copy():
copy()
Return a shallow copy of the dictionary.
fromkeys(iterable, value):
fromkeys(iterable, value=None)
Create a new dictionary with keys from iterable and values set to value.
get(key, default):
get(key, default=None)
Return the value for key if key is in the dictionary, else default. If default
is not given, it defaults to None, so that this method never raises a KeyError.
items():
items()
Return a new view of the dictionary’s items ((key, value) pairs). See the
documentation of view objects.
keys():
keys()
Return a new view of the dictionary’s keys. See the documentation of view
objects.
pop(key, default):
pop(...)
If key is in the dictionary, remove it and return its value, else return
default. If default is not given and key is not in the dictionary, a KeyError is
raised.
popitem():
popitem()
Remove and return a (key, value) pair from the dictionary. Pairs are returned in
LIFO order.
setdefault(key, default):
LIFO order. popitem() is useful to destructively iterate over a dictionary, as
often used in set algorithms. If the dictionary is empty, calling popitem()
raises a KeyError.
setdefault(key, default=None)
If key is in the dictionary, return its value. If not, insert key with a value
of default and return default. default defaults to None.
update(other):
update(...)
Update the dictionary with the key/value pairs from other, overwriting existing
keys. Return None.
values():
values()
Return a new view of the dictionary’s values. See the documentation of view
objects.
"""
Expand Down
6 changes: 3 additions & 3 deletions batgrl/figfont.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ class FIGFont:
Methods
-------
from_path(path):
from_path(path)
Load a FIGFont from a path.
render_array(text):
render_array(text)
Render text as ascii art into a 2D "<U1" numpy array.
render_str(text):
render_str(text)
Render text as ascii art into a multiline string.
"""

Expand Down
56 changes: 28 additions & 28 deletions batgrl/gadgets/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,61 +149,61 @@ class Animation(Gadget):
Methods
-------
play():
play()
Play the animation. Returns a task.
pause():
pause()
Pause the animation
stop():
stop()
Stop the animation and reset current frame.
from_textures(textures, ...):
from_textures(textures, ...)
Create an :class:`Animation` from an iterable of uint8 RGBA numpy array.
from_images(images, ...):
from_images(images, ...)
Create an :class:`Animation` from an iterable of :class:`Image`.
on_size():
on_size()
Update gadget after a resize.
apply_hints():
apply_hints()
Apply size and pos hints.
to_local(point):
to_local(point)
Convert point in absolute coordinates to local coordinates.
collides_point(point):
collides_point(point)
Return true if point collides with visible portion of gadget.
collides_gadget(other):
collides_gadget(other)
Return true if other is within gadget's bounding box.
add_gadget(gadget):
add_gadget(gadget)
Add a child gadget.
add_gadgets(\*gadgets):
add_gadgets(\*gadgets)
Add multiple child gadgets.
remove_gadget(gadget):
remove_gadget(gadget)
Remove a child gadget.
pull_to_front():
pull_to_front()
Move to end of gadget stack so gadget is drawn last.
walk_from_root():
walk_from_root()
Yield all descendents of the root gadget (preorder traversal).
walk():
walk()
Yield all descendents of this gadget (preorder traversal).
walk_reverse():
walk_reverse()
Yield all descendents of this gadget (reverse postorder traversal).
ancestors():
ancestors()
Yield all ancestors of this gadget.
subscribe(source, attr, action):
subscribe(source, attr, action)
Subscribe to a gadget property.
unsubscribe(source, attr):
unsubscribe(source, attr)
Unsubscribe to a gadget property.
on_key(key_event):
on_key(key_event)
Handle key press event.
on_mouse(mouse_event):
on_mouse(mouse_event)
Handle mouse event.
on_paste(paste_event):
on_paste(paste_event)
Handle paste event.
tween(...):
tween(...)
Sequentially update gadget properties over time.
on_add():
on_add()
Apply size hints and call children's `on_add`.
on_remove():
on_remove()
Call children's `on_remove`.
prolicide():
prolicide()
Recursively remove all children.
destroy():
destroy()
Remove this gadget and recursively remove all its children.
"""

Expand Down
48 changes: 24 additions & 24 deletions batgrl/gadgets/bar_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,53 +163,53 @@ class BarChart(Gadget):
Methods
-------
build_chart():
build_chart()
Build bar chart and set canvas and color arrays.
on_size():
on_size()
Update gadget after a resize.
apply_hints():
apply_hints()
Apply size and pos hints.
to_local(point):
to_local(point)
Convert point in absolute coordinates to local coordinates.
collides_point(point):
collides_point(point)
Return true if point collides with visible portion of gadget.
collides_gadget(other):
collides_gadget(other)
Return true if other is within gadget's bounding box.
add_gadget(gadget):
add_gadget(gadget)
Add a child gadget.
add_gadgets(\*gadgets):
add_gadgets(\*gadgets)
Add multiple child gadgets.
remove_gadget(gadget):
remove_gadget(gadget)
Remove a child gadget.
pull_to_front():
pull_to_front()
Move to end of gadget stack so gadget is drawn last.
walk_from_root():
walk_from_root()
Yield all descendents of the root gadget (preorder traversal).
walk():
walk()
Yield all descendents of this gadget (preorder traversal).
walk_reverse():
walk_reverse()
Yield all descendents of this gadget (reverse postorder traversal).
ancestors():
ancestors()
Yield all ancestors of this gadget.
subscribe(source, attr, action):
subscribe(source, attr, action)
Subscribe to a gadget property.
unsubscribe(source, attr):
unsubscribe(source, attr)
Unsubscribe to a gadget property.
on_key(key_event):
on_key(key_event)
Handle key press event.
on_mouse(mouse_event):
on_mouse(mouse_event)
Handle mouse event.
on_paste(paste_event):
on_paste(paste_event)
Handle paste event.
tween(...):
tween(...)
Sequentially update gadget properties over time.
on_add():
on_add()
Apply size hints and call children's `on_add`.
on_remove():
on_remove()
Call children's `on_remove`.
prolicide():
prolicide()
Recursively remove all children.
destroy():
destroy()
Remove this gadget and recursively remove all its children.
"""

Expand Down
8 changes: 4 additions & 4 deletions batgrl/gadgets/behaviors/button_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class ButtonBehavior:
Methods
-------
update_normal():
update_normal()
Paint the normal state.
update_hover():
update_hover()
Paint the hover state.
update_down():
update_down()
Paint the down state.
on_release():
on_release()
Triggered when a button is released.
"""

Expand Down
12 changes: 6 additions & 6 deletions batgrl/gadgets/behaviors/focusable.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ class Focusable:
Methods
-------
focus():
focus()
Focus gadget.
blur():
blur()
Un-focus gadget.
focus_next():
focus_next()
Focus next focusable gadget.
focus_previous():
focus_previous()
Focus previous focusable gadget.
on_focus():
on_focus()
Update gadget when it gains focus.
on_blur():
on_blur()
Update gadget when it loses focus.
"""

Expand Down
6 changes: 3 additions & 3 deletions batgrl/gadgets/behaviors/grabbable.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class Grabbable:
Methods
-------
grab(mouse_event):
grab(mouse_event)
Grab the gadget.
ungrab(mouse_event):
ungrab(mouse_event)
Ungrab the gadget.
grab_update(mouse_event):
grab_update(mouse_event)
Update gadget with incoming mouse events while grabbed.
"""

Expand Down
Loading

0 comments on commit d787332

Please sign in to comment.