diff --git a/.efrocachemap b/.efrocachemap index 1d08f5c9..297b9b2e 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -420,7 +420,7 @@ "assets/build/ba_data/audio/zoeOw.ogg": "https://files.ballistica.net/cache/ba1/51/eb/0a567253cc08c94c5d315a64d9af", "assets/build/ba_data/audio/zoePickup01.ogg": "https://files.ballistica.net/cache/ba1/bc/8f/a9c51a09c418136e386b7fdf21c7", "assets/build/ba_data/audio/zoeScream01.ogg": "https://files.ballistica.net/cache/ba1/02/e5/84916e123f47ccf11ddda380d699", - "assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/a7/67/0179e7eae3d1c7a4a9df6049229d", + "assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/9c/1a/009abe989d70291b56753f83de7b", "assets/build/ba_data/data/languages/arabic.json": "https://files.ballistica.net/cache/ba1/ca/75/3de74bd6e498113b99bbf9eda645", "assets/build/ba_data/data/languages/belarussian.json": "https://files.ballistica.net/cache/ba1/55/8c/8d0a0585e434b94865ae4befc090", "assets/build/ba_data/data/languages/chinese.json": "https://files.ballistica.net/cache/ba1/f6/21/951b7ff02b0ad14b1f0ac55763c4", @@ -3971,50 +3971,50 @@ "assets/src/ba_data/python/ba/_generated/__init__.py": "https://files.ballistica.net/cache/ba1/ee/e8/cad05aa531c7faf7ff7b96db7f6e", "assets/src/ba_data/python/ba/_generated/enums.py": "https://files.ballistica.net/cache/ba1/b2/e5/0ee0561e16257a32830645239f34", "ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a", - "build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/c6/ec/4a5ae56bc104b67f5947e1116941", + "build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/a4/23/4b754faff34d9d48a71da46c37f6", "build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/74/1d/fc9e33e565475daaac80da5252f0", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/7f/33/05fdff46eaeef33a14fefe3fda47", - "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/94/d9/694b66a227996a6f4f3d327fc04f", - "build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/c0/03/71007fb271765f59e1f6da338ee3", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9b/24/84f417c05955d774c31025600cc2", + "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/69/2e/78b04116b9a5e0eeabb441a9707c", + "build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/8b/bb/486b68926dc17aec434a79166d4b", "build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/9c/7b/ac1a200be0f37078af0991faca3b", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3a/e7/d46a2e18de4065fcb7ad93c390ee", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/2e/fe/50afc5694cfc4a9a61b5f7dbf34f", - "build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/ed/d9/cac56715e2a962a1bc31c4aab8e2", - "build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/12/4c/1ec2cc28e433127a738b09292bc2", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/84/4e/11bf104575097a3ffaeff32cd117", - "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/d2/cd/0a663ac709ffc1d586db166846ca", - "build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/70/3d/ab729c4d64a89bcdf9e027762151", - "build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/ce/db/c14c70155a8b0dac5b9d18b63e2d", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/2e/9c/caab75ae18baeab56e5eae396936", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/42/25/87063e7bf8559de0cb5572de6508", - "build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/15/58/52f7fbaa5210d2ab5afd01eb3bc7", - "build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/0e/7d/30dc7459479700a2e50d44201471", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/d1/ed/0988a7e61de0e09875e0f18a76cc", - "build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/f3/5e/1a53dc3eef98694fed7a341058c7", - "build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/db/b3/f606248668c48ec4c3088ba5b8b5", - "build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/77/20/f9e6b32d95d24e87ae5b73b016cf", - "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/18/d2/bfc47ac110285a0c2f48babcff03", - "build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1b/25/46721d6d1a6286df32b5c999a7d1", - "build/prefab/lib/linux_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b8/e4/ddbf15a2ec9fa0a3edff2d0e897a", - "build/prefab/lib/linux_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/69/a3/b56d339f4dc95b5333c97e423d8c", - "build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/bf/53/63ceb27c4f2eea9fc4e8455f8f30", - "build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a0/fc/0e6981872542df974cc69e10949d", - "build/prefab/lib/mac_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e6/19/7a72afb6912b37b395330cba9eab", - "build/prefab/lib/mac_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/db/75/d3de1742c3404572b4e85820b7d2", - "build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d0/5d/8449c26ddb6a8558eba2c5d7ce6d", - "build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/86/98/4d4a0d9a52e34e07061e31d038fd", - "build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9a/37/e528806cecf86c20acac74127499", - "build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/29/16/1d9549c835276428a038f1692e22", - "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/86/b7/e47605a45acbad6f6f5a44b3266e", - "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/09/56/af875f3eaacd2056b8768c6fa53c", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/67/a2/829f2962de6305612c07124a9297", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/3d/d5/2bc1f16d9ef459ada00afc343a81", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/d8/84/7c17af707c4700ab75026311d21a", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/fe/06/6921fe2c065426a82f912732b1ad", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/6d/ef/4192a89cace9e99ce87d2d118e01", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/b2/a4/d9de56f34bc35d044d673986e678", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/6b/07/26c48232c8aeaf9ca6bdd0d54e60", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/49/3a/3fddd087687893bb595ea2155e91", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/39/5f/d58c5760ae57284d3d8f981d70dd", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c4/42/11ee47b79299021ba19695793636", + "build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/c9/e0/190024d4371954e5af7c588aa17d", + "build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/22/20/94bd911fe574b6ce831aa0f62478", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f8/f4/ac3127a98b11bf7ce5e7acdcf552", + "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cf/b2/e70ec7a47ed9bbbda951c01e06df", + "build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/f7/0a/adc60ccd753241e03039e98aa734", + "build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/47/74/93b23d43435b16bad3bde1ca0e88", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/09/36/64e7c1425316335f0fa2cb7b692a", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cc/36/27b1c5c714850a3ea2cfa83ee35e", + "build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/84/0a/6712d37d94dcf811e828a63b488f", + "build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/59/01/04af869d8334397bf7368791e9f6", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/12/ae/725259070ca6fbc65075d3aa6198", + "build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/c9/70/b2dd8c22a7a2c1ecf264797e68a4", + "build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/21/91/eb4b0119f4980c19c8fdc636e493", + "build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6f/4b/34dcc5f14c2547f4c16cda7b05c1", + "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/5a/38/91689a90fad69186191b3d55dd70", + "build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/fe/aa/c85f26afd6babc5f1ef9636dcfbd", + "build/prefab/lib/linux_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/94/0a/5fdf30ef59684a9036138f4c97d5", + "build/prefab/lib/linux_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/ea/fc/263f0339e7e8815648d93ad41143", + "build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9e/d2/58b0ab135403ffa2bf3e04693ecd", + "build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/15/98/518a364e457218a9a55c7d726da3", + "build/prefab/lib/mac_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/2d/26/8011786095c9cc80f98c16251d35", + "build/prefab/lib/mac_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4b/0e/219f6246e32037888ce8011ab13f", + "build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/ae/cd/3370a511d9ff8a2aa4c5536f6a5a", + "build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/87/84/38cfc99bf6730abd39a247aa340e", + "build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/67/15/f85722b517a5782e39b4f897e64e", + "build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/2f/bb/31cc38cfadaa0f66772141b7e6ff", + "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b6/41/acfa81cf0a54a440609a63b757ab", + "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d4/b5/483420d970e61d5f134345a3e324", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/59/88/0452faa29ea4e111db7f53dba04f", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/74/c7/f0f15959049ecbff24ca66005679", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/ec/49/857d97c572354d3c67cab99c0232", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/cd/12/eea8d89b8ca7c8b554900b8d52df", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/83/ac/8aa2427383a58c5f6a67dd5e72a7", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/5f/70/a90795d12ebba994f2efca12edb6", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/d8/06/c2007d03895420df60b8cfe574ea", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/9b/69/8c17f25bede5930ed3b6c3b3e0ae", "src/ballistica/generated/python_embedded/binding.inc": "https://files.ballistica.net/cache/ba1/b3/15/7c6d580b3482870b5b058858624c", - "src/ballistica/generated/python_embedded/bootstrap.inc": "https://files.ballistica.net/cache/ba1/9d/7e/0a5125aa421e722c59d22b8beb19" + "src/ballistica/generated/python_embedded/bootstrap.inc": "https://files.ballistica.net/cache/ba1/d3/db/e73d4dcf1280d5f677c3cf8b47c3" } \ No newline at end of file diff --git a/.idea/ballisticacore.iml b/.idea/ballisticacore.iml index 096ed03a..f6aab0ec 100644 --- a/.idea/ballisticacore.iml +++ b/.idea/ballisticacore.iml @@ -5,6 +5,7 @@ + diff --git a/.idea/dictionaries/ericf.xml b/.idea/dictionaries/ericf.xml index e5bb35ae..d3e6e64e 100644 --- a/.idea/dictionaries/ericf.xml +++ b/.idea/dictionaries/ericf.xml @@ -188,6 +188,7 @@ barebones baseaddr baseh + baseimps basemult basepos baservnode @@ -576,6 +577,7 @@ dincrease dingsound dingsoundhigh + dirfilter dirmanifest dirname dirnames @@ -679,6 +681,7 @@ efrosync efrotool efrotools + efrotoolsinternal eftools efxjtp eids @@ -692,10 +695,12 @@ enablexinput ename encerr + endblock endcall endcommand endef endindex + endmacro endmessage endparen endtime @@ -805,6 +810,7 @@ filebytes filecmp fileext + filefilter filehash fileinfo fileinput @@ -816,6 +822,7 @@ filesize filestates filt + filterdoc filterlines filterpath filterpaths @@ -1716,6 +1723,7 @@ pcommands pcstr pdataclass + pdoc pedit peditui peername @@ -1973,6 +1981,7 @@ realsies recache recursed + recursing recv redist redistributables @@ -2032,6 +2041,7 @@ rspdata rsplen rspobj + rsptypes rstr rtest rtnetlink @@ -2234,6 +2244,7 @@ srcnode srcpath srcpathfull + srcpaths srcplayer srcpy srcpydata diff --git a/.idea/inspectionProfiles/Default.xml b/.idea/inspectionProfiles/Default.xml index afb5c715..9f0a511b 100644 --- a/.idea/inspectionProfiles/Default.xml +++ b/.idea/inspectionProfiles/Default.xml @@ -70,7 +70,7 @@ - + - + + diff --git a/.idea/scopes/PyIgnoreUnresolved.xml b/.idea/scopes/PyIgnoreUnresolved.xml index 43ff6fca..9adf83e2 100644 --- a/.idea/scopes/PyIgnoreUnresolved.xml +++ b/.idea/scopes/PyIgnoreUnresolved.xml @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index cc5d5b64..8ec480b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ -### 1.6.10 (20510, 2022-03-18) +### 1.6.11 (20514, 2022-03-21) +- Documentation is now generated using pdoc . Thanks Dliwk!! + +### 1.6.10 (20511, 2022-03-20) - Added `_ba.get_client_public_device_uuid` function which returns a semi-permanent device id for a connected client running 1.6.10 or newer. Can be useful to combat spam attacks or other mischief. - Fixed an issue with `make update` not properly rewriting Visual Studio project files to account for new/deleted source files. - Removed various bits of code associated with the (no-longer-functional) Google Play Games multiplayer connections. diff --git a/Makefile b/Makefile index e838faad..f65e9f33 100644 --- a/Makefile +++ b/Makefile @@ -1025,8 +1025,6 @@ _windows-wsl-rebuild: # Generate docs. docs: - @tools/pcommand echo BLU GENERATING DOCS HTML... - @mkdir -p ${BUILD_DIR} @tools/pcommand gendocs # Tell make which of these targets don't represent files. diff --git a/assets/src/ba_data/python/ba/__init__.py b/assets/src/ba_data/python/ba/__init__.py index 86c096f2..89f8abbb 100644 --- a/assets/src/ba_data/python/ba/__init__.py +++ b/assets/src/ba_data/python/ba/__init__.py @@ -6,7 +6,6 @@ This top level module is a collection of most commonly used functionality. For many modding purposes, the bits exposed here are all you'll need. In some specific cases you may need to pull in individual submodules instead. """ -# pylint: disable=unused-import # pylint: disable=redefined-builtin from _ba import ( @@ -81,7 +80,49 @@ from ba._collision import Collision, getcollision app: App -__all__: list[str] = [] +__all__ = [ + 'Achievement', 'AchievementSubsystem', 'Activity', 'ActivityNotFoundError', + 'Actor', 'ActorNotFoundError', 'animate', 'animate_array', 'app', 'App', + 'AppConfig', 'AppDelegate', 'AssetPackage', 'BoolSetting', 'buttonwidget', + 'Call', 'cameraflash', 'camerashake', 'Campaign', 'CelebrateMessage', + 'charstr', 'checkboxwidget', 'ChoiceSetting', 'Chooser', + 'clipboard_get_text', 'clipboard_has_text', 'clipboard_is_supported', + 'clipboard_set_text', 'CollideModel', 'Collision', 'columnwidget', + 'containerwidget', 'Context', 'ContextCall', 'ContextError', + 'CoopGameActivity', 'CoopSession', 'Data', 'DeathType', + 'DelegateNotFoundError', 'Dependency', 'DependencyComponent', + 'DependencyError', 'DependencySet', 'DieMessage', 'do_once', 'DropMessage', + 'DroppedMessage', 'DualTeamSession', 'emitfx', 'EmptyPlayer', 'EmptyTeam', + 'Existable', 'existing', 'FloatChoiceSetting', 'FloatSetting', + 'FreeForAllSession', 'FreezeMessage', 'GameActivity', 'GameResults', + 'GameTip', 'garbage_collect', 'getactivity', 'getclass', 'getcollidemodel', + 'getcollision', 'getdata', 'getmaps', 'getmodel', 'getnodes', 'getsession', + 'getsound', 'gettexture', 'HitMessage', 'hscrollwidget', 'imagewidget', + 'ImpactDamageMessage', 'InputDevice', 'InputDeviceNotFoundError', + 'InputType', 'IntChoiceSetting', 'IntSetting', + 'is_browser_likely_available', 'is_point_in_box', 'Keyboard', + 'LanguageSubsystem', 'Level', 'Lobby', 'log', 'Lstr', 'Map', 'Material', + 'MetadataSubsystem', 'Model', 'MultiTeamSession', 'MusicPlayer', + 'MusicPlayMode', 'MusicSubsystem', 'MusicType', 'newactivity', 'newnode', + 'Node', 'NodeActor', 'NodeNotFoundError', 'normalized_color', + 'NotFoundError', 'open_url', 'OutOfBoundsMessage', 'Permission', + 'PickedUpMessage', 'PickUpMessage', 'Player', 'PlayerDiedMessage', + 'PlayerInfo', 'PlayerNotFoundError', 'PlayerRecord', 'PlayerScoredMessage', + 'playsound', 'Plugin', 'PluginSubsystem', 'PotentialPlugin', + 'PowerupAcceptMessage', 'PowerupMessage', 'print_error', 'print_exception', + 'printnodes', 'printobjects', 'pushcall', 'quit', 'rowwidget', 'safecolor', + 'ScoreConfig', 'ScoreType', 'screenmessage', 'scrollwidget', + 'ServerController', 'Session', 'SessionNotFoundError', 'SessionPlayer', + 'SessionPlayerNotFoundError', 'SessionTeam', 'SessionTeamNotFoundError', + 'set_analytics_screen', 'setmusic', 'Setting', 'ShouldShatterMessage', + 'show_damage_count', 'Sound', 'SpecialChar', 'StandLocation', + 'StandMessage', 'Stats', 'storagename', 'Team', 'TeamGameActivity', + 'TeamNotFoundError', 'Texture', 'textwidget', 'ThawMessage', 'time', + 'TimeFormat', 'Timer', 'timer', 'timestring', 'TimeType', 'uicleanupcheck', + 'UIController', 'UIScale', 'UISubsystem', 'UNHANDLED', 'Vec3', + 'vec3validate', 'verify_object_death', 'WeakCall', 'Widget', 'widget', + 'WidgetNotFoundError', 'Window' +] # Have these things present themselves cleanly as 'ba.Foo' @@ -89,10 +130,6 @@ __all__: list[str] = [] def _simplify_module_names() -> None: import os - for attr, _obj in globals().items(): - if not attr.startswith('_'): - __all__.append(attr) - # Though pdoc gets confused when we override __module__, # so let's make an exception for it. if os.environ.get('BA_DOCS_GENERATION', '0') != '1': diff --git a/assets/src/ba_data/python/ba/_account.py b/assets/src/ba_data/python/ba/_account.py index 32a5f9bc..fb330641 100644 --- a/assets/src/ba_data/python/ba/_account.py +++ b/assets/src/ba_data/python/ba/_account.py @@ -12,7 +12,6 @@ import _ba if TYPE_CHECKING: from typing import Any, Optional - import ba class AccountSubsystem: diff --git a/assets/src/ba_data/python/ba/_achievement.py b/assets/src/ba_data/python/ba/_achievement.py index 83d78081..0357c84e 100644 --- a/assets/src/ba_data/python/ba/_achievement.py +++ b/assets/src/ba_data/python/ba/_achievement.py @@ -916,7 +916,6 @@ class Achievement: def show_completion_banner(self, sound: bool = True) -> None: """Create the banner/sound for an acquired achievement announcement.""" - from ba import _account from ba import _gameutils from bastd.actor.text import Text from bastd.actor.image import Image diff --git a/assets/src/ba_data/python/ba/_activity.py b/assets/src/ba_data/python/ba/_activity.py index 50622430..5d5068f9 100644 --- a/assets/src/ba_data/python/ba/_activity.py +++ b/assets/src/ba_data/python/ba/_activity.py @@ -18,7 +18,6 @@ from ba._messages import UNHANDLED if TYPE_CHECKING: from typing import Optional, Any import ba - from bastd.actor.respawnicon import RespawnIcon PlayerType = TypeVar('PlayerType', bound=Player) TeamType = TypeVar('TeamType', bound=Team) @@ -675,6 +674,7 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]): sessionplayer.setactivity(None) sessionplayer.activityplayer = None + # noinspection PyUnresolvedReferences def _setup_player_and_team_types(self) -> None: """Pull player and team types from our typing.Generic params.""" diff --git a/assets/src/ba_data/python/ba/_actor.py b/assets/src/ba_data/python/ba/_actor.py index d6a7c194..4a9c334a 100644 --- a/assets/src/ba_data/python/ba/_actor.py +++ b/assets/src/ba_data/python/ba/_actor.py @@ -18,6 +18,7 @@ if TYPE_CHECKING: TA = TypeVar('TA', bound='Actor') +# noinspection PyUnresolvedReferences class Actor: """High level logical entities in a ba.Activity. diff --git a/assets/src/ba_data/python/ba/_app.py b/assets/src/ba_data/python/ba/_app.py index cb065f63..dca9096a 100644 --- a/assets/src/ba_data/python/ba/_app.py +++ b/assets/src/ba_data/python/ba/_app.py @@ -285,11 +285,9 @@ class App: """Runs after the app finishes bootstrapping. (internal)""" - # pylint: disable=too-many-locals # pylint: disable=cyclic-import from ba import _apputils from ba import _appconfig - from ba import _achievement from ba import _map from ba import _campaign from bastd import appdelegate @@ -429,7 +427,6 @@ class App: activity: Optional[ba.Activity] = _ba.get_foreground_host_activity() if (activity is not None and activity.allow_pausing and not _ba.have_connected_clients()): - from ba import _gameutils from ba._language import Lstr from ba._nodeactor import NodeActor diff --git a/assets/src/ba_data/python/ba/_coopsession.py b/assets/src/ba_data/python/ba/_coopsession.py index c2c08020..4338c3f9 100644 --- a/assets/src/ba_data/python/ba/_coopsession.py +++ b/assets/src/ba_data/python/ba/_coopsession.py @@ -236,6 +236,7 @@ class CoopSession(Session): with _ba.Context(activity): activity.end(results={'outcome': 'restart'}, force=True) + # noinspection PyUnresolvedReferences def on_activity_end(self, activity: ba.Activity, results: Any) -> None: """Method override for co-op sessions. diff --git a/assets/src/ba_data/python/ba/_gameactivity.py b/assets/src/ba_data/python/ba/_gameactivity.py index 129fae2f..8e2552eb 100644 --- a/assets/src/ba_data/python/ba/_gameactivity.py +++ b/assets/src/ba_data/python/ba/_gameactivity.py @@ -258,6 +258,7 @@ class GameActivity(Activity[PlayerType, TeamType]): """Return a name for this particular game instance.""" return self.get_display_string(self.settings_raw) + # noinspection PyUnresolvedReferences def get_instance_scoreboard_display_string(self) -> ba.Lstr: """Return a name for this particular game instance. diff --git a/assets/src/ba_data/python/ba/_gameutils.py b/assets/src/ba_data/python/ba/_gameutils.py index 110535a8..0a4c4ee1 100644 --- a/assets/src/ba_data/python/ba/_gameutils.py +++ b/assets/src/ba_data/python/ba/_gameutils.py @@ -98,6 +98,7 @@ def animate(node: ba.Node, # FIXME: Even if we are looping we should have a way to die once we # get disconnected. if not loop: + # noinspection PyUnresolvedReferences _ba.timer(int(mult * items[-1][0]) + 1000, curve.delete, timeformat=TimeFormat.MILLISECONDS) @@ -178,6 +179,7 @@ def animate_array(node: ba.Node, # curve after its done its job. if not loop: # (PyCharm seems to think item is a float, not a tuple) + # noinspection PyUnresolvedReferences _ba.timer(int(mult * items[-1][0]) + 1000, curve.delete, timeformat=TimeFormat.MILLISECONDS) @@ -189,6 +191,7 @@ def animate_array(node: ba.Node, # once we get disconnected. if not loop: # (PyCharm seems to think item is a float, not a tuple) + # noinspection PyUnresolvedReferences _ba.timer(int(mult * items[-1][0]) + 1000, combine.delete, timeformat=TimeFormat.MILLISECONDS) diff --git a/assets/src/ba_data/python/ba/_general.py b/assets/src/ba_data/python/ba/_general.py index b28731c1..ecab6c50 100644 --- a/assets/src/ba_data/python/ba/_general.py +++ b/assets/src/ba_data/python/ba/_general.py @@ -137,6 +137,7 @@ def get_type_name(cls: type) -> str: return cls.__module__ + '.' + cls.__name__ +# noinspection PyUnresolvedReferences class _WeakCall: """Wrap a callable and arguments into a single callable object. @@ -225,6 +226,7 @@ class _Call: """ def __init__(self, *args: Any, **keywds: Any): + # noinspection PyUnresolvedReferences """Instantiate a Call. Pass a callable as the first arg, followed by any number of @@ -360,6 +362,7 @@ def _verify_object_death(wref: weakref.ref) -> None: def storagename(suffix: str = None) -> str: + # noinspection PyUnresolvedReferences """Generate a unique name for storing class data in shared places. Category: **General Utility Functions** diff --git a/assets/src/ba_data/python/ba/_language.py b/assets/src/ba_data/python/ba/_language.py index 805cf287..57904130 100644 --- a/assets/src/ba_data/python/ba/_language.py +++ b/assets/src/ba_data/python/ba/_language.py @@ -364,6 +364,7 @@ class LanguageSubsystem: return 0xE000 <= ord(char) <= 0xF8FF +# noinspection PyUnresolvedReferences class Lstr: """Used to define strings in a language-independent way. diff --git a/assets/src/ba_data/python/ba/_lobby.py b/assets/src/ba_data/python/ba/_lobby.py index f063f533..1d4274d6 100644 --- a/assets/src/ba_data/python/ba/_lobby.py +++ b/assets/src/ba_data/python/ba/_lobby.py @@ -410,6 +410,7 @@ class Chooser: self._profileindex = self._profilenames.index(self._profilename) else: self._profileindex = 0 + # noinspection PyUnresolvedReferences self._profilename = self._profilenames[self._profileindex] def update_position(self) -> None: diff --git a/assets/src/ba_data/python/ba/_map.py b/assets/src/ba_data/python/ba/_map.py index be653942..20da8b7e 100644 --- a/assets/src/ba_data/python/ba/_map.py +++ b/assets/src/ba_data/python/ba/_map.py @@ -189,7 +189,6 @@ class Map(Actor): def __init__(self, vr_overlay_offset: Optional[Sequence[float]] = None) -> None: """Instantiate a map.""" - from ba import _gameutils super().__init__() # This is expected to always be a ba.Node object (whether valid or not) diff --git a/assets/src/ba_data/python/ba/_music.py b/assets/src/ba_data/python/ba/_music.py index bb417661..82f9c785 100644 --- a/assets/src/ba_data/python/ba/_music.py +++ b/assets/src/ba_data/python/ba/_music.py @@ -485,7 +485,6 @@ def setmusic(musictype: Optional[ba.MusicType], if 'continuous' is True and musictype is the same as what is already playing, the playing track will not be restarted. """ - from ba import _gameutils # All we do here now is set a few music attrs on the current globals # node. The foreground globals' current playing music then gets fed to diff --git a/assets/src/ba_data/python/ba/_net.py b/assets/src/ba_data/python/ba/_net.py index d427ccce..4d146a05 100644 --- a/assets/src/ba_data/python/ba/_net.py +++ b/assets/src/ba_data/python/ba/_net.py @@ -14,7 +14,6 @@ import _ba if TYPE_CHECKING: from typing import Any, Union, Callable, Optional import socket - import ba MasterServerCallback = Callable[[Union[None, dict[str, Any]]], None] # Timeout for standard functions talking to the master-server/etc. @@ -106,7 +105,7 @@ class MasterServerCallThread(threading.Thread): def run(self) -> None: # pylint: disable=too-many-branches, consider-using-with import urllib.request - import urllib.error + import urllib.parse import json from efro.error import is_urllib_network_error @@ -114,19 +113,19 @@ class MasterServerCallThread(threading.Thread): try: self._data = _general.utf8_all(self._data) _ba.set_thread_name('BA_ServerCallThread') - parse = urllib.parse if self._request_type == 'get': response = urllib.request.urlopen( urllib.request.Request( (_ba.get_master_server_address() + '/' + - self._request + '?' + parse.urlencode(self._data)), - None, {'User-Agent': _ba.app.user_agent_string}), + self._request + '?' + + urllib.parse.urlencode(self._data)), None, + {'User-Agent': _ba.app.user_agent_string}), timeout=DEFAULT_REQUEST_TIMEOUT_SECONDS) elif self._request_type == 'post': response = urllib.request.urlopen( urllib.request.Request( _ba.get_master_server_address() + '/' + self._request, - parse.urlencode(self._data).encode(), + urllib.parse.urlencode(self._data).encode(), {'User-Agent': _ba.app.user_agent_string}), timeout=DEFAULT_REQUEST_TIMEOUT_SECONDS) else: diff --git a/assets/src/ba_data/python/ba/internal.py b/assets/src/ba_data/python/ba/internal.py index 26fae04e..95a7bfc3 100644 --- a/assets/src/ba_data/python/ba/internal.py +++ b/assets/src/ba_data/python/ba/internal.py @@ -7,8 +7,6 @@ or disappear without warning, so should be avoided (or used sparingly and defensively) in mods. """ -# pylint: disable=unused-import - from ba._map import (get_unowned_maps, get_map_class, register_map, preload_map_preview_media, get_map_display_string, get_filtered_map_name) @@ -39,3 +37,24 @@ from ba._store import (get_available_sale_time, get_available_purchase_count, get_store_item, get_clean_price) from ba._tournament import get_tournament_prize_strings from ba._gameutils import get_trophy_string + +__all__ = [ + 'get_unowned_maps', 'get_map_class', 'register_map', + 'preload_map_preview_media', 'get_map_display_string', + 'get_filtered_map_name', 'commit_app_config', 'get_device_value', + 'get_input_map_hash', 'get_input_device_config', 'getclass', 'json_prep', + 'get_type_name', 'JoinActivity', 'ScoreScreenActivity', + 'is_browser_likely_available', 'get_remote_app_name', + 'should_submit_debug_info', 'run_gpu_benchmark', 'run_cpu_benchmark', + 'run_media_reload_benchmark', 'run_stress_test', 'getcampaign', + 'PlayerProfilesChangedMessage', 'DEFAULT_TEAM_COLORS', + 'DEFAULT_TEAM_NAMES', 'do_play_music', 'master_server_get', + 'master_server_post', 'get_ip_address_type', + 'DEFAULT_REQUEST_TIMEOUT_SECONDS', 'get_default_powerup_distribution', + 'get_player_profile_colors', 'get_player_profile_icon', + 'get_player_colors', 'get_next_tip', 'get_default_free_for_all_playlist', + 'get_default_teams_playlist', 'filter_playlist', 'get_available_sale_time', + 'get_available_purchase_count', 'get_store_item_name_translated', + 'get_store_item_display_size', 'get_store_layout', 'get_store_item', + 'get_clean_price', 'get_tournament_prize_strings', 'get_trophy_string' +] diff --git a/assets/src/ba_data/python/bastd/activity/coopscore.py b/assets/src/ba_data/python/bastd/activity/coopscore.py index 9df3badd..9dd4e277 100644 --- a/assets/src/ba_data/python/bastd/activity/coopscore.py +++ b/assets/src/ba_data/python/bastd/activity/coopscore.py @@ -841,6 +841,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]): if display_scores[i][1] is None: name_str = '-' else: + # noinspection PyUnresolvedReferences name_str = ', '.join([ p['name'] for p in display_scores[i][1]['players'] ]) diff --git a/assets/src/ba_data/python/bastd/activity/multiteamscore.py b/assets/src/ba_data/python/bastd/activity/multiteamscore.py index 3701ff89..077141a9 100644 --- a/assets/src/ba_data/python/bastd/activity/multiteamscore.py +++ b/assets/src/ba_data/python/bastd/activity/multiteamscore.py @@ -94,6 +94,7 @@ class MultiTeamScoreScreenActivity(ScoreScreenActivity): assert self.stats valid_players = list(self.stats.get_records().items()) + # noinspection PyUnresolvedReferences def _get_player_score_set_entry( player: ba.SessionPlayer) -> Optional[ba.PlayerRecord]: for p_rec in valid_players: diff --git a/assets/src/ba_data/python/bastd/actor/spaz.py b/assets/src/ba_data/python/bastd/actor/spaz.py index b6101ea8..46154a84 100644 --- a/assets/src/ba_data/python/bastd/actor/spaz.py +++ b/assets/src/ba_data/python/bastd/actor/spaz.py @@ -16,7 +16,6 @@ from bastd.gameutils import SharedObjects if TYPE_CHECKING: from typing import Any, Sequence, Optional, Union, Callable - from bastd.actor.spazfactory import SpazFactory POWERUP_WEAR_OFF_TIME = 20000 BASE_PUNCH_COOLDOWN = 400 diff --git a/assets/src/ba_data/python/bastd/game/runaround.py b/assets/src/ba_data/python/bastd/game/runaround.py index e22d4581..29779b20 100644 --- a/assets/src/ba_data/python/bastd/game/runaround.py +++ b/assets/src/ba_data/python/bastd/game/runaround.py @@ -51,6 +51,7 @@ class Point(Enum): @dataclass class Spawn: """Defines a bot spawn event.""" + # noinspection PyUnresolvedReferences type: type[SpazBot] path: int = 0 point: Optional[Point] = None diff --git a/assets/src/ba_data/python/bastd/ui/account/v2.py b/assets/src/ba_data/python/bastd/ui/account/v2.py index 739edd4f..d622b1d7 100644 --- a/assets/src/ba_data/python/bastd/ui/account/v2.py +++ b/assets/src/ba_data/python/bastd/ui/account/v2.py @@ -10,7 +10,7 @@ import ba import _ba if TYPE_CHECKING: - from typing import Any, Optional + pass class V2SignInWindow(ba.Window): diff --git a/assets/src/ba_data/python/bastd/ui/colorpicker.py b/assets/src/ba_data/python/bastd/ui/colorpicker.py index 14e935c9..800a3727 100644 --- a/assets/src/ba_data/python/bastd/ui/colorpicker.py +++ b/assets/src/ba_data/python/bastd/ui/colorpicker.py @@ -249,6 +249,7 @@ class ColorPickerExact(PopupWindow): # color to the delegate, so start doing that. self._update_for_color() + # noinspection PyUnresolvedReferences def _update_for_color(self) -> None: if not self.root_widget: return diff --git a/assets/src/ba_data/python/bastd/ui/coop/browser.py b/assets/src/ba_data/python/bastd/ui/coop/browser.py index 6fb34fef..ca33075a 100644 --- a/assets/src/ba_data/python/bastd/ui/coop/browser.py +++ b/assets/src/ba_data/python/bastd/ui/coop/browser.py @@ -269,6 +269,7 @@ class CoopBrowserWindow(ba.Window): repeat=True) self._update() + # noinspection PyUnresolvedReferences @staticmethod def _preload_modules() -> None: """Preload modules we use (called in bg thread).""" diff --git a/assets/src/ba_data/python/bastd/ui/gather/manualtab.py b/assets/src/ba_data/python/bastd/ui/gather/manualtab.py index 798b11f6..fe0a706b 100644 --- a/assets/src/ba_data/python/bastd/ui/gather/manualtab.py +++ b/assets/src/ba_data/python/bastd/ui/gather/manualtab.py @@ -17,7 +17,6 @@ import ba if TYPE_CHECKING: from typing import Any, Optional, Union, Callable from bastd.ui.gather import GatherWindow - from bastd.ui.confirm import ConfirmWindow def _safe_set_text(txt: Optional[ba.Widget], diff --git a/assets/src/ba_data/python/bastd/ui/mainmenu.py b/assets/src/ba_data/python/bastd/ui/mainmenu.py index 420b6cf6..f58df844 100644 --- a/assets/src/ba_data/python/bastd/ui/mainmenu.py +++ b/assets/src/ba_data/python/bastd/ui/mainmenu.py @@ -76,6 +76,7 @@ class MainMenuWindow(ba.Window): repeat=True, timetype=ba.TimeType.REAL) + # noinspection PyUnresolvedReferences @staticmethod def _preload_modules() -> None: """Preload modules we use (called in bg thread).""" diff --git a/assets/src/ba_data/python/bastd/ui/partyqueue.py b/assets/src/ba_data/python/bastd/ui/partyqueue.py index f1b5a235..4f4cf9c0 100644 --- a/assets/src/ba_data/python/bastd/ui/partyqueue.py +++ b/assets/src/ba_data/python/bastd/ui/partyqueue.py @@ -341,6 +341,7 @@ class PartyQueueWindow(ba.Window): self._dudes_by_id[enemy_id].claimed = True # remove unclaimed dudes from both of our lists + # noinspection PyUnresolvedReferences self._dudes_by_id = dict([ item for item in list(self._dudes_by_id.items()) if item[1].claimed ]) diff --git a/assets/src/ba_data/python/bastd/ui/play.py b/assets/src/ba_data/python/bastd/ui/play.py index adfeb3e9..d5c2b001 100644 --- a/assets/src/ba_data/python/bastd/ui/play.py +++ b/assets/src/ba_data/python/bastd/ui/play.py @@ -417,6 +417,7 @@ class PlayWindow(ba.Window): self._restore_state() + # noinspection PyUnresolvedReferences @staticmethod def _preload_modules() -> None: """Preload modules we use (called in bg thread).""" diff --git a/assets/src/ba_data/python/bastd/ui/settings/advanced.py b/assets/src/ba_data/python/bastd/ui/settings/advanced.py index 73a1338a..ebf384a4 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/advanced.py +++ b/assets/src/ba_data/python/bastd/ui/settings/advanced.py @@ -149,6 +149,7 @@ class AdvancedSettingsWindow(ba.Window): master_server_get('bsLangGetCompleted', {'b': app.build_number}, callback=ba.WeakCall(self._completed_langs_cb)) + # noinspection PyUnresolvedReferences @staticmethod def _preload_modules() -> None: """Preload modules we use (called in bg thread).""" diff --git a/assets/src/ba_data/python/bastd/ui/settings/allsettings.py b/assets/src/ba_data/python/bastd/ui/settings/allsettings.py index cf44b215..4c994acd 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/allsettings.py +++ b/assets/src/ba_data/python/bastd/ui/settings/allsettings.py @@ -187,6 +187,7 @@ class AllSettingsWindow(ba.Window): draw_controller=avb) self._restore_state() + # noinspection PyUnresolvedReferences @staticmethod def _preload_modules() -> None: """Preload modules we use (called in bg thread).""" diff --git a/assets/src/pdoc/templates/index.html.jinja2 b/assets/src/pdoc/templates/index.html.jinja2 index efc2fba5..1d2aeea1 100644 --- a/assets/src/pdoc/templates/index.html.jinja2 +++ b/assets/src/pdoc/templates/index.html.jinja2 @@ -15,22 +15,19 @@ {% endif %}
-

