Skip to content

Commit

Permalink
remove pause (#1993)
Browse files Browse the repository at this point in the history
* remove pause

This is super unnecessary and nothing uses it (now). Even before this PR, it was used once. So, I'm counting this as "weird cruft that should be cut in 3.0." If it's a teaching concern, I recommend to teach them to use `time.sleep()`.

* remove pause from __all__

* remove pause from __init__

* remove pause from __init__ 2

* remove unused imports
  • Loading branch information
DigiDuncan committed Feb 25, 2024
1 parent ca53375 commit 282f618
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
2 changes: 0 additions & 2 deletions arcade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def configure_logging(level: Optional[int] = None):
from .window_commands import finish_render
from .window_commands import get_display_size
from .window_commands import get_window
from .window_commands import pause
from .window_commands import schedule
from .window_commands import run
from .window_commands import set_background_color
Expand Down Expand Up @@ -352,7 +351,6 @@ def configure_logging(level: Optional[int] = None):
'make_soft_circle_texture',
'make_soft_square_texture',
'open_window',
'pause',
'print_timings',
'play_sound',
'read_tmx',
Expand Down
17 changes: 0 additions & 17 deletions arcade/window_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
from __future__ import annotations

import gc
import time
import os

import pyglet

from typing import (
Callable,
Optional,
cast,
Tuple,
TYPE_CHECKING
)
Expand All @@ -28,7 +26,6 @@

__all__ = [
"get_display_size",
"pause",
"get_window",
"set_window",
"set_viewport",
Expand Down Expand Up @@ -58,20 +55,6 @@ def get_display_size(screen_id: int = 0) -> Tuple[int, int]:
return screen.width, screen.height


def pause(seconds: float) -> None:
"""
Pause for the specified number of seconds. This is a convenience function that just calls time.sleep().
.. Warning::
This is mostly used for unit tests and is not likely to be
a good solution for pausing an application or game.
:param seconds: Time interval to pause in seconds.
"""
time.sleep(cast(float, seconds))


def get_window() -> "Window":
"""
Return a handle to the current window.
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/window/test_window.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import time

import arcade
import pyglet
Expand Down Expand Up @@ -53,6 +54,6 @@ def f():
pass

arcade.schedule(f, 1/60)
arcade.pause(0.01)
time.sleep(0.01)
arcade.unschedule(f)
window.test()

0 comments on commit 282f618

Please sign in to comment.