tidying and docs work

This commit is contained in:
Eric 2023-06-14 09:32:28 -07:00
parent ca8ff7e15f
commit 969ebff191
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
17 changed files with 69 additions and 81 deletions

32
.efrocachemap generated
View File

@ -4080,18 +4080,18 @@
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/c2/9f/f2026401080cc1b6cc726d3fe7e7",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/36/94/85c6acdc646a34981637db86bfca",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3a/e4/751410a3dcb6f6a5acb87fbd1114",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/56/aa/a4c1463d75fbd19bbee21ea6c31d",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/10/3b/472d3ebb85cadda98a07d43722fa",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/b5/41/40580afdf9c45ecd4d151192c687",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/f4/2a/cad79bd02bb880f53bba0d52f3ee",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/74/d4/a190f068b5b770f031807d69cf89",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/11/40/23786a5169b22cd4726c4bb05087",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/07/85/920b7d847417d6ffd7164d1e944a",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/20/3f/e0eeabf110e4be9d72f61c5686d0",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/cc/d9/c5ed5d11dee05c527bf3bba20e92",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/c6/d5/c83dec884c6952ef889bbdc59264",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/cf/a6/c371331130a76f5427df5b30cb52",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/9c/5d/dcbdea22e8a328b0803de111d512",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/ec/5f/552d10de9b7db8ea3d0a1ed044d3",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/fb/1e/d1b0ecaf8f24b4b510c14f9a499a",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/10/52/1f1d4083299664d67b75a461525b",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/d4/48/8d1c651d5a17cb216f1ab58fc35f",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/18/3b/4ca835c1da7398a34cde8d4ea814",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/52/17/1a6977062c2fbc7b175f9cb0d534",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/e3/45/9c0be4afb42d196879b0297bf64e",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/83/07/6b13c2a9ce41136b23f11c46c932",
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/3c/a8/5487ece199be8717cead6de157e3",
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/9d/71/77a0ae15f3216c51da44ccefeb87",
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/8c/de/a04c75afaee10276fedbd6dc12dd",
@ -4108,14 +4108,14 @@
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/e1/d8/0949e33c04570cae7dafaf906770",
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/91/c5/f1c4dcdd2233d6ffc280db77ec99",
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/20/e5/3b83e186b63a95d704c69a6b5b76",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/fa/57/d5854a0f548c1be91ccc003980cc",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/30/b6/85cbd37ddb822b8acc9c3a66547d",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/83/7c/6934c5c911aad7dde7a896011729",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/c2/85/2e8285d17dbb9d90942c8e440950",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/76/eb/11133d31ffa6270bf039c2e4a84f",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/6c/85/74ea0817ca86c89615954cc4a64f",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/d3/ba/f72af1ac302bff2d0fd86dba2482",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/cf/0d/288264828076049f9ba3262ab474",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/35/0a/00527a3cc06b70fb1079e67b79af",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/e0/49/9651d4a97b7728f68835c19d9dd4",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/4d/36/135d5ca8bff29c468e589171e86e",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/c6/2b/2eda939d90b755913b1ef8a19b16",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/bb/87/761ca99f5686a464f3f0b3e0dbe1",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/85/dc/f7f9ca5e1cff8bb5297263872f33",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/04/6b/7da4c1d5b9ce4a6d999eddb280f9",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/ac/86/eb1f0fd61d8182bb52ac37a83328",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/ea/6a/6a4721b144e5e297b542d2a0eea2",

View File