Welcome to Ballistica Documentations!

+

Welcome to Ballistica Documentation!

Last updated for Ballistica {{ ba_version }} (build {{ ba_build }})

Here you can find information about Python classes/functions used by Ballistica. - Fell free to create an + Feel free to create an issue or send a PR if something in this docs feels incorrect or can be improved. - Note that bastd's docs may look a little terrible - right - now, hope that's temporary. :)

{% if search %} diff --git a/ballisticacore-cmake/.idea/dictionaries/ericf.xml b/ballisticacore-cmake/.idea/dictionaries/ericf.xml index 2302a4e0..a5637d55 100644 --- a/ballisticacore-cmake/.idea/dictionaries/ericf.xml +++ b/ballisticacore-cmake/.idea/dictionaries/ericf.xml @@ -88,6 +88,7 @@ bametainternal barebones baseaddr + baseimps basetype basicsize basn @@ -293,6 +294,7 @@ dfmt dictval diffbit + dirfilter dirslash dlfcn dlife @@ -331,6 +333,7 @@ efrocaching efrohack efrohome + efrotoolsinternal elapsedf elems elevenbase @@ -339,9 +342,11 @@ emitfx emojis enablexinput + endblock endcall endl endline + endmacro endtime entrypoint enumvaltype @@ -400,8 +405,10 @@ fieldname fieldpath fifteenbits + filefilter filelock filt + filterdoc filterstr filterval finishedptr @@ -855,6 +862,7 @@ pausable pcommands pdataclass + pdoc pdst peername persp @@ -964,6 +972,7 @@ realtimers recalc recursed + recursing recv recvfrom redundants @@ -1003,6 +1012,7 @@ rspdata rsplen rspobj + rsptypes rtest rtypes rtypevar @@ -1089,6 +1099,7 @@ srcid srcname srcpath + srcpaths srcsz sresult sscanf diff --git a/src/ballistica/ballistica.cc b/src/ballistica/ballistica.cc index 69ea4e78..754dbe93 100644 --- a/src/ballistica/ballistica.cc +++ b/src/ballistica/ballistica.cc @@ -21,8 +21,8 @@ namespace ballistica { // These are set automatically via script; don't modify them here. -const int kAppBuildNumber = 20510; -const char* kAppVersion = "1.6.10"; +const int kAppBuildNumber = 20514; +const char* kAppVersion = "1.6.11"; // Our standalone globals. // These are separated out for easy access. diff --git a/src/meta/Makefile b/src/meta/Makefile index 35a3eedf..073a4d54 100644 --- a/src/meta/Makefile +++ b/src/meta/Makefile @@ -5,7 +5,9 @@ PCOMMAND = ../../tools/pcommand all: sources clean: - rm -rf ../ballistica/generated ../../assets/src/ba_data/python/ba/_generated bametainternal/generated + rm -rf ../ballistica/generated \ + ../../assets/src/ba_data/python/ba/_generated \ + bametainternal/generated # This section is generated by batools.metamakefile; do not edit by hand. @@ -17,10 +19,10 @@ sources: \ ../ballistica/generated/python_embedded/binding.inc \ ../ballistica/generated/python_embedded/bootstrap.inc -../ballistica/generated/python_embedded/binding.inc : bameta/python_embedded/binding.py ../../tools/batools/meta.py +../ballistica/generated/python_embedded/binding.inc : bameta/python_embedded/binding.py @$(PCOMMAND) gen_binding_code $< $@ -../ballistica/generated/python_embedded/bootstrap.inc : bameta/python_embedded/bootstrap.py ../../tools/batools/meta.py +../ballistica/generated/python_embedded/bootstrap.inc : bameta/python_embedded/bootstrap.py @$(PCOMMAND) gen_flat_data_code $< $@ bootstrap_code ../../assets/src/ba_data/python/ba/_generated/__init__.py : ../../tools/batools/pcommand.py diff --git a/src/meta/bameta/python_embedded/bootstrap.py b/src/meta/bameta/python_embedded/bootstrap.py index 2e743aa1..b24cfa9d 100644 --- a/src/meta/bameta/python_embedded/bootstrap.py +++ b/src/meta/bameta/python_embedded/bootstrap.py @@ -140,6 +140,7 @@ if (_ba.contains_python_dist() if debug_build: + # noinspection PyUnresolvedReferences def _thread_func() -> None: # pylint: disable=unused-import import json diff --git a/tests/test_efro/test_rpc.py b/tests/test_efro/test_rpc.py index 35ed7730..c957498f 100644 --- a/tests/test_efro/test_rpc.py +++ b/tests/test_efro/test_rpc.py @@ -19,7 +19,7 @@ from efro.error import CommunicationError from efro.dataclassio import ioprepped, dataclass_from_json, dataclass_to_json if TYPE_CHECKING: - from typing import Optional, Awaitable, Callable + from typing import Optional, Awaitable ADDR = '127.0.0.1' # Randomize this a bit to avoid failing on parallel testing. diff --git a/tools/batools/assetstaging.py b/tools/batools/assetstaging.py index 46f75ebd..773f4400 100755 --- a/tools/batools/assetstaging.py +++ b/tools/batools/assetstaging.py @@ -16,7 +16,6 @@ from efrotools import PYVER if TYPE_CHECKING: from typing import Optional - from pathlib import Path # Suffix for the pyc files we include in stagings. # We're using deterministic opt pyc files; see PEP 552. diff --git a/tools/batools/build.py b/tools/batools/build.py index a2b8c1dc..2094e3fc 100644 --- a/tools/batools/build.py +++ b/tools/batools/build.py @@ -8,12 +8,13 @@ import sys import datetime import subprocess from enum import Enum -from pathlib import Path from dataclasses import dataclass from typing import TYPE_CHECKING +from efro.util import assert_never from efro.error import CleanError from efro.terminal import Clr +from efrotools.build import Lazybuild if TYPE_CHECKING: from typing import Sequence, Optional, Any @@ -80,15 +81,6 @@ SPARSE_TEST_BUILDS: list[list[str]] = [ DO_SPARSE_TEST_BUILDS = 'ballistica' + 'core' == 'ballisticacore' -class SourceCategory(Enum): - """Types of sources.""" - RESOURCES = 'resources_src' - META = 'meta_src' - ASSETS = 'assets_src' - CMAKE = 'cmake_src' - WIN = 'win_src' - - class PrefabTarget(Enum): """Types of prefab builds able to be run.""" GUI_DEBUG = 'gui-debug' @@ -97,130 +89,91 @@ class PrefabTarget(Enum): SERVER_RELEASE = 'server-release' -def _lazybuild_check_paths(inpaths: list[str], category: SourceCategory, - target: str) -> bool: - # pylint: disable=too-many-branches - - mtime = None if not os.path.exists(target) else os.path.getmtime(target) - - if target.startswith('.cache/lazybuild/'): - tnamepretty = target[len('.cache/lazybuild/'):] - else: - tnamepretty = target - - def _testpath(path: str) -> bool: - # Now see this path is newer than our target.. - if mtime is None or os.path.getmtime(path) >= mtime: - print(f'{Clr.SMAG}Build of {tnamepretty} triggered by change in' - f" '{path}'{Clr.RST}") - return True - return False - - unchanged_count = 0 - for inpath in inpaths: - # Add files verbatim; recurse through dirs. - if os.path.isfile(inpath): - if _testpath(inpath): - return True - unchanged_count += 1 - continue - for root, _dnames, fnames in os.walk(inpath): - - # Only the meta category uses meta src. - if (root.startswith('src/meta') - and category is not SourceCategory.META): - continue - - # None of our targets use tools-src. - if root.startswith('src/tools'): - continue - - # Skip most of external except for key cases. - if root.startswith('src/external'): - if category is SourceCategory.WIN and root.startswith( - 'src/external/windows'): - pass - else: - continue - - # Ignore python cache files. - if '__pycache__' in root: - continue - - for fname in fnames: - # Ignore dot files - if fname.startswith('.'): - continue - fpath = os.path.join(root, fname) - if ' ' in fpath: - raise RuntimeError(f'Invalid path with space: {fpath}') - - if _testpath(fpath): - return True - unchanged_count += 1 - print(f'{Clr.BLU}Lazybuild: skipping "{tnamepretty}"' - f' ({unchanged_count} inputs unchanged).{Clr.RST}') - return False +class LazyBuildCategory(Enum): + """Types of sources.""" + RESOURCES = 'resources_src' + META = 'meta_src' + CMAKE = 'cmake_src' + WIN = 'win_src' -def lazybuild(target: str, category: SourceCategory, command: str) -> None: - """Run a build if anything in some category is newer than a target. - - This can be used as an optimization for build targets that *always* run. - As an example, a target that spins up a VM and runs a build can be - expensive even if the VM build process determines that nothing has changed - and does no work. We can use this to examine a broad swath of source files - and skip firing up the VM if nothing has changed. We can be overly broad - in the sources we look at since the worst result of a false positive change - is the VM spinning up and determining that no actual inputs have changed. - We could recreate this mechanism purely in the Makefile, but large numbers - of target sources can add significant overhead each time the Makefile is - invoked; in our case the cost is only incurred when a build is triggered. - - Note that target's mod-time will *always* be updated to match the newest - source regardless of whether the build itself was triggered. - """ - paths: list[str] +def lazybuild(target: str, category: LazyBuildCategory, command: str) -> None: + """Run some lazybuild presets.""" # Everything possibly affecting meta builds. - if category is SourceCategory.META: - paths = [ - 'Makefile', 'tools/batoolsinternal/meta.py', - 'tools/batoolsinternal/pcommand.py', 'tools/batools/meta.py', - 'tools/batools/pcommand.py', 'src/meta', - 'tools/batools/pythonenumsmodule.py', 'src/ballistica/core/types.h' - ] - - # Everything possibly affecting asset builds. - elif category is SourceCategory.ASSETS: - paths = ['Makefile', 'tools/pcommand', 'convert_util', 'assets/src'] + if category is LazyBuildCategory.META: + Lazybuild( + target=target, + srcpaths=[ + 'Makefile', + 'src/meta', + 'src/ballistica/core/types.h', + ], + command=command, + # Our meta Makefile targets generally don't list tools scripts + # that can affect their creation as sources, so let's set up + # a catch-all here: when any of our tools stuff changes let's + # blow away any existing meta builds. + srcpaths_fullclean=[ + 'tools/efrotools', + 'tools/efrotoolsinternal', + 'tools/batools', + 'tools/batoolsinternal', + ], + command_fullclean='make meta-clean', + ).run() # Everything possibly affecting CMake builds. - elif category is SourceCategory.CMAKE: - paths = ['Makefile', 'src', 'ballisticacore-cmake/CMakeLists.txt'] + elif category is LazyBuildCategory.CMAKE: + Lazybuild( + target=target, + srcpaths=[ + 'Makefile', + 'src', + 'ballisticacore-cmake/CMakeLists.txt', + ], + dirfilter=(lambda root, dirname: not ( + root == 'src' and dirname in {'meta', 'tools', 'external'})), + command=command, + ).run() # Everything possibly affecting Windows binary builds. - elif category is SourceCategory.WIN: - paths = ['Makefile', 'src', 'resources/src', 'ballisticacore-windows'] + elif category is LazyBuildCategory.WIN: + + def _win_dirfilter(root: str, dirname: str) -> bool: + if root == 'src' and dirname in {'meta', 'tools'}: + return False + if root == 'src/external' and dirname != 'windows': + return False + return True + + Lazybuild( + target=target, + srcpaths=[ + 'Makefile', + 'src', + 'resources/src', + 'ballisticacore-windows', + ], + dirfilter=_win_dirfilter, + command=command, + ).run() # Everything possibly affecting resource builds. - elif category is SourceCategory.RESOURCES: - paths = [ - 'Makefile', 'tools/pcommand', 'resources/src', 'resources/Makefile' - ] + elif category is LazyBuildCategory.RESOURCES: + Lazybuild( + target=target, + srcpaths=[ + 'Makefile', + 'tools/pcommand', + 'resources/src', + 'resources/Makefile', + ], + command=command, + ).run() + else: - raise ValueError(f'Invalid source category: {category}') - - # Now do the thing if any our our input mod times changed. - if _lazybuild_check_paths(paths, category, target): - subprocess.run(command, shell=True, check=True) - - # We also explicitly update the mod-time of the target; - # the command we (such as a VM build) may not have actually - # done anything but we still want to update our target to - # be newer than all the lazy sources. - os.makedirs(os.path.dirname(target), exist_ok=True) - Path(target).touch() + assert_never(category) def archive_old_builds(ssh_server: str, builds_dir: str, diff --git a/tools/batools/docs.py b/tools/batools/docs.py index cbfbd967..fe2d5566 100755 --- a/tools/batools/docs.py +++ b/tools/batools/docs.py @@ -78,6 +78,11 @@ def generate(projroot: str) -> None: from batools.version import get_current_version import pdoc + # Since we're operating on source dirs, suppress .pyc generation. + # (__pycache__ dirs in source dirs causes some subtle headaches in + # the private repo) + sys.dont_write_bytecode = True + # Make sure we're running from the dir above this script. os.chdir(projroot) diff --git a/tools/batools/metamakefile.py b/tools/batools/metamakefile.py index 26366ba4..47612a08 100755 --- a/tools/batools/metamakefile.py +++ b/tools/batools/metamakefile.py @@ -19,7 +19,7 @@ from efro.terminal import Clr from efrotools import getconfig if TYPE_CHECKING: - from typing import Optional, Any + pass # These paths need to be relative to the dir we're writing the Makefile to. TOOLS_DIR = '../../tools' @@ -111,7 +111,7 @@ def _add_python_embedded_targets(targets: list[Target]) -> None: name = os.path.splitext(fname)[0] src = [ f'{pkg}/python_embedded/{name}.py', - os.path.join(TOOLS_DIR, 'batools', 'meta.py') + # os.path.join(TOOLS_DIR, 'batools', 'meta.py') ] dst = os.path.join(OUT_DIR_CPP, 'python_embedded', f'{name}.inc') if name == 'binding': @@ -139,7 +139,7 @@ def _add_python_embedded_targets_internal(targets: list[Target]) -> None: Target( src=[ f'{pkg}/python_embedded/{name}.py', - os.path.join(TOOLS_DIR, 'batoolsinternal', 'meta.py') + # os.path.join(TOOLS_DIR, 'batoolsinternal', 'meta.py') ], dst=os.path.join(OUT_DIR_CPP, 'python_embedded', f'{name}.inc'), @@ -161,7 +161,7 @@ def _add_extra_targets_internal(targets: list[Target]) -> None: Target( src=[ f'bametainternal/python_embedded/{srcname}.py', - os.path.join(TOOLS_DIR, 'batoolsinternal', 'meta.py') + # os.path.join(TOOLS_DIR, 'batoolsinternal', 'meta.py') ], dst=f'bametainternal/generated/{dstname}.py', cmd=f'$(PCOMMAND) {gencmd} $@', @@ -175,7 +175,7 @@ def _add_extra_targets_internal(targets: list[Target]) -> None: Target( src=[ f'bametainternal/generated/{name}.py', - os.path.join(TOOLS_DIR, 'batoolsinternal', 'meta.py') + # os.path.join(TOOLS_DIR, 'batoolsinternal', 'meta.py') ], dst=os.path.join(OUT_DIR_CPP, 'python_embedded', f'{name}.inc'), diff --git a/tools/batools/pcommand.py b/tools/batools/pcommand.py index 0588a292..0b7680e3 100644 --- a/tools/batools/pcommand.py +++ b/tools/batools/pcommand.py @@ -481,7 +481,10 @@ def warm_start_asset_build() -> None: def gendocs() -> None: """Generate docs html.""" + from efro.terminal import Clr import batools.docs + + print(f'{Clr.BLU}Generating docs html...{Clr.RST}') batools.docs.generate(projroot=str(PROJROOT)) @@ -668,7 +671,7 @@ def lazybuild() -> None: if len(sys.argv) < 5: raise CleanError('Expected at least 3 args') try: - category = batools.build.SourceCategory(sys.argv[2]) + category = batools.build.LazyBuildCategory(sys.argv[2]) except ValueError as exc: raise CleanError(exc) from exc target = sys.argv[3] diff --git a/tools/batools/pythonenumsmodule.py b/tools/batools/pythonenumsmodule.py index dbd56d2d..9f5eddd0 100755 --- a/tools/batools/pythonenumsmodule.py +++ b/tools/batools/pythonenumsmodule.py @@ -15,7 +15,7 @@ from efro.terminal import Clr from efrotools import get_public_license if TYPE_CHECKING: - from typing import Optional + pass def camel_case_convert(name: str) -> str: diff --git a/tools/batools/version.py b/tools/batools/version.py index eadfcb28..64139e22 100755 --- a/tools/batools/version.py +++ b/tools/batools/version.py @@ -9,7 +9,7 @@ import sys from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import Sequence + pass def _handle_args(args: list[str]) -> str: diff --git a/tools/efro/dataclassio/extras.py b/tools/efro/dataclassio/extras.py index ed63939f..cfa19920 100644 --- a/tools/efro/dataclassio/extras.py +++ b/tools/efro/dataclassio/extras.py @@ -8,7 +8,7 @@ import dataclasses from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import Any, Optional + from typing import Any def dataclass_diff(obj1: Any, obj2: Any) -> str: diff --git a/tools/efro/error.py b/tools/efro/error.py index 3bc1a546..adf88702 100644 --- a/tools/efro/error.py +++ b/tools/efro/error.py @@ -75,7 +75,6 @@ def is_urllib_network_error(exc: BaseException) -> bool: ignored or presented to the user as general 'network-unavailable' states. """ - import urllib.request import urllib.error import http.client import errno diff --git a/tools/efro/message/_protocol.py b/tools/efro/message/_protocol.py index 30f4f8f8..b5320fa8 100644 --- a/tools/efro/message/_protocol.py +++ b/tools/efro/message/_protocol.py @@ -19,7 +19,7 @@ from efro.message._message import (Message, Response, ErrorResponse, UnregisteredMessageIDError) if TYPE_CHECKING: - from typing import Any, Callable, Optional, Sequence, Union, Awaitable + from typing import Any, Optional, Literal class MessageProtocol: @@ -228,7 +228,7 @@ class MessageProtocol: return out def _get_module_header(self, - part: str, + part: Literal['sender', 'receiver'], extra_import_code: Optional[str] = None) -> str: """Return common parts of generated modules.""" # pylint: disable=too-many-locals, too-many-branches @@ -238,11 +238,16 @@ class MessageProtocol: single_message_type = len(self.message_ids_by_type) == 1 - # Always import messages - for msgtype in list(self.message_ids_by_type) + [Message]: + msgtypes = list(self.message_ids_by_type) + if part == 'sender': + msgtypes.append(Message) + for msgtype in msgtypes: tpimports.setdefault(msgtype.__module__, []).append(msgtype.__name__) - for rsp_tp in list(self.response_ids_by_type) + [Response]: + rsptypes = list(self.response_ids_by_type) + if part == 'sender': + rsptypes.append(Response) + for rsp_tp in rsptypes: # Skip these as they don't actually show up in code. if rsp_tp is EmptyResponse or rsp_tp is ErrorResponse: continue @@ -292,6 +297,14 @@ class MessageProtocol: ovld = ', overload' if not single_message_type else '' tpimport_lines = textwrap.indent(tpimport_lines, ' ') + + # We need Optional for sender-modules with multiple types + baseimps = ['Union', 'Any'] + if part == 'sender' and len(msgtypes) > 1: + baseimps.append('Optional') + if part == 'receiver': + baseimps.append('Callable') + baseimps_s = ', '.join(baseimps) out = ('# Released under the MIT License. See LICENSE for details.\n' f'#\n' f'"""Auto-generated {part} module. Do not edit by hand."""\n' @@ -303,7 +316,7 @@ class MessageProtocol: f'{import_lines}\n' f'\n' f'if TYPE_CHECKING:\n' - f' from typing import Union, Any, Optional, Callable' + f' from typing import {baseimps_s}' f'{tpimport_typing_extras}\n' f'{tpimport_lines}' f'\n' diff --git a/tools/efro/message/_receiver.py b/tools/efro/message/_receiver.py index a06bd72e..bffbbe9e 100644 --- a/tools/efro/message/_receiver.py +++ b/tools/efro/message/_receiver.py @@ -14,7 +14,7 @@ from efro.message._message import (Message, Response, EmptyResponse, ErrorResponse, UnregisteredMessageIDError) if TYPE_CHECKING: - from typing import Any, Callable, Optional, Awaitable, Union + from typing import Any, Callable, Optional, Union from efro.message._protocol import MessageProtocol diff --git a/tools/efro/rpc.py b/tools/efro/rpc.py index 1888c2f3..9768c574 100644 --- a/tools/efro/rpc.py +++ b/tools/efro/rpc.py @@ -21,7 +21,6 @@ from efro.dataclassio import (dataclass_to_json, dataclass_from_json, if TYPE_CHECKING: from typing import Literal, Awaitable, Callable, Optional - from threading import Thread # Terminology: # Packet: A chunk of data consisting of a type and some type-dependent diff --git a/tools/efrotools/build.py b/tools/efrotools/build.py new file mode 100644 index 00000000..3ac67166 --- /dev/null +++ b/tools/efrotools/build.py @@ -0,0 +1,185 @@ +# Released under the MIT License. See LICENSE for details. +# +"""Functionality used for building.""" + +from __future__ import annotations + +import os +import subprocess +from pathlib import Path +from typing import TYPE_CHECKING + +from efro.terminal import Clr + +if TYPE_CHECKING: + from typing import Optional, Callable + + +class Lazybuild: + """Run a build if anything in some category is newer than a target. + + This can be used as an optimization for build targets that *always* run. + As an example, a target that spins up a VM and runs a build can be + expensive even if the VM build process determines that nothing has changed + and does no work. We can use this to examine a broad swath of source files + and skip firing up the VM if nothing has changed. We can be overly broad + in the sources we look at since the worst result of a false positive change + is the VM spinning up and determining that no actual inputs have changed. + We could recreate this mechanism purely in the Makefile, but large numbers + of target sources can add significant overhead each time the Makefile is + invoked; in our case the cost is only incurred when a build is triggered. + + Note that target's mod-time will *always* be updated to match the newest + source regardless of whether the build itself was triggered. + """ + + def __init__(self, + target: str, + srcpaths: list[str], + command: str, + dirfilter: Optional[Callable[[str, str], bool]] = None, + filefilter: Optional[Callable[[str, str], bool]] = None, + srcpaths_fullclean: Optional[list[str]] = None, + command_fullclean: Optional[str] = None) -> None: + self.target = target + self.srcpaths = srcpaths + self.command = command + self.dirfilter = dirfilter + self.filefilter = filefilter + self.mtime = None if not os.path.exists( + self.target) else os.path.getmtime(self.target) + + # Show prettier names for lazybuild cache dir targets. + if target.startswith('.cache/lazybuild/'): + self.target_name_pretty = target[len('.cache/lazybuild/'):] + else: + self.target_name_pretty = target + + self.have_fullclean_changes = False + self.have_changes = False + self.total_unchanged_count = 0 + + # We support a mechanism where some paths can be passed as 'fullclean' + # paths - these will trigger a separate 'fullclean' command as well as + # the regular command when any of them change. This is handy for 'meta' + # type builds where a lot of tools scripts can conceivably influence + # target creation, but where it would be unwieldy to list all of them + # as sources in a Makefile. + self.srcpaths_fullclean = srcpaths_fullclean + self.command_fullclean = command_fullclean + if ((self.srcpaths_fullclean is None) != + (self.command_fullclean is None)): + raise RuntimeError('Must provide both srcpaths_fullclean and' + ' command_fullclean together') + + def run(self) -> None: + """Do the thing.""" + + self._check_paths() + + if self.have_fullclean_changes: + assert self.command_fullclean is not None + print(f'{Clr.BLU}Lazybuild: \'fullclean\' input changed;' + f' running {Clr.BLD}{self.command_fullclean}.{Clr.RST}') + subprocess.run(self.command_fullclean, shell=True, check=True) + + if self.have_changes: + subprocess.run(self.command, shell=True, check=True) + + # We also explicitly update the mod-time of the target; + # the command we (such as a VM build) may not have actually + # done anything but we still want to update our target to + # be newer than all the lazy sources. + os.makedirs(os.path.dirname(self.target), exist_ok=True) + Path(self.target).touch() + else: + print( + f'{Clr.BLU}Lazybuild: skipping "{self.target_name_pretty}"' + f' ({self.total_unchanged_count} inputs unchanged).{Clr.RST}') + + def _check_paths(self) -> None: + + # First check our fullclean paths if we have them. + # any changes here will kick off a full-clean and then a build. + if self.srcpaths_fullclean is not None: + for srcpath in self.srcpaths_fullclean: + src_did_change, src_unchanged_count = self._check_path(srcpath) + if src_did_change: + self.have_fullclean_changes = True + self.have_changes = True + return # Can stop as soon as we find a change. + self.total_unchanged_count += src_unchanged_count + + # Ok; no fullclean changes found. Now check our regular paths. + # Any changes here just trigger a regular build. + for srcpath in self.srcpaths: + src_did_change, src_unchanged_count = self._check_path(srcpath) + if src_did_change: + self.have_changes = True + return # Can stop as soon as we find a change. + self.total_unchanged_count += src_unchanged_count + + def _check_path(self, srcpath: str) -> tuple[bool, int]: + """Return whether path has changed and unchanged file count if not.""" + unchanged_count = 0 + + # Add files verbatim; recurse through dirs. + if os.path.isfile(srcpath): + if self._test_path(srcpath): + return True, 0 + unchanged_count += 1 + return False, unchanged_count + for root, dirnames, fnames in os.walk(srcpath, topdown=True): + # In top-down mode we can modify dirnames in-place to + # prevent recursing into them at all. + for dirname in list(dirnames): # (make a copy) + if (not self._default_dir_filter(root, dirname) + or (self.dirfilter is not None + and not self.dirfilter(root, dirname))): + dirnames.remove(dirname) + + for fname in fnames: + if (not self._default_file_filter(root, fname) + or (self.filefilter is not None + and not self.filefilter(root, fname))): + continue + fpath = os.path.join(root, fname) + + # For now don't wanna worry about supporting spaces. + if ' ' in fpath: + raise RuntimeError(f'Invalid path with space: {fpath}') + + if self._test_path(fpath): + return True, 0 + unchanged_count += 1 + return False, unchanged_count + + def _default_dir_filter(self, root: str, dirname: str) -> bool: + del root # Unused. + + # Ignore hidden dirs. + if dirname.startswith('.'): + return False + + # Ignore Python caches. + if dirname == '__pycache__': + return False + + return True + + def _default_file_filter(self, root: str, fname: str) -> bool: + del root # Unused. + + # Ignore hidden files. + if fname.startswith('.'): + return False + + return True + + def _test_path(self, path: str) -> bool: + # Now see this path is newer than our target.. + if self.mtime is None or os.path.getmtime(path) >= self.mtime: + print(f'{Clr.SMAG}Build of {self.target_name_pretty} triggered' + f' by change in \'{path}\'{Clr.RST}') + return True + return False diff --git a/tools/efrotools/filecommand.py b/tools/efrotools/filecommand.py index 136f2f7d..098e8586 100644 --- a/tools/efrotools/filecommand.py +++ b/tools/efrotools/filecommand.py @@ -34,6 +34,7 @@ class _FileBatchesRun: if self._include_mac_packages: # pylint: disable=useless-suppression # pylint: disable=no-name-in-module, import-error + # noinspection PyUnresolvedReferences from Cocoa import NSWorkspace self._shared_nsworkspace = NSWorkspace.sharedWorkspace() # pylint: enable=useless-suppression diff --git a/tools/efrotools/message.py b/tools/efrotools/message.py index 95355e04..d66cc9bb 100644 --- a/tools/efrotools/message.py +++ b/tools/efrotools/message.py @@ -13,8 +13,6 @@ from efrotools.code import format_yapf_str if TYPE_CHECKING: from typing import Optional - from efro.message import MessageProtocol - def standard_message_sender_gen_pcommand( projroot: Path, diff --git a/tools/efrotools/statictest.py b/tools/efrotools/statictest.py index b86f40a5..5774a385 100644 --- a/tools/efrotools/statictest.py +++ b/tools/efrotools/statictest.py @@ -131,6 +131,7 @@ class StaticTestFile: f'{self._filename} line {lineno+1}: expected ' f' a single assert statement.') assertnode = tree.body[0] + # noinspection PyUnresolvedReferences callnode = assertnode.test if (not isinstance(callnode, ast.Call) or not isinstance(callnode.func, ast.Name)