@ -153,7 +153,6 @@
"ba_data/python/bascenev1/__pycache__/_stats.cpython-311.opt-1.pyc",
"ba_data/python/bascenev1/__pycache__/_team.cpython-311.opt-1.pyc",
"ba_data/python/bascenev1/__pycache__/_teamgame.cpython-311.opt-1.pyc",
"ba_data/python/bascenev1/__pycache__/internal.cpython-311.opt-1.pyc",
"ba_data/python/bascenev1/_activity.py",
"ba_data/python/bascenev1/_activitytypes.py",
"ba_data/python/bascenev1/_actor.py",
@ -188,7 +187,6 @@
"ba_data/python/bascenev1/_stats.py",
"ba_data/python/bascenev1/_team.py",
"ba_data/python/bascenev1/_teamgame.py",
"ba_data/python/bascenev1/internal.py",
"ba_data/python/bascenev1lib/__init__.py",
"ba_data/python/bascenev1lib/__pycache__/__init__.cpython-311.opt-1.pyc",
"ba_data/python/bascenev1lib/__pycache__/gameutils.cpython-311.opt-1.pyc",

View File

@ -230,7 +230,6 @@ SCRIPT_TARGETS_PY_PUBLIC = \
$(BUILD_DIR)/ba_data/python/bascenev1/_stats.py \
$(BUILD_DIR)/ba_data/python/bascenev1/_team.py \
$(BUILD_DIR)/ba_data/python/bascenev1/_teamgame.py \
$(BUILD_DIR)/ba_data/python/bascenev1/internal.py \
$(BUILD_DIR)/ba_data/python/bascenev1lib/__init__.py \
$(BUILD_DIR)/ba_data/python/bascenev1lib/activity/__init__.py \
$(BUILD_DIR)/ba_data/python/bascenev1lib/activity/coopjoin.py \
@ -501,7 +500,6 @@ SCRIPT_TARGETS_PYC_PUBLIC = \
$(BUILD_DIR)/ba_data/python/bascenev1/__pycache__/_stats.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bascenev1/__pycache__/_team.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bascenev1/__pycache__/_teamgame.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bascenev1/__pycache__/internal.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bascenev1lib/__pycache__/__init__.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bascenev1lib/activity/__pycache__/__init__.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bascenev1lib/activity/__pycache__/coopjoin.cpython-311.opt-1.pyc \

View File

@ -167,7 +167,13 @@ from bascenev1._gameutils import (
)
from bascenev1._level import Level
from bascenev1._lobby import Lobby, Chooser
from bascenev1._map import Map, register_map, get_map_display_string
from bascenev1._map import (
get_filtered_map_name,
get_map_class,
get_map_display_string,
Map,
register_map,
)
from bascenev1._messages import (
CelebrateMessage,
DeathType,
@ -181,20 +187,31 @@ from bascenev1._messages import (
PickedUpMessage,
PickUpMessage,
PlayerDiedMessage,
PlayerProfilesChangedMessage,
ShouldShatterMessage,
StandMessage,
ThawMessage,
UNHANDLED,
)
from bascenev1._multiteamsession import MultiTeamSession
from bascenev1._multiteamsession import (
MultiTeamSession,
DEFAULT_TEAM_COLORS,
DEFAULT_TEAM_NAMES,
)
from bascenev1._music import MusicType, setmusic
from bascenev1._nodeactor import NodeActor
from bascenev1._powerup import get_default_powerup_distribution
from bascenev1._profile import (
get_player_colors,
get_player_profile_icon,
get_player_profile_colors,
)
from bascenev1._player import PlayerInfo, Player, EmptyPlayer, StandLocation
from bascenev1._playlist import (
get_default_free_for_all_playlist,
get_default_teams_playlist,
filter_playlist,
)
from bascenev1._powerup import PowerupMessage, PowerupAcceptMessage
from bascenev1._score import ScoreType, ScoreConfig
from bascenev1._settings import (
@ -252,6 +269,8 @@ __all__ = [
'CoopSession',
'Data',
'DeathType',
'DEFAULT_TEAM_COLORS',
'DEFAULT_TEAM_NAMES',
'Dependency',
'DependencyComponent',
'DependencySet',
@ -271,6 +290,7 @@ __all__ = [
'end_host_scanning',
'existing',
'fade_screen',
'filter_playlist',
'FloatChoiceSetting',
'FloatSetting',
'FreeForAllSession',
@ -280,12 +300,17 @@ __all__ = [
'GameTip',
'get_chat_messages',
'get_connection_to_host_info',
'get_default_free_for_all_playlist',
'get_default_teams_playlist',
'get_default_powerup_distribution',
'get_filtered_map_name',
'get_foreground_host_activity',
'get_foreground_host_session',
'get_game_port',
'get_game_roster',
'get_game_roster',
'get_local_active_input_devices_count',
'get_map_class',
'get_map_display_string',
'get_player_colors',
'get_player_profile_colors',
@ -346,6 +371,7 @@ __all__ = [
'PickUpMessage',
'Player',
'PlayerDiedMessage',
'PlayerProfilesChangedMessage',
'PlayerInfo',
'PlayerRecord',
'PlayerScoredMessage',

View File

@ -1,41 +0,0 @@
# Released under the MIT License. See LICENSE for details.
#
"""Exposed functionality not intended for full public use.
Classes and functions contained here, while technically 'public', may change
or disappear without warning, so should be avoided (or used sparingly and
defensively).
"""
from __future__ import annotations
from bascenev1._gameutils import get_trophy_string
from bascenev1._map import (
get_map_class,
register_map,
get_map_display_string,
get_filtered_map_name,
)
from bascenev1._messages import PlayerProfilesChangedMessage
from bascenev1._multiteamsession import DEFAULT_TEAM_COLORS, DEFAULT_TEAM_NAMES
from bascenev1._powerup import get_default_powerup_distribution
from bascenev1._playlist import (
get_default_free_for_all_playlist,
get_default_teams_playlist,
filter_playlist,
)
__all__ = [
'get_trophy_string',
'get_map_class',
'register_map',
'get_map_display_string',
'get_filtered_map_name',
'PlayerProfilesChangedMessage',
'DEFAULT_TEAM_COLORS',
'DEFAULT_TEAM_NAMES',
'get_default_powerup_distribution',
'get_default_free_for_all_playlist',
'get_default_teams_playlist',
'filter_playlist',
]

View File

@ -86,7 +86,7 @@ class PowerupBoxFactory:
You shouldn't need to do this; call Powerup.get_factory()
to get a shared instance.
"""
from bascenev1.internal import get_default_powerup_distribution
from bascenev1 import get_default_powerup_distribution
shared = SharedObjects.get()
self._lastpoweruptype: str | None = None

View File

@ -169,7 +169,7 @@ class PrivateGatherTab(GatherTab):
# pylint: disable=too-many-branches
# pylint: disable=too-many-locals
from bauiv1lib.playlist import PlaylistTypeVars
from bascenev1.internal import filter_playlist
from bascenev1 import filter_playlist
hcfg = PrivateHostingConfig()
cfg = bui.app.config

View File

@ -18,7 +18,7 @@ class PlaylistTypeVars:
"""Defines values for a playlist type (config names to use, etc)."""
def __init__(self, sessiontype: type[bs.Session]):
from bascenev1.internal import (
from bascenev1 import (
get_default_teams_playlist,
get_default_free_for_all_playlist,
)

View File

@ -329,8 +329,7 @@ class PlaylistBrowserWindow(bui.Window):
# pylint: disable=too-many-locals
# pylint: disable=too-many-nested-blocks
from efro.util import asserttype
from bascenev1.internal import get_map_class
from bascenev1.internal import filter_playlist
from bascenev1 import get_map_class, filter_playlist
if not self._root_widget:
return

View File

@ -25,7 +25,7 @@ class PlaylistEditController:
playlist: list[dict[str, Any]] | None = None,
playlist_name: str | None = None,
):
from bascenev1.internal import filter_playlist
from bascenev1 import filter_playlist
from bauiv1lib.playlist import PlaylistTypeVars
from bauiv1lib.playlist.edit import PlaylistEditWindow

View File

@ -32,7 +32,7 @@ class PlaylistEditGameWindow(bui.Window):
# pylint: disable=too-many-branches
# pylint: disable=too-many-statements
# pylint: disable=too-many-locals
from bascenev1.internal import (
from bascenev1 import (
get_filtered_map_name,
get_map_class,
get_map_display_string,

View File

@ -27,7 +27,7 @@ class PlaylistMapSelectWindow(bui.Window):
completion_call: Callable[[dict[str, Any] | None], Any],
transition: str = 'in_right',
):
from bascenev1.internal import get_filtered_map_name
from bascenev1 import get_filtered_map_name
self._gametype = gametype
self._sessiontype = sessiontype
@ -119,7 +119,7 @@ class PlaylistMapSelectWindow(bui.Window):
# pylint: disable=too-many-statements
# pylint: disable=too-many-branches
# pylint: disable=too-many-locals
from bascenev1.internal import (
from bascenev1 import (
get_map_class,
get_map_display_string,
)

View File

@ -7,10 +7,11 @@ from __future__ import annotations
import logging
from typing import TYPE_CHECKING
from bauiv1lib.popup import PopupWindow
import bascenev1 as bs
import bauiv1 as bui
from bauiv1lib.popup import PopupWindow
if TYPE_CHECKING:
from typing import Any
@ -29,7 +30,7 @@ class PlayOptionsWindow(PopupWindow):
# pylint: disable=too-many-branches
# pylint: disable=too-many-statements
# pylint: disable=too-many-locals
from bascenev1.internal import filter_playlist, get_map_class
from bascenev1 import filter_playlist, get_map_class
from bauiv1lib.playlist import PlaylistTypeVars
self._r = 'gameListWindow'

View File

@ -343,7 +343,7 @@ class ProfileBrowserWindow(bui.Window):
def _refresh(self) -> None:
# pylint: disable=too-many-locals
from efro.util import asserttype
from bascenev1.internal import PlayerProfilesChangedMessage
from bascenev1 import PlayerProfilesChangedMessage
assert bui.app.classic is not None

View File

@ -18,7 +18,7 @@ class TeamNamesColorsWindow(PopupWindow):
"""A popup window for customizing team names and colors."""
def __init__(self, scale_origin: tuple[float, float]):
from bascenev1.internal import DEFAULT_TEAM_COLORS, DEFAULT_TEAM_NAMES
from bascenev1 import DEFAULT_TEAM_COLORS, DEFAULT_TEAM_NAMES
self._width = 500
self._height = 330
@ -147,7 +147,7 @@ class TeamNamesColorsWindow(PopupWindow):
self._update()
def _reset(self) -> None:
from bascenev1.internal import DEFAULT_TEAM_NAMES, DEFAULT_TEAM_COLORS
from bascenev1 import DEFAULT_TEAM_NAMES, DEFAULT_TEAM_COLORS
for i in range(2):
self._colors[i] = DEFAULT_TEAM_COLORS[i]
@ -167,7 +167,7 @@ class TeamNamesColorsWindow(PopupWindow):
)
def _ok(self) -> None:
from bascenev1.internal import DEFAULT_TEAM_COLORS, DEFAULT_TEAM_NAMES
from bascenev1 import DEFAULT_TEAM_COLORS, DEFAULT_TEAM_NAMES
cfg = bui.app.config

View File

@ -136,7 +136,7 @@ class TrophiesWindow(popup.PopupWindow):
sub_width: int,
trophy_types: list[list[str]],
) -> int:
from bascenev1.internal import get_trophy_string
from bascenev1 import get_trophy_string
total_pts = 0
for i, trophy_type in enumerate(trophy_types):

View File

@ -180,13 +180,20 @@ def _run_pdoc() -> None:
starttime = time.monotonic()
# Tell pdoc to go through all the modules in ba_data/python.
modulenames = sorted(
modulenames = [
n.removesuffix('.py')
for n in os.listdir('src/assets/ba_data/python')
if not n.startswith('.')
)
]
assert modulenames
# Also add in a few common ones from tools.
for mname in ['efro', 'bacommon']:
assert mname not in modulenames
modulenames.append(mname)
modulenames.sort() # Just in case it matters.
templatesdir = Path('src/assets/pdoc/templates')
assert templatesdir.is_dir